导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页

    Tina procd-init 与 busybox-init 切换

    Linux
    init tina-linux
    3
    4
    2944
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • Y
      YterAA LV 7 最后由 编辑

      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 条回复 最后回复 回复 引用 分享 0
      • M
        memory LV 7 最后由 编辑

        rdinit=/rdinit
        这个是干嘛的?

        Y 1 条回复 最后回复 回复 引用 分享 0
        • Y
          YterAA LV 7 @memory 最后由 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 条回复 最后回复 回复 引用 分享 2
          • L
            laocai LV 5 @YterAA 最后由 编辑

            @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 条回复 最后回复 回复 引用 分享 0
            • 1 / 1
            • First post
              Last post

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

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