1 \ *****************************************************************************
2 \ * Copyright (c) 2011 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
17 : add-boot-aliases ( str -- )
18 2dup add-boot-device ( $str )
20 2dup i $cathex 2dup ( $str $strN $strN )
21 find-alias 0 > IF ( $str $strN false | $result )
22 drop strdup add-boot-device ( $str )
28 : qemu-read-bootlist ( -- )
29 \ See if QEMU has set exact boot device list
30 " qemu,boot-list" get-chosen IF
31 s" boot-device" $setenv
37 " qemu,boot-device" get-chosen not IF
38 \ No boot list set from qemu, so check nvram
39 " boot-device" evaluate swap drop 0= IF
40 \ Not set in nvram too, set default disk/cdrom alias
41 " disk" add-boot-aliases
42 " cdrom" add-boot-aliases
43 " net" add-boot-aliases
53 [char] c OF " disk" add-boot-aliases ENDOF
54 [char] d OF " cdrom" add-boot-aliases ENDOF
55 [char] n OF " net" add-boot-aliases ENDOF
61 ' qemu-read-bootlist to read-bootlist