diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2018-10-22 15:03:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-28 08:31:57 +0000 |
commit | 360bba5cc90f7404c517d4d5aabde8cf186917c5 (patch) | |
tree | 103c4023d372d126a311dde9759a72f148872bb4 /meta/recipes-core/systemd | |
parent | 4001e1adb21b9785a19669968f07166f5b8772cd (diff) | |
download | poky-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.bb | 23 |
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 | ||
554 | ALTERNATIVE_${PN} = "resolv-conf reboot" | 554 | ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf" |
555 | 555 | ||
556 | ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" | 556 | ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" |
557 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" | 557 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" |
558 | ALTERNATIVE_PRIORITY[resolv-conf] ?= "50" | 558 | ALTERNATIVE_PRIORITY[resolv-conf] ?= "50" |
559 | 559 | ||
560 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
561 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
562 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
563 | |||
564 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
560 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | 565 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" |
561 | ALTERNATIVE_PRIORITY[reboot] = "100" | 566 | ALTERNATIVE_PRIORITY[reboot] ?= "300" |
567 | |||
568 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
569 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
570 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
571 | |||
572 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
573 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
574 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
575 | |||
576 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
577 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
578 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
562 | 579 | ||
563 | pkg_postinst_${PN} () { | 580 | pkg_postinst_${PN} () { |
564 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | 581 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ |