[SLOF] [PATCH] Rework the printing of the SLOF logo during boot

Thomas Huth thuth at redhat.com
Tue Apr 25 20:18:43 AEST 2017


If the initial boot attempt fails, for example because the file
that we downloaded via TFTP is not executable, or because the user
exited grub instead of booting a kernel, SLOF prints out the ASCII
art SLOF logo and the banner text twice. This is quite ugly.
Also it is somewhat annoying that the logo is printed every time
again if the later boot attempts failed, too. So fix this by
printing the SLOF logo only once, at the end of "start-it", and
by avoiding to print the banner twice during the first boot attempt,
i.e. by adding the ".banner" command to the "boot" command only
after we've done the first attempt via "start-it".

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1443904
Signed-off-by: Thomas Huth <thuth at redhat.com>
---
 board-js2x/slof/OF.fs | 8 ++++++--
 board-qemu/slof/OF.fs | 8 ++++++--
 slof/fs/boot.fs       | 3 ---
 slof/fs/start-up.fs   | 1 +
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/board-js2x/slof/OF.fs b/board-js2x/slof/OF.fs
index a51f473..fecd081 100644
--- a/board-js2x/slof/OF.fs
+++ b/board-js2x/slof/OF.fs
@@ -176,8 +176,6 @@ THEN
 #include <slof-logo.fs>
 #include <banner.fs>
 
-: .banner .slof-logo .banner ;
-
 \ Get the secondary CPUs into our own spinloop.
 f8000050 rl@ CONSTANT master-cpu
 \ cr .( The master cpu is #) master-cpu .
@@ -544,6 +542,12 @@ cr
 \ this CATCH is to ensure the code bellow always executes:  boot may ABORT!
 ' start-it CATCH drop
 
+: boot
+    boot
+    \ When we return from boot print the banner again.
+    .banner
+;
+
 #include <history.fs>
 nvram-history? [IF]
 ." loading shell history .. "
diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs
index 5959003..839ddec 100644
--- a/board-qemu/slof/OF.fs
+++ b/board-qemu/slof/OF.fs
@@ -76,8 +76,6 @@ cistack ciregs >r1 ! \ kernel wants a stack :-)
 
 #include <banner.fs>
 
-: .banner .slof-logo .banner ;
-
 220 cp
 
 DEFER find-boot-sector ( -- )
@@ -320,4 +318,10 @@ cr cr
 \ this CATCH is to ensure the code bellow always executes:  boot may ABORT!
 ' start-it CATCH drop
 
+: boot
+    boot
+    \ When we return from boot print the banner again.
+    .banner
+;
+
 cr ." Ready!"
diff --git a/slof/fs/boot.fs b/slof/fs/boot.fs
index e99a164..1fd7439 100644
--- a/slof/fs/boot.fs
+++ b/slof/fs/boot.fs
@@ -268,9 +268,6 @@ read-bootlist
    BEGIN load-next WHILE
       disable-watchdog (go-and-catch)
    REPEAT
-
-   \ When we return from boot print the banner again.
-   .banner
 ;
 
 : load load 0= IF -65 boot-exception-handler THEN ;
diff --git a/slof/fs/start-up.fs b/slof/fs/start-up.fs
index dc5d1ed..227e0e9 100644
--- a/slof/fs/start-up.fs
+++ b/slof/fs/start-up.fs
@@ -173,5 +173,6 @@ TRUE VALUE use-load-watchdog?
    THEN
 
    disable-watchdog  FALSE to use-load-watchdog?
+   .slof-logo
    .banner
 ;
-- 
1.8.3.1



More information about the SLOF mailing list