This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-AM62: About init.d

Part Number: SK-AM62

Hi

In the rootfs I created, using system d as a system service does not provide support for traditional init. d and rc *. d startup scripts. However, in ti's native yocoto platform rootfs, system V management can be supported. I would like to ask what modifications have been made or what configurations have been made using the yocoto platform.

thanks

  • Hi Hao,

    If you want to switch our TI SDK Yocto distrubution images from using systemd to SysVinit init.d you can do that with the below modification:

    a0797059@dasso:~/tisdk/am62xx-evm/sources/meta-arago (HEAD detached at 09.02.00.009)
    $ git diff
    diff --git a/meta-arago-distro/conf/distro/arago.conf b/meta-arago-distro/conf/distro/arago.conf
    index e46ebd26..197e8ebe 100644
    --- a/meta-arago-distro/conf/distro/arago.conf
    +++ b/meta-arago-distro/conf/distro/arago.conf
    @@ -59,7 +59,7 @@ DISTRO_FEATURES_FILTER_NATIVE:append = " opencl opencv openmp"
     DISTRO_FEATURES_FILTER_NATIVESDK:append = " opencl opencv openmp"
    
     # Set global runtime providers for major components
    -ARAGO_SYSVINIT ??= "0"
    +ARAGO_SYSVINIT ??= "1"
     INIT_MANAGER ?= "${@['systemd','sysvinit'][int(d.getVar('ARAGO_SYSVINIT'))]}"
    
     # Distro-specific package configuration

    This is sometimes done when one wants to minimize file system size/boot time, such as in case of creating bootable ramdisk images.

    Another thing you can do is convert your init.d script(s) over into systemd unit files, and do whatever you need to do that way. If you need help figuring out how to do that I'd try some Google searches, or using something like ChatGTP. Should be pretty straightforward I think.

    Regards, Andreas

  • Hi

    In my understanding, Linux system management can only be a choice between system d and busybox. system d starts using. service, while busybox uses sh from init. d to establish a soft connection and start sh in rc *. d. However, in ti evm, I found that both exist. I would like to inquire about how to do this. I can use buildroot to achieve this.

    thanks

  • I looked into the Yocto sources, some more quick comments below:

    can only be a choice between system d and busybox.

    Yes usually you'd pick either one. Yocto does seem to support scenarios with systemd and sysvinit enabled at the same time (via DISTRO_FEATURES) but this triggers some special handling for certain recipes, and is not something the TI "Arago" distribution supports.

    However, in ti evm, I found that both exist.

    Indeed, even though systemd is used by default, there are init scripts located in the /etc folder. Those are not used however. For example there's a script at /etc/init.d/telnetd used to start the Telnet daemon, but even if you remove that script, the telnet daemon still gets started during boot because this happens via systemd /etc/systemd/system/multi-user.target.wants/telnetd.service.

    As said before, best would be for you to just stick to systemd units, and add any new items that way. This being said there is a away to have systemd call those init.d scripts, see https://stackoverflow.com/questions/77907055/yocto-project-system-manger-as-init-d  , so you can experiment with this if you really like. But such specific scenarios that's not something we can support here in the E2E forum which is mostly focused around unique/TI-specific implementation details of various software projects like Yocto.

    Regards, Andreas

  • Indeed, even though systemd is used by default, there are init scripts located in the /etc folder. Those are not used however. For example there's a script at /etc/init.d/telnetd used to start the Telnet daemon, but even if you remove that script, the telnet daemon still gets started during boot because this happens via systemd /etc/systemd/system/multi-user.target.wants/telnetd.service.

    This is only true in sdk9, but there are still many self starting scripts in/etc/init. d in sdk8.6, such as gplv3 notice, hmi_demo. sh, resize-rootfs. sh, etc. I would like to know how this part is configured

  • Yes my answer was regarding to SDK v9.x. As for SDK v8.x, I don't have this set up right now so I can't look/confirmn, and I'm on business travel all week so it won't be until next week the earliest before I can have a look at this. But why don't you try looking this up by yourself by searching through the Yocto source tree.

    As an alternative, try looking up the parent process at runtime by way of parent process ID. To do that, edit one of the scripts to include the following line:

    ps -e | grep $PPID

    I haven't tried it but this might just do the trick.

    Regards, Andreas

  • Yes my answer was regarding to SDK v9.x. As for SDK v8.x, I don't have this set up right now so I can't look/confirmn, and I'm on business travel all week so it won't be until next week the earliest before I can have a look at this. But why don't you try looking this up by yourself by searching through the Yocto source tree.

    I have never used the Yocto platform and have been based on SDK 8.6
    When using buildroot to create rootfs, I am trying to see how rootfs in ti default enables system d to support init. d and rc *. d to start sh

  • Hi Hao,

    as said earlier I won't be able to help with this in the context of SDK v8.6 right now. I've described how the system works for our current SDK, and gave you some steps to figure this out for SDK v8.6 yourself. If you can't do that yourself and need my help this will need to wait until I return from my business trip, next week,

    Regards, Andreas