diff mbox

qemu-bootlist: Take the "-boot strict=off" setting properly into account

Message ID 1488284156-18834-1-git-send-email-thuth@redhat.com
State Rejected
Headers show

Commit Message

Thomas Huth Feb. 28, 2017, 12:15 p.m. UTC
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>
---
 board-qemu/slof/qemu-bootlist.fs | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Segher Boessenkool Feb. 28, 2017, 11:58 p.m. UTC | #1
On Tue, Feb 28, 2017 at 01:15:56PM +0100, Thomas Huth wrote:
> +++ b/board-qemu/slof/qemu-bootlist.fs
> @@ -28,12 +28,19 @@ defer add-boot-device
>  : 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
> +      \ strict boot order is enabled if the last word in qemu,boot-list
> +      \ is "HALT". In that case, do not add other boot devices.
> +      dup 4 > IF
> +         + 4 - 4 s" HALT" str= IF EXIT THEN

This triggers also on words that end in HALT, like ASPHALT.

You probably should factor it to its own word, which also gets rid of
the following ELSE, etc.

> +      ELSE
> +         2drop
> +      THEN


Segher
diff mbox

Patch

diff --git a/board-qemu/slof/qemu-bootlist.fs b/board-qemu/slof/qemu-bootlist.fs
index 4778e16..fe04b86 100644
--- a/board-qemu/slof/qemu-bootlist.fs
+++ b/board-qemu/slof/qemu-bootlist.fs
@@ -28,12 +28,19 @@  defer add-boot-device
 : 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
+      \ strict boot order is enabled if the last word in qemu,boot-list
+      \ is "HALT". In that case, do not add other boot devices.
+      dup 4 > IF
+         + 4 - 4 s" HALT" str= IF EXIT THEN
+      ELSE
+         2drop
+      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