]> git.ozlabs.org Git - petitboot/commitdiff
utils/pb-console: Trap SIGTERM on boot v1.10.2
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Mon, 25 Feb 2019 02:47:03 +0000 (13:47 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 5 Mar 2019 20:51:12 +0000 (09:51 +1300)
On kexec all processes will be sent a SIGTERM and SIGKILL. By default
there are messages on the console alerting the user to this, however in
some implementations these messages are disabled. This can have the
effect of the UI seemingly exiting to the shell on boot and hanging for
a short while before the kexec actually jumps into the next kernel.
Trap the SIGTERM sent to the pb-console parent process and print a short
message to the screen instead of momentarily dropping to the shell and
printing the usual help messages.

While here also cleanup the shell help messages below which are now
handled in the shell's .shrc file.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
utils/pb-console

index ad601e2eb879a4871ff93c4380f7240fa44c89b5..5ba98cc4692564b435d1f7d271bf07355e838c06 100644 (file)
@@ -135,12 +135,11 @@ fi
 dmesg -n 1
 
 trap '' SIGINT
 dmesg -n 1
 
 trap '' SIGINT
+trap 'reset; echo "SIGTERM received, booting..."; sleep 2' SIGTERM
 
 while :
 do
        $ui $verbose_opt
        reset
 
 while :
 do
        $ui $verbose_opt
        reset
-       echo "Exiting petitboot. Type 'exit' to return."
-       echo "You may run 'pb-sos' to gather diagnostic data"
        $shell
 done
        $shell
 done