[SLOF] [PATCH 4/4] bootmenu: Wire up the new boot menu in the Forth code

Thomas Huth thuth at redhat.com
Fri Jun 2 01:25:42 AEST 2017


Remove the old Forth-based boot menu code and use the
new libbootmenu module instead.

Signed-off-by: Thomas Huth <thuth at redhat.com>
---
 slof/fs/start-up.fs | 71 +++++++----------------------------------------------
 1 file changed, 9 insertions(+), 62 deletions(-)

diff --git a/slof/fs/start-up.fs b/slof/fs/start-up.fs
index dc5d1ed..7020f5c 100644
--- a/slof/fs/start-up.fs
+++ b/slof/fs/start-up.fs
@@ -65,70 +65,17 @@
 \ Watchdog will be rearmed during load if use-load-watchdog variable is TRUE
 TRUE VALUE use-load-watchdog?
 
-1 value my-boot-dev
-1 value digit-val
-0 value boot-dev-no
-
-: boot-selected
-   1 to my-boot-dev
-   BEGIN parse-word dup WHILE
-      boot-dev-no my-boot-dev = IF
-         s" boot " 2swap $cat
-         ['] evaluate catch ?dup IF     \ and execute it
-            ." boot attempt returned: "
-            abort"-str @ count type cr
-            throw
-         THEN
-         0 0 load-list 2!
-         UNLOOP EXIT
-      ELSE
-         2drop
-      THEN
-      my-boot-dev 1 + to my-boot-dev
-   REPEAT 2drop 0 0 load-list 2!
-
-   (boot)
-;
-
-: boot-start
-   decimal
-   BEGIN parse-word dup WHILE
-      my-boot-dev (u.) s" . " $cat type 2dup type ." : " de-alias type cr
-      my-boot-dev 1 + to my-boot-dev
-   REPEAT 2drop 0 0 load-list 2!
-
-   \ Clear pending keys (to remove multiple F12 key presses for example)
-   BEGIN key? WHILE
-      key drop
-   REPEAT
-
-   cr
-   BEGIN
-      KEY
-      dup 1b = IF         \ ESC sequence ... could be yet another F12 key press
-         BEGIN key? WHILE
-            key drop
-         REPEAT
-      ELSE
-         dup emit
-      THEN
-      dup isdigit IF
-         dup 30 - to digit-val
-         boot-dev-no a * digit-val + to boot-dev-no
-      THEN
-   d = UNTIL
-
-   boot-dev-no my-boot-dev < IF
-      s" boot-selected " s" $bootdev" evaluate $cat strdup evaluate
-   ELSE
-      ." Invalid choice!" cr
-   THEN
-   hex
-;
 
 : boot-menu-start
-   ." Select boot device:" cr cr
-   s" boot-start " s" $bootdev" evaluate $cat strdup evaluate
+    boot-menu ?dup IF
+       s" boot " 2swap $cat
+       ['] evaluate catch ?dup IF
+           ." boot attempt returned: "
+           abort"-str @ count type cr
+           throw
+       THEN
+       0 0 load-list 2!
+    THEN
 ;
 
 : boot-menu-enabled? ( -- true|false )
-- 
1.8.3.1



More information about the SLOF mailing list