diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-10-17 13:44:35 +0530 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-10-17 13:54:58 +0530 |
commit | 193b3a1488d4bbfb6437d643dcf275d01d67311d (patch) | |
tree | 3aac87cba93fa0e280172af28c73c7c3e2aa0c21 | |
parent | 22c4d4b3ae3e971bba336e4e5d5ba3bd03dc4ade (diff) | |
download | SLOF-193b3a1488d4bbfb6437d643dcf275d01d67311d.zip SLOF-193b3a1488d4bbfb6437d643dcf275d01d67311d.tar.gz SLOF-193b3a1488d4bbfb6437d643dcf275d01d67311d.tar.bz2 |
boot: include other aliases
Currently we only boot from " disk" and " cdrom", we can do better by
iterating through the diskN/cdromN aliases created during disk probing.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
-rw-r--r-- | board-qemu/slof/qemu-bootlist.fs | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/board-qemu/slof/qemu-bootlist.fs b/board-qemu/slof/qemu-bootlist.fs index 0a1aaf3..a4f5617 100644 --- a/board-qemu/slof/qemu-bootlist.fs +++ b/board-qemu/slof/qemu-bootlist.fs @@ -13,6 +13,18 @@ defer set-boot-device defer add-boot-device +8 CONSTANT MAX-ALIAS +: add-boot-aliases ( str -- ) + 2dup add-boot-device ( $str ) + MAX-ALIAS 1 DO + 2dup i $cathex 2dup ( $str $strN $strN ) + find-alias 0 > IF ( $str $strN false | $result ) + drop strdup add-boot-device ( $str ) + ELSE 2drop THEN + LOOP + 2drop +; + : qemu-read-bootlist ( -- ) 0 0 set-boot-device @@ -20,20 +32,20 @@ defer add-boot-device \ No boot list set from qemu, so check nvram " boot-device" evaluate swap drop 0= IF \ Not set in nvram too, set default disk/cdrom alias - " disk" add-boot-device - " cdrom" add-boot-device + " disk" add-boot-aliases + " cdrom" add-boot-aliases THEN EXIT THEN - + 0 ?DO dup i + c@ CASE 0 OF ENDOF [char] a OF ENDOF [char] b OF ENDOF - [char] c OF " disk" add-boot-device ENDOF - [char] d OF " cdrom" add-boot-device ENDOF - [char] n OF " net" add-boot-device ENDOF + [char] c OF " disk" add-boot-aliases ENDOF + [char] d OF " cdrom" add-boot-aliases ENDOF + [char] n OF " net" add-boot-aliases ENDOF ENDCASE cr LOOP drop |