Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    Tina procd-init 与 busybox-init 切换

    Linux
    init tina-linux
    3
    4
    2970
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      YterAA LV 7 last edited by

      tina 默认为 procd-init。

      Procd INIT

      make menuconfig 进行配置

      1. System init 选择procd-init

      2. 以下一步步选中

         Base system  --->
         <*>block-mount
         <*>busybox................................ Core utilities for embedded Linux  --->
                 Init Utilities  --->
                 [ ] init       此处不选
      
      1. env.cfg修改
      init=/sbin/init
      

      Busybox INIT

      make menuconfig 进行配置

      1. System init 选择busy-init

      2. 以下一步步选中

         Base system  --->
         <*>busybox................................ Core utilities for embedded Linux  --->
                Init Utilities  --->
                [* ] init       此处选上
      
      1. env.cfg 修改
      init=/init
      rdinit=/rdinit
      
      L 1 Reply Last reply Reply Quote Share 0
      • M
        memory LV 7 last edited by

        rdinit=/rdinit
        这个是干嘛的?

        Y 1 Reply Last reply Reply Quote Share 0
        • Y
          YterAA LV 7 @memory last edited by YterAA

          @memory

          11307b18-f0ec-46e5-b7af-6e3ef5741576-image.png

          (1)如果ramdisk_execute_command变量指定了要运行的程序,则启动它。
                    ramdisk_execute_command的取值分三种情况,
                   1)如果命令行参数指定了“rdinit=xxx”,则ramdisk_execute_command等于这个参数指定的程序
                   2)否则,如果/init程序存在,ramdisk_execute_command就等于“/init”。
                   3)否则,ramdisk__execute_command为空
          (2)如果execute_command变量指定了要运行的程序,启动它。
                   如果命令行参数指定了"init=...",则execute_command等于这个参数指定的程序,否则为空
          (3)如果ramdisk_execute_command和execute_command参数都没有指定,则依次执行”/sbin/init、/etc/init、/bin/init、/bin/sh“
          
          在tina系统中,我们可以通过去修改env.cfg文件”rdinit=xxx“或”init=xxx“参数来指定启动的第一个用户进程
          
          1 Reply Last reply Reply Quote Share 2
          • L
            laocai LV 5 @YterAA last edited by

            @yteraa 我补充一点,Tina默认是用的procd,如果要切换到busybox-init, Base system里面要确保procd package被关闭。否则编译的时候会出现如下错误:

            Configuring canutils-candump.
            Collected errors:
             * check_data_file_clashes: Package busybox wants to install file /opt/tina5sdk-bsp/out/t113_i/maple/openwrt/build_dir/target/root-t113_i-maple/sbin/init
            	But that file is already provided by package  * procd
             * opkg_install_cmd: Cannot install package busybox.
            package/Makefile:66: recipe for target 'package/install' failed
            make[2]: *** [package/install] Error 255
            make[2]: Leaving directory '/opt/tina5sdk-bsp/openwrt/openwrt'
            package/Makefile:111: recipe for target '/opt/tina5sdk-bsp/openwrt/openwrt/staging_dir/target/stamp/.package_install' failed
            make[1]: *** [/opt/tina5sdk-bsp/openwrt/openwrt/staging_dir/target/stamp/.package_install] Error 2
            make[1]: Leaving directory '/opt/tina5sdk-bsp/openwrt/openwrt'
            /opt/tina5sdk-bsp/openwrt/openwrt/include/toplevel.mk:238: recipe for target 'world' failed
            make: *** [world] Error 2
            make: Leaving directory '/opt/tina5sdk-bsp/openwrt/openwrt'
            INFO: build_openwrt_rootfs failed
            
            
            1 Reply Last reply Reply Quote Share 0
            • 1 / 1
            • First post
              Last post

            Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

            行为准则 | 用户协议 | 隐私权政策