###############################################################################
##
## ofboot first stage autoconfiguring bootloader for yaboot and ybin
-## Copyright (C) 2000, 2001 Ethan Benson
+## Copyright (C) 2000, 2001, 2002, 2003 Ethan Benson
##
## Forth code written by Chris Emerson
##
2)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file2: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT2=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU2="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET2=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
3)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file3: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT3=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU3="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET3=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
4)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file4: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT4=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU4="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET4=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
5)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file5: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT5=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU5="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET5=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
6)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file6: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT6=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU6="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET6=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
7)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file7: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT7=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU7="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET7=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
8)
[ "$DEBUG" = 1 ] && $PRINTF 1>&2 "$PRG: DEBUG: file8: $5\n"
[ "$COUNT" = "$OSNUM" ] && c="."
- [ "$4" = "quit" ] && BOOT=quit || BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
+ [ "$4" = "quit" ] && BOOT=quit
+ [ "$1" = "ybsd" ] && BOOT="load-base release-load-area \" ${4}${5%/*} ${5##*/},/bsd\" \$boot"
+ [ "$1" != ybsd -a "$4" != quit ] && BOOT="load-base release-load-area \" ${4}${5}\" \$boot"
BT8=": boot$1 \" Booting $2...\" .printf 100 ms $BOOT ;"
MENU8="\" $3 for $2${c-,}\"(0d 0a)\" .printf"
GET8=" ascii $3 of \" $3 \"(0d 0a)\" .printf boot$1 endof"
$PRINTF \
"<CHRP-BOOT>
<COMPATIBLE>
-MacRISC
+MacRISC MacRISC3 MacRISC4
</COMPATIBLE>
<DESCRIPTION>
PowerPC GNU/Linux First Stage Bootstrap
\" \"(0d 0a)\" .printf
$MENUOPTS
\" \"(0d 0a)\" .printf
-\" Boot: \" .printf
+\" Stage 1 Boot: \" .printf
get-msecs d# $TIMEOUT 3E8 * +
begin
key? if