diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-01-27 06:01:15 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-27 19:41:35 +0300 |
commit | 5a3f4f11678f8f883db56efaf1c64eedf2b247e9 (patch) | |
tree | f095645f26a018534fa54b3302de8dcb33ebaf57 | |
parent | 49b34bbacc2748044ff0b616b59f00f605f09c94 (diff) | |
download | openbmc-5a3f4f11678f8f883db56efaf1c64eedf2b247e9.tar.xz |
preinit-mounts: Add a proper init alternative
The obmc-ubi-fs feature enables a recipe 'preinit-mounts' that
installs a systemd-launcher script at /sbin/init. This prevents
systemd from installing the /sbin/init alternative.
Add an init alternative to preinit-mounts and set it priority
higher than the one provided by systemd.
Tested: Built and verified Witherspoon image with QEMU
Change-Id: Iaddfcd4b59148d9c5d96b4634bf575ff8c2a05e0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/preinit-mounts/preinit-mounts.bb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/preinit-mounts/preinit-mounts.bb b/meta-phosphor/common/recipes-phosphor/preinit-mounts/preinit-mounts.bb index e3aaf546b..282f8631b 100644 --- a/meta-phosphor/common/recipes-phosphor/preinit-mounts/preinit-mounts.bb +++ b/meta-phosphor/common/recipes-phosphor/preinit-mounts/preinit-mounts.bb @@ -1,10 +1,19 @@ inherit obmc-phosphor-license +inherit update-alternatives SRC_URI += "file://init" -FILES_${PN} += "/sbin/init" +FILES_${PN} += "${base_sbindir}/init" do_install() { - install -d ${D}/sbin - install -m 0755 ${WORKDIR}/init ${D}/sbin/init + install -d ${D}/${base_sbindir} + install -m 0755 ${WORKDIR}/init ${D}/${base_sbindir}/preinit-mounts } + +ALTERNATIVE_${PN} = "init" +ALTERNATIVE_TARGET[init] = "${base_sbindir}/preinit-mounts" +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" + +# Use a number higher than the systemd init alternative so that +# ours is enabled instead. +ALTERNATIVE_PRIORITY[init] ?= "400" |