summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2018-10-22 15:03:43 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-28 08:31:57 +0000
commit360bba5cc90f7404c517d4d5aabde8cf186917c5 (patch)
tree103c4023d372d126a311dde9759a72f148872bb4 /meta/recipes-core/systemd
parent4001e1adb21b9785a19669968f07166f5b8772cd (diff)
downloadpoky-360bba5cc90f7404c517d4d5aabde8cf186917c5.tar.gz
systemd: add back alternatives for init utitilies
Add back alternatives for init utilities to avoid regression. These alternatives were removed when upgradeing systemd to 239. They were removed out of the logic that init utitilies should be bound to init manager. However, it turned out that two use cases were not covered. 1) initramfs using commands like 'reboot' from busybox. 2) Users use customized busybox defconfig which enables init utilities. The first use case caused a regression bug in yocto. https://bugzilla.yoctoproject.org/show_bug.cgi?id=12914 Patches were sent to fix the reboot problem. But this is not enough. As we may have the second use case. In such situation, users will find themselves having regression error when using 'busybox + systemd' (and busybox is installed after systemd, overriding the systemd symlinks). So in order to avoid regression, add back these alternatives. (From OE-Core rev: 43ef422d80e0544232a9361187ac1c608304c969) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd_239.bb23
1 files changed, 20 insertions, 3 deletions
diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
index acdce5cee7..fe67c45f03 100644
--- a/meta/recipes-core/systemd/systemd_239.bb
+++ b/meta/recipes-core/systemd/systemd_239.bb
@@ -442,7 +442,7 @@ FILES_${PN} = " ${base_bindir}/* \
442 ${base_sbindir}/runlevel \ 442 ${base_sbindir}/runlevel \
443 ${base_sbindir}/telinit \ 443 ${base_sbindir}/telinit \
444 ${base_sbindir}/resolvconf \ 444 ${base_sbindir}/resolvconf \
445 ${base_sbindir}/reboot.systemd \ 445 ${base_sbindir}/reboot \
446 ${base_sbindir}/init \ 446 ${base_sbindir}/init \
447 ${datadir}/dbus-1/services \ 447 ${datadir}/dbus-1/services \
448 ${datadir}/dbus-1/system-services \ 448 ${datadir}/dbus-1/system-services \
@@ -551,14 +551,31 @@ python __anonymous() {
551 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") 551 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
552} 552}
553 553
554ALTERNATIVE_${PN} = "resolv-conf reboot" 554ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
555 555
556ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" 556ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
557ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" 557ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
558ALTERNATIVE_PRIORITY[resolv-conf] ?= "50" 558ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
559 559
560ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
561ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
562ALTERNATIVE_PRIORITY[halt] ?= "300"
563
564ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
560ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" 565ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
561ALTERNATIVE_PRIORITY[reboot] = "100" 566ALTERNATIVE_PRIORITY[reboot] ?= "300"
567
568ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
569ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
570ALTERNATIVE_PRIORITY[shutdown] ?= "300"
571
572ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
573ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
574ALTERNATIVE_PRIORITY[poweroff] ?= "300"
575
576ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
577ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
578ALTERNATIVE_PRIORITY[runlevel] ?= "300"
562 579
563pkg_postinst_${PN} () { 580pkg_postinst_${PN} () {
564 sed -e '/^hosts:/s/\s*\<myhostname\>//' \ 581 sed -e '/^hosts:/s/\s*\<myhostname\>//' \