]> code.ossystems Code Review - openembedded-core.git/commitdiff
run-postinsts: Print message before running deferred postinst scripts
authorHaris Okanovic <haris.okanovic@ni.com>
Mon, 5 Dec 2016 21:48:18 +0000 (15:48 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Dec 2016 10:26:14 +0000 (10:26 +0000)
Opkg can defer running postinst scripts to first boot, which can take
a while on some systems. The output of `opkg configure` (or whatever pm
is used) is redirected to a file when logging is enabled
(I.e. $POSTINST_LOGGING == 1), making the machine appear hung during
this process. This change simply prints a wait message on the console
to inform the user of this potentially long and silent operation so
that they do not mistakenly reboot their machine.

Why not simply `tee` the output instead?
Tee might be provided by BusyBox in some distros, which may need to run
update-alternatives in the very postinst scripts being executed by this
process. It's therefore not safe to assume Tee (or any other packaged
util) is available until the configure process finishes.

Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts

index 10f2118e9611c1e83693f59fbb5f8d4873a9eecf..50c0a1afeaee62db4d89e42b4d83f3cb48e83662 100755 (executable)
@@ -48,6 +48,9 @@ if [ -z "$pi_dir" ]; then
        exit 0
 fi
 
+echo "Configuring packages on first boot...."
+echo " (This may take several minutes. Please do not power off the machine.)"
+
 [ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
 
 if [ "$POSTINST_LOGGING" = "1" ]; then