Skip to contentSkip to conversation

init-install-efi.sh: improve info message

PATCH In review Anuj Mittal 2 participants 4 messages Oct 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 init-install-efi.sh: improve info message

Let users know that the installation was successful and that pressing Enter would lead to a reboot.

---
 meta/recipes-core/initrdscripts/files/init-install-efi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/initrdscripts/files/init-install-efi.sh +1 -1
index 82b0aa819e..b6855b5aac 100644
@@ -291,7 +291,7 @@ umount /boot
 
 sync
 
-echo "Remove your installation media, and press ENTER"
+echo "Installation successful. Remove your installation media and press ENTER to reboot."
 
 read enter
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 busybox: move reboot out of init.cfg

reboot is needed for initramfs where no init manager is set. This partially reverts:

commit b6fbb3f3d4d6367b0fd7921078f67057551c7ede

Author: Chen Qi <[email protected]>
Date:   Mon Jul 30 17:41:57 2018 +0800

busybox: move init related configs to init.cfg

Move init related configs to init.cfg.

These config items do not make much sense unless busybox is selected as the init manager. They should belong to init.cfg.

We would need to set up ALTERNATIVES for reboot in this case.

---
 meta/recipes-core/busybox/busybox/defconfig | 2 +-
 meta/recipes-core/busybox/busybox/init.cfg  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/busybox/busybox/defconfig +1 -1
index f081f281cc..32213c0675 100644
@@ -480,7 +480,7 @@ CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
 # CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
 # CONFIG_HALT is not set
 # CONFIG_POWEROFF is not set
-# CONFIG_REBOOT is not set
+CONFIG_REBOOT=y
 # CONFIG_FEATURE_CALL_TELINIT is not set
 # CONFIG_TELINIT_PATH is not set
 # CONFIG_INIT is not set
meta/recipes-core/busybox/busybox/init.cfg +0 -1
index 3c1fdd42b6..3b839c515c 100644
@@ -2,7 +2,6 @@ CONFIG_INIT=y
 CONFIG_FEATURE_USE_INITTAB=y
 CONFIG_HALT=y
 CONFIG_POWEROFF=y
-CONFIG_REBOOT=y
 CONFIG_FEATURE_KILL_DELAY=0
 CONFIG_TELINIT_PATH=""
 CONFIG_INIT_TERMINAL_TYPE=""
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH 2/3] busybox: move reboot out of init.cfg

Does busybox's reboot work fine with recent systemd?

It stopped working for me and unfortunately u-a silently replaces reboot -> ../bin/systemctl
symlink with
/sbin/reboot -> /bin/busybox.nosuid

In my images the busybox applets are unusable:

    root@rpijama:~# reboot
    root@rpijama:~# [ 2495.348099] systemd: 18 output lines suppressed due
to ratelimiting
    [ 2495.380408] systemd[1]: systemd 239 running in system mode. (-PAM
-AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP
-GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN
-PCRE2 default-hierarchy=hybrid)
    [ 2495.402735] systemd[1]: Detected architecture arm.
    [ 2495.501328] systemd[1]: File
/lib/systemd/system/systemd-udevd.service:36 configures an IP firewall
(IPAddressDeny=any), but the local system does not support BPF/cgroup based
firewalling.
    [ 2495.519048] systemd[1]: Proceeding WITHOUT firewalling in effect!
(This warning is only shown for the first loaded unit using IP firewalling.)
    root@rpijama:~# halt
    [ 2521.200058] systemd[1]: Received SIGUSR1 from PID 1062 (halt).
    [ 2521.206062] systemd[1]: Trying to reconnect to bus...

and it doesn't reboot or halt.

You can update systemd to use u-a for those commands as well, that way systemd version will win when both are enabled.

The same does apply for reboot, halt, poweroff:

symlinks provided by systemd:

    lrwxrwxrwx 1 bitbake bitbake   16 Mar  9  2018 halt -> ../bin/systemctl
    lrwxrwxrwx 1 bitbake bitbake   22 Mar  9  2018 init ->
../lib/systemd/systemd
    lrwxrwxrwx 1 bitbake bitbake   16 Mar  9  2018 poweroff ->
../bin/systemctl
    lrwxrwxrwx 1 bitbake bitbake   16 Mar  9  2018 reboot ->
../bin/systemctl
    lrwxrwxrwx 1 bitbake bitbake   21 Mar  9  2018 resolvconf ->
../usr/bin/resolvectl
    lrwxrwxrwx 1 bitbake bitbake   16 Mar  9  2018 runlevel ->
../bin/systemctl
    lrwxrwxrwx 1 bitbake bitbake   16 Mar  9  2018 shutdown ->
../bin/systemctl
    lrwxrwxrwx 1 bitbake bitbake   16 Mar  9  2018 telinit ->

../bin/systemctl

are silently overwritten by u-a symlinks pointing to busybox:
root@rpijama:~# ls -lah /sbin/halt /sbin/init /sbin/poweroff
/sbin/reboot /sbin/resolvconf /sbin/runlevel /sbin/shutdown /sbin/telinit

    lrwxrwxrwx    1 root     root          19 Mar  9  2018 /sbin/halt ->
/bin/busybox.nosuid
    lrwxrwxrwx    1 root     root          22 Mar  9  2018 /sbin/init ->
../lib/systemd/systemd
    lrwxrwxrwx    1 root     root          19 Mar  9  2018 /sbin/poweroff
-> /bin/busybox.nosuid
    lrwxrwxrwx    1 root     root          19 Mar  9  2018 /sbin/reboot ->

/bin/busybox.nosuid
lrwxrwxrwx 1 root root 21 Mar 9 2018 /sbin/resolvconf
-> ../usr/bin/resolvectl
lrwxrwxrwx 1 root root 16 Mar 9 2018 /sbin/runlevel
-> ../bin/systemctl
lrwxrwxrwx 1 root root 16 Mar 9 2018 /sbin/shutdown
-> ../bin/systemctl

Cheers,

Quoted 58 lines · Anuj Mittal

reboot is needed for initramfs where no init manager is set. This partially reverts:

commit b6fbb3f3d4d6367b0fd7921078f67057551c7ede

Author: Chen Qi <[email protected]>
Date:   Mon Jul 30 17:41:57 2018 +0800

busybox: move init related configs to init.cfg

Move init related configs to init.cfg.

These config items do not make much sense unless busybox is selected as the init manager. They should belong to init.cfg.

We would need to set up ALTERNATIVES for reboot in this case.

---
 meta/recipes-core/busybox/busybox/defconfig | 2 +-
 meta/recipes-core/busybox/busybox/init.cfg  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/busybox/busybox/defconfig +1 -1
index f081f281cc..32213c0675 100644
@@ -480,7 +480,7 @@ CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
 # CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
 # CONFIG_HALT is not set
 # CONFIG_POWEROFF is not set
-# CONFIG_REBOOT is not set
+CONFIG_REBOOT=y
 # CONFIG_FEATURE_CALL_TELINIT is not set
 # CONFIG_TELINIT_PATH is not set
 # CONFIG_INIT is not set
meta/recipes-core/busybox/busybox/init.cfg +0 -2
index 3c1fdd42b6..3b839c515c 100644
@@ -2,7 +2,6 @@ CONFIG_INIT=y
 CONFIG_FEATURE_USE_INITTAB=y
 CONFIG_HALT=y
 CONFIG_POWEROFF=y
-CONFIG_REBOOT=y
 CONFIG_FEATURE_KILL_DELAY=0
 CONFIG_TELINIT_PATH=""
 CONFIG_INIT_TERMINAL_TYPE=""
--

2.17.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

PATCH 3/3 systemd: add ALTERNATIVE for reboot

In reply to Anuj Mittal

reboot is provided by busybox too. Add ALTERNATIVE to ensure that there are no conflicts when both are installed.

---
 meta/recipes-core/systemd/systemd_239.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meta/recipes-core/systemd/systemd_239.bb +5 -2
index 194efb5b94..7ed932141d 100644
@@ -447,7 +447,7 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${base_sbindir}/runlevel \
                 ${base_sbindir}/telinit \
                 ${base_sbindir}/resolvconf \
-                ${base_sbindir}/reboot \
+                ${base_sbindir}/reboot.systemd \
                 ${base_sbindir}/init \
                 ${datadir}/dbus-1/services \
                 ${datadir}/dbus-1/system-services \
@@ -556,12 +556,15 @@ python __anonymous() {
         d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
 }
 
-ALTERNATIVE_${PN} = "resolv-conf"
+ALTERNATIVE_${PN} = "resolv-conf reboot"
 
 ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
 ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
 ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
 
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_PRIORITY[reboot] = "100"
+
 pkg_postinst_${PN} () {
 	sed -e '/^hosts:/s/\s*\<myhostname\>//' \
 		-e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
Signature · 1 line
2.17.1