aboutsummaryrefslogtreecommitdiff
path: root/board-qemu/slof/qemu-bootlist.fs
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-03-01 09:56:13 +0100
committerAlexey Kardashevskiy <aik@ozlabs.ru>2017-03-03 13:19:12 +1100
commitef5286f020d850f47fe196297f673769f6d63198 (patch)
tree141f7aaa8d0030e58d15fc46b09f3e17cdb6b257 /board-qemu/slof/qemu-bootlist.fs
parent007a175410f919a4368499bd8ef11c32bbf3e01e (diff)
downloadSLOF-ef5286f020d850f47fe196297f673769f6d63198.zip
SLOF-ef5286f020d850f47fe196297f673769f6d63198.tar.gz
SLOF-ef5286f020d850f47fe196297f673769f6d63198.tar.bz2
qemu-bootlist: Take the "-boot strict=off" setting properly into account
SLOF currently completely ignores the "-boot strict=off" setting from QEMU as soon as the user specified one of the devices with a "bootindex" parameter. We should continue booting from other devices if strict booting is disabled. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'board-qemu/slof/qemu-bootlist.fs')
-rw-r--r--board-qemu/slof/qemu-bootlist.fs18
1 files changed, 14 insertions, 4 deletions
diff --git a/board-qemu/slof/qemu-bootlist.fs b/board-qemu/slof/qemu-bootlist.fs
index 4778e16..60dd29d 100644
--- a/board-qemu/slof/qemu-bootlist.fs
+++ b/board-qemu/slof/qemu-bootlist.fs
@@ -25,15 +25,25 @@ defer add-boot-device
2drop
;
+\ strict boot order is enabled if the last word in qemu,boot-list is "HALT".
+: is-strict-boot? ( bl-str bl-len -- strict? )
+ dup 4 > IF
+ + 5 - 5 s" HALT" str=
+ ELSE
+ s" HALT" str=
+ THEN
+;
+
: qemu-read-bootlist ( -- )
\ See if QEMU has set exact boot device list
" qemu,boot-list" get-chosen IF
- s" boot-device" $setenv
- EXIT
+ 1- \ Ignore the trailing NUL character
+ 2dup set-boot-device
+ is-strict-boot? IF EXIT THEN
+ ELSE
+ 0 0 set-boot-device
THEN
- 0 0 set-boot-device
-
" qemu,boot-device" get-chosen not IF
\ No boot list set from qemu, so check nvram
" boot-device" evaluate swap drop 0= IF