]> code.ossystems Code Review - openembedded-core.git/commitdiff
sysvinit-inittab: do not use 'exit 1' to postpone to first boot
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Tue, 1 May 2018 18:06:46 +0000 (21:06 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 15 May 2018 09:00:27 +0000 (10:00 +0100)
Instead, first check if we need to do anything at all during first boot,
and if so, either postpone to first boot via pkg_postinst_ontarget()
when running on host, or run the necessary setup code when running on target.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb

index 5b9c422cafa32cf10ce366463eadeacc1de012b1..8585a418ab8def45a06bdfc88d0983d01f5bada7 100644 (file)
@@ -53,8 +53,15 @@ EOF
 }
 
 pkg_postinst_${PN} () {
+# run this on host and on target
+if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
+       exit 0
+fi
+}
+
+pkg_postinst_ontarget_${PN} () {
 # run this on the target
-if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
+if [ -e /proc/consoles ]; then
        tmp="${SERIAL_CONSOLES_CHECK}"
        for i in $tmp
        do
@@ -68,11 +75,7 @@ if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
        done
        kill -HUP 1
 else
-       if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
-               exit 0
-       else
-               exit 1
-       fi
+       exit 1
 fi
 }