In yocto tpm2 recipe the following recipe is not workin fine:
install -d "${D}${sysconfdir}/init.d"
It's not able to create a folder named init.d. If I change folder name to init_d it is able to create the folder.
It appears strange to me becuase init.d is a very common in Linux and it's present under etc and I guess many recipes in Ycoto are doing this.
If I execute the command as install -d /home/builduser/build/tmp/work/armv8a-poky-linux/tpm2-abrmd/2.4.1-r0/image/etc/init.d from terminal it creates the folder correctly where if should have created from inside the recipe also when run by bitbake command. I can see this command executed if I run bitbake with -v option.
Original code for recipe is here : https://gitlab.com/akuster/meta-security/-/blob/master-next/meta-tpm/recipes-tpm2/tpm2-abrmd/tpm2-abrmd_3.0.0.bb#L42
installing tpm2-tools using meta-tpm2 layer in yocto.
Tthe folder is indeed created. However, the recipe also inherits the
systemdclass. This class will delete/etc/init.dto prevent duplicating systemV and systemd units whenDISTRO_FEATUREScontainssystemd. Seerm_sysvinit_initddirin systemd.bbclass:You should not use legacy
/etc/init.dscripts together withsystemdin yourDISTRO_FEATURES. You have to choose between systemd and systemV and setupDISTRO_FEATURESin yourdistro.confaccordingly. If you plan on keeping the older systemV init manager, then removesystemdfromDISTRO_FEATURES. Otherwise, drop/etc/init.din favor of/lib/systemd/units.Note: systemd has compatibility with
/etc/init.dbut it is not recommended in production. It produces a warning. If you have another recipe which provides onlyinit.dfiles, do notinherit systemdin that recipe.