Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Haris Okanovic <haris.okanovic@ni.com>
To: <openembedded-core@lists.openembedded.org>
Cc: Haris Okanovic <haris.okanovic@ni.com>
Subject: [PATCH v2] run-postinsts: Print message before running deferred postinst scripts
Date: Tue, 6 Dec 2016 13:51:52 -0600	[thread overview]
Message-ID: <20161206195152.7493-1-haris.okanovic@ni.com> (raw)
In-Reply-To: <CAJTo0La+W7qJikWqjHh6f90M_Cr_v2EUwegE+CGRLYCR5D6K8A@mail.gmail.com>

Package managers can defer running postinst scripts to first boot, which
can take a while on some systems. E.g. The output of `opkg configure`
(or whatever pm is used) is redirected to a file when logging is enabled
($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 they do
not mistakenly reboot the 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>
---
 meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index 04ba394..660ddc2 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -46,6 +46,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
-- 
2.10.1



      parent reply	other threads:[~2016-12-06 19:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 21:48 [PATCH] run-postinsts: Print message before running deferred postinst scripts Haris Okanovic
2016-12-05 22:51 ` Burton, Ross
2016-12-06 19:01   ` Haris Okanovic
2016-12-06 19:51   ` Haris Okanovic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161206195152.7493-1-haris.okanovic@ni.com \
    --to=haris.okanovic@ni.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox