yocto disable autostart of systemd services at compile time
Asked Answered
A

1

2

i want to disable auto starting for the timesyncd.service at boot up on my embedded linux target running linux image compile with Yocto

under my board name, i tried creating systemd_%.bbappend file with content at

/meta-xxxx/recipes-core/systemd/systemd_%.bbappend

inherit systemd
do_install_append() {

        echo "djm";
        #rm -fr ${D}${sysconfdir}/systemd/system/dbus-org.freedesktop.resolve1.service
        #rm -fr ${D}${sysconfdir}/systemd/system/multi-user.target.wants/systemd-resolved.service

        #rm -fr ${D}${sysconfdir}/systemd/system/dbus-org.freedesktop.timesync1.service
        #rm -fr ${D}${sysconfdir}/systemd/system/sysinit.target.wants/systemd-timesyncd.service
        echo "djm-2";
        echo "D=  "  ${D};
        echo "syscondfdir= " ${sysconfdir};
        ls -l  ${D}${sysconfdir}/systemd/system/
 #      exit 1

}

but i still see the soft link to start the timesyncd in the /etc/systemd/system folder

printing the ${D} shows me

build-xxxx/tmp/work/cortex-xxxx-linux-gnueabi/systemd/1_243.2-r0/image

the build-xxxx/tmp/work/cortex-xxxx-linux-gnueabi/systemd/1_243.2-r0/image/etc is blank now

so it means that when the do_install_append is run , the folder structure is blank and the real recipe which creates/ the flow at which the soft link is create is at different recipe or different function ? can someone help me in, how i should be doing this at compile time in yocto ?

Anubis answered 9/5, 2021 at 18:3 Comment(4)
Does this answer your question? Disable a standard systemd service in Yocto buildBrunhilde
PACKAGECONFIG_remove = "timesyncd" removed the whole package.. i want the service, but it should not be there in autoboot. so i want to delete the soft linkt in mulit-user.target . i did not figure out how to use the SYSTEMD_AUTO_ENABLE_${PN} = "disable" for timesyncdAnubis
Read all the answers.Brunhilde
i tried all in that, do_install_append do not seems to be executed at correct flow..Anubis
A
3

figured out how to do this, we have to update the systemd.preset file for the feature/packages coming default with the systemd.

in file meta-xxx/recipes-core/systemd/systemd_%.bbappend

do_configure_append() {

#disabling autostart of systemd-timesyncd
    sed -i -e "s/enable systemd-timesyncd.service/disable systemd-timesyncd.service/g" ${S}/presets/90-systemd.preset

#disabling autostart of systemd-resolved
    sed -i -e "s/enable systemd-resolved.service/disable systemd-resolved.service/g" ${S}/presets/90-systemd.preset
}
Anubis answered 12/5, 2021 at 14:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.