Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] init-install-efi.sh: improve info message
@ 2018-10-11  8:41 Anuj Mittal
  2018-10-11  8:41 ` [PATCH 2/3] busybox: move reboot out of init.cfg Anuj Mittal
  2018-10-11  8:41 ` [PATCH 3/3] systemd: add ALTERNATIVE for reboot Anuj Mittal
  0 siblings, 2 replies; 4+ messages in thread
From: Anuj Mittal @ 2018-10-11  8:41 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/recipes-core/initrdscripts/files/init-install-efi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index 82b0aa819e..b6855b5aac 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -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
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] busybox: move reboot out of init.cfg
  2018-10-11  8:41 [PATCH 1/3] init-install-efi.sh: improve info message Anuj Mittal
@ 2018-10-11  8:41 ` Anuj Mittal
  2018-10-11  8:47   ` Martin Jansa
  2018-10-11  8:41 ` [PATCH 3/3] systemd: add ALTERNATIVE for reboot Anuj Mittal
  1 sibling, 1 reply; 4+ messages in thread
From: Anuj Mittal @ 2018-10-11  8:41 UTC (permalink / raw)
  To: openembedded-core

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

commit b6fbb3f3d4d6367b0fd7921078f67057551c7ede
Author: Chen Qi <Qi.Chen@windriver.com>
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.

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/recipes-core/busybox/busybox/defconfig | 2 +-
 meta/recipes-core/busybox/busybox/init.cfg  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig
index f081f281cc..32213c0675 100644
--- a/meta/recipes-core/busybox/busybox/defconfig
+++ b/meta/recipes-core/busybox/busybox/defconfig
@@ -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
diff --git a/meta/recipes-core/busybox/busybox/init.cfg b/meta/recipes-core/busybox/busybox/init.cfg
index 3c1fdd42b6..3b839c515c 100644
--- a/meta/recipes-core/busybox/busybox/init.cfg
+++ b/meta/recipes-core/busybox/busybox/init.cfg
@@ -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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] systemd: add ALTERNATIVE for reboot
  2018-10-11  8:41 [PATCH 1/3] init-install-efi.sh: improve info message Anuj Mittal
  2018-10-11  8:41 ` [PATCH 2/3] busybox: move reboot out of init.cfg Anuj Mittal
@ 2018-10-11  8:41 ` Anuj Mittal
  1 sibling, 0 replies; 4+ messages in thread
From: Anuj Mittal @ 2018-10-11  8:41 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/recipes-core/systemd/systemd_239.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
index 194efb5b94..7ed932141d 100644
--- a/meta/recipes-core/systemd/systemd_239.bb
+++ b/meta/recipes-core/systemd/systemd_239.bb
@@ -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/' \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3] busybox: move reboot out of init.cfg
  2018-10-11  8:41 ` [PATCH 2/3] busybox: move reboot out of init.cfg Anuj Mittal
@ 2018-10-11  8:47   ` Martin Jansa
  0 siblings, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2018-10-11  8:47 UTC (permalink / raw)
  To: anuj.mittal; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 5143 bytes --]

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,


On Thu, Oct 11, 2018 at 10:41 AM Anuj Mittal <anuj.mittal@intel.com> wrote:

> reboot is needed for initramfs where no init manager is set. This
> partially reverts:
>
> commit b6fbb3f3d4d6367b0fd7921078f67057551c7ede
> Author: Chen Qi <Qi.Chen@windriver.com>
> 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.
>
> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
> ---
>  meta/recipes-core/busybox/busybox/defconfig | 2 +-
>  meta/recipes-core/busybox/busybox/init.cfg  | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/busybox/busybox/defconfig
> b/meta/recipes-core/busybox/busybox/defconfig
> index f081f281cc..32213c0675 100644
> --- a/meta/recipes-core/busybox/busybox/defconfig
> +++ b/meta/recipes-core/busybox/busybox/defconfig
> @@ -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
> diff --git a/meta/recipes-core/busybox/busybox/init.cfg
> b/meta/recipes-core/busybox/busybox/init.cfg
> index 3c1fdd42b6..3b839c515c 100644
> --- a/meta/recipes-core/busybox/busybox/init.cfg
> +++ b/meta/recipes-core/busybox/busybox/init.cfg
> @@ -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
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 6650 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-11  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-11  8:41 [PATCH 1/3] init-install-efi.sh: improve info message Anuj Mittal
2018-10-11  8:41 ` [PATCH 2/3] busybox: move reboot out of init.cfg Anuj Mittal
2018-10-11  8:47   ` Martin Jansa
2018-10-11  8:41 ` [PATCH 3/3] systemd: add ALTERNATIVE for reboot Anuj Mittal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox