diff options
author | Thomas Huth <thuth@redhat.com> | 2017-06-07 11:33:31 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2017-06-08 16:14:21 +1000 |
commit | fa94a3bb20734cb8e0280b232d16b6d466ec3d53 (patch) | |
tree | a1de3aef79fe15fe24004f95b82c834c05a5aeb9 /slof | |
parent | 1f0600f25d64ced53d69347871c209bde8bb2a3c (diff) | |
download | SLOF-fa94a3bb20734cb8e0280b232d16b6d466ec3d53.zip SLOF-fa94a3bb20734cb8e0280b232d16b6d466ec3d53.tar.gz SLOF-fa94a3bb20734cb8e0280b232d16b6d466ec3d53.tar.bz2 |
A new SLOF boot menu
The current SLOF boot menu heavily depends on the contents of the
"qemu,boot-list" and "qemu,boot-device"" properties in the device tree,
so that the menu entries either look very strange (when there is no
alias, see https://bugzilla.redhat.com/show_bug.cgi?id=1429832 ) or
are duplicated (https://bugzilla.redhat.com/show_bug.cgi?id=1446018).
A proper boot menu should rather show all available boot devices
instead, so this patch series introduces a new boot menu (written in
C this time) which is independent from the "qemu,boot-list/device"
properties by looking at the available aliases instead. It is now also
possible by selecting the entries with one key stroke only (you don't
have to press RETURN anymore), so this is now hopefully much more user
friendly than the old menu.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'slof')
-rw-r--r-- | slof/fs/start-up.fs | 71 |
1 files 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 ) |