【发布时间】:2021-07-31 07:01:41
【问题描述】:
我想在我的嵌入式 linux 目标上启动时禁用 timesyncd.service 的自动启动,该目标运行使用 Yocto 编译的 linux 映像
在我的董事会名称下,我尝试使用以下内容创建 systemd_%.bbappend 文件
/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
}
但我仍然在 /etc/systemd/system 文件夹中看到启动 timesyncd 的软链接
打印 ${D} 显示我
build-xxxx/tmp/work/cortex-xxxx-linux-gnueabi/systemd/1_243.2-r0/image
build-xxxx/tmp/work/cortex-xxxx-linux-gnueabi/systemd/1_243.2-r0/image/etc 现在为空
所以这意味着当 do_install_append 运行时,文件夹结构是空白的,并且创建软链接的真正配方/创建软链接的流程在不同的配方或不同的功能? 有人可以帮助我吗,我应该如何在 yocto 编译时这样做?
【问题讨论】:
-
PACKAGECONFIG_remove = "timesyncd" 删除了整个包。我想要该服务,但它不应该在自动启动中出现。所以我想删除 mulit-user.target 中的软链接。我不知道如何使用 SYSTEMD_AUTO_ENABLE_${PN} = "disable" for timesyncd
-
阅读所有答案。
-
我都试过了,do_install_append 似乎没有以正确的流程执行..
标签: embedded-linux yocto systemd