From: Ethan Benson Date: Mon, 25 Mar 2002 14:50:10 +0000 (+0000) Subject: Commit yaboot 1.3.3 X-Git-Tag: yaboot-1.3.13~71 X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=commitdiff_plain;h=67d317029778e6f068badf7b8e3eec6482ecb00e Commit yaboot 1.3.3 Commit yaboot 1.3.3. git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-4 --- diff --git a/ChangeLog b/ChangeLog index 48fdfd5..e517c1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,21 @@ # tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3 # +2002-03-25 14:50:10 GMT Ethan Benson patch-4 + + Summary: + Commit yaboot 1.3.3 + Revision: + yaboot--devel--1.3--patch-4 + + Commit yaboot 1.3.3. + + modified files: + ChangeLog Makefile changelog first/ofboot man.patch + man/yaboot.conf.5 man/yabootconfig.8 ybin/yabootconfig + ybin/ybin + + 2002-03-25 14:28:05 GMT Ethan Benson patch-3 Summary: diff --git a/Makefile b/Makefile index 9a10eed..c9a55e2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ## Configuration section -VERSION = 1.3.2 +VERSION = 1.3.3 # Debug mode (verbose) DEBUG = 0 ROOT = diff --git a/changelog b/changelog index f091b87..8166c51 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,16 @@ +2001-09-25 Ethan Benson + + * Version 1.3.3 + + * Add --debug option to yabootconfig + + * Fix BSD booting support somewhat. The bsd= option's semantics + have changed, it must now be set to the BSD root partition. ybin + will now install /usr/local/lib/yaboot/ofwboot onto the bootstrap + partition when bsd= is present in /etc/yaboot.conf. The dual boot + menu will then execute "ofwboot ,/bsd" this means + the bsd kernel must be at /bsd on the BSD root partition. + 2001-09-24 Ethan Benson * Version 1.3.2 diff --git a/first/ofboot b/first/ofboot index fc6b08a..7333dfe 100644 --- a/first/ofboot +++ b/first/ofboot @@ -110,7 +110,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" @@ -120,7 +122,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" @@ -130,7 +134,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" @@ -140,7 +146,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" @@ -150,7 +158,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" @@ -160,7 +170,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" @@ -170,7 +182,9 @@ while [ "$COUNT" -le "$OSNUM" ] ; do 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" diff --git a/man.patch b/man.patch index 18c7f00..24557e9 100644 --- a/man.patch +++ b/man.patch @@ -1,6 +1,6 @@ diff -urN -X CVS man/mkofboot.8 man.deb/mkofboot.8 --- man/mkofboot.8 Thu May 24 04:32:54 2001 -+++ man.deb/mkofboot.8 Mon Aug 6 03:01:39 2001 ++++ man.deb/mkofboot.8 Tue Sep 25 05:38:42 2001 @@ -94,7 +94,7 @@ .TP .BR \-i ,\ \-\-install\ \fIboot-file @@ -31,8 +31,8 @@ diff -urN -X CVS man/mkofboot.8 man.deb/mkofboot.8 but root. It is also critical that \fI/etc/yaboot.conf\fR not be writable by anyone but root since a different \fIofboot\fR script could be diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 ---- man/yaboot.conf.5 Mon Aug 6 02:43:23 2001 -+++ man.deb/yaboot.conf.5 Mon Aug 6 03:01:39 2001 +--- man/yaboot.conf.5 Tue Sep 25 05:20:03 2001 ++++ man.deb/yaboot.conf.5 Tue Sep 25 05:38:42 2001 @@ -136,7 +136,7 @@ boot=/dev/hda2 device=hd: @@ -51,16 +51,16 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 loader for yaboot. It is capable of presenting a dual boot menu for GNU/Linux, MacOS and MacOSX. If dual booting is not required or configured it will simply load yaboot directly. You must specify this -@@ -299,7 +299,7 @@ - option you will be presented with a simple menu at bootup allowing you - to hit L to boot GNU/Linux or B to boot BSD (along with other choices - if configured). This will only work if you are using the new --\fI/usr/local/lib/yaboot/ofboot\fR script. When this is set to a unix -+\fI/usr/lib/yaboot/ofboot\fR script. When this is set to a unix - device node (ie \fI/dev/hda11\fR) then ybin will use the +@@ -301,7 +301,7 @@ + When you define this option you will be presented with a simple menu at + bootup allowing you to hit L to boot GNU/Linux or B to boot BSD (along + with other choices if configured). This will only work if you are +-using the new \fI/usr/local/lib/yaboot/ofboot\fR script. When this is ++using the new \fI/usr/lib/yaboot/ofboot\fR script. When this is + set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. .TP -@@ -308,7 +308,7 @@ +@@ -310,7 +310,7 @@ partition. When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or M to boot MacOS (along with other choices if configured). This will only @@ -69,7 +69,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 script. When this is set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. -@@ -318,7 +318,7 @@ +@@ -320,7 +320,7 @@ When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or X to boot MacOSX (along with other choices if configured). This will only work if you @@ -78,7 +78,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 this is set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. -@@ -339,7 +339,7 @@ +@@ -341,7 +341,7 @@ When you define this option you will be presented with a simple menu at bootup allowing you to hit L to boot GNU/Linux or D to boot Darwin (along with other choices if configured). This will only work if you @@ -87,7 +87,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 this is set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. -@@ -587,8 +587,8 @@ +@@ -589,8 +589,8 @@ root=/dev/hda3 partition=3 timeout=20 @@ -100,7 +100,7 @@ diff -urN -X CVS man/yaboot.conf.5 man.deb/yaboot.conf.5 default=Linux diff -urN -X CVS man/ybin.8 man.deb/ybin.8 --- man/ybin.8 Thu May 24 04:33:16 2001 -+++ man.deb/ybin.8 Mon Aug 6 03:01:39 2001 ++++ man.deb/ybin.8 Tue Sep 25 05:38:42 2001 @@ -109,7 +109,7 @@ .TP .BR \-i ,\ \-\-install\ \fIboot-file diff --git a/man/yaboot.conf.5 b/man/yaboot.conf.5 index 0378739..f42ff42 100644 --- a/man/yaboot.conf.5 +++ b/man/yaboot.conf.5 @@ -6,7 +6,7 @@ .\" This program is distributed according to the Gnu General Public License. .\" See the file COPYING in the ybin source distribution. .\" -.TH YABOOT.CONF 5 "28 May 2001" "GNU/Linux PowerPC" "File Formats" +.TH YABOOT.CONF 5 "25 September 2001" "GNU/Linux PowerPC" "File Formats" .SH NAME .B yaboot.conf \- Configuration file format used by @@ -293,14 +293,16 @@ brown, light-gray, dark-gray, yellow, and white. The default is black. .TP .BI "bsd=" of-path -The OpenFirmware or Unix device path to a NetBSD or OpenBSD bootstrap -partition, this partition must already have the BSD ofwboot.elf -bootloader installed in the root directory.. When you define this -option you will be presented with a simple menu at bootup allowing you -to hit L to boot GNU/Linux or B to boot BSD (along with other choices -if configured). This will only work if you are using the new -\fI/usr/local/lib/yaboot/ofboot\fR script. When this is set to a unix -device node (ie \fI/dev/hda11\fR) then ybin will use the +The OpenFirmware or Unix device path to a NetBSD or OpenBSD root +partition, this partition must have the BSD kernel located at \fI/bsd\fR. +You must also have the BSD bootloader +\fIofwboot\fR installed at \fI/usr/local/lib/yaboot/ofwboot\fR, +\fBybin\fR(8) will install this onto the \fBbootstrap\fR(8) partition. +When you define this option you will be presented with a simple menu at +bootup allowing you to hit L to boot GNU/Linux or B to boot BSD (along +with other choices if configured). This will only work if you are +using the new \fI/usr/local/lib/yaboot/ofboot\fR script. When this is +set to a unix device node (ie \fI/dev/hda11\fR) then ybin will use the \fBofpath\fR(8) utility to determine the OpenFirmware device path. .TP .BI "macos=" of-path diff --git a/man/yabootconfig.8 b/man/yabootconfig.8 index 8d169ee..9c03bd0 100644 --- a/man/yabootconfig.8 +++ b/man/yabootconfig.8 @@ -17,7 +17,7 @@ .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.TH YABOOTCONFIG 8 "22 June 2001" "GNU/Linux PowerPC" "System Manager's Manual" +.TH YABOOTCONFIG 8 "25 September 2001" "GNU/Linux PowerPC" "System Manager's Manual" .SH NAME .B yabootconfig \- generates a simple /etc/yaboot.conf @@ -28,6 +28,7 @@ .RB [ \ \-r | \-\-root\ \fIdevice\ ] .RB [ \ \-q | \-\-quiet\ ] .RB [ \ \-\-noinstall\ ] +.RB [ \ \-\-debug\ ] .RB [ \ \-h | \-\-help\ ] .RB [ \ \-V | \-\-version\ ] .SH DESCRIPTION @@ -56,7 +57,7 @@ requires \fBofpath\fR(8) in order to get the OpenFirmware device name for the root disk on PowerMacs. .SH OPTIONS .TP -.BR \-t.,\ \-\-chroot\ \fIdirectory +.BR \-t ,\ \-\-chroot\ \fIdirectory Cause \fByabootconfig\fR to work as if \fIdirectory\fR is the / directory. This is useful when booting from a rescue floppy or CDROM in which case you mount your true root filesystem on /target or /mnt. @@ -107,6 +108,10 @@ after it successfully generates a valid \fI/etc/yaboot.conf\fR. This option causes \fByabootconfig\fR to only generate the config file without installing the \fBbootstrap\fR. .TP +.BR \-\-debug +This option causes \fByabootconfig\fR to output some boring details useful +only for debugging \fByabootconfig\fR itself. +.TP .BR \-h ,\ \-\-help Print out usage information and exit. .TP diff --git a/ybin/yabootconfig b/ybin/yabootconfig index e94c4ef..80c1799 100755 --- a/ybin/yabootconfig +++ b/ybin/yabootconfig @@ -27,12 +27,13 @@ if [ -n "$PATH_PREFIX" ] ; then PATH="${PATH}:${PATH_PREFIX}/sbin:${PATH_PREFIX}/bin:${PATH_PREFIX}/usr/sbin:${PATH_PREFIX}/usr/bin:${PATH_PREFIX}/usr/local/sbin:${PATH_PREFIX}/usr/local/bin" fi PRG="${0##*/}" -VERSION=1.0.3 +VERSION=1.0.4 CHROOT=/ ## $CONFIG is relative to $CHROOT CONFIG=etc/yaboot.conf NOINSTALL=0 QUIET=0 +DEBUG=0 SIGINT="$PRG: Interrupt caught ... exiting" export LC_COLLATE=C @@ -101,6 +102,12 @@ Generate a working /etc/yaboot.conf. -V, --version output version information and exit" } +debug() +{ + [ "$DEBUG" = 0 ] && return 0 + $PRINTF 1>&2 "$PRG: DEBUG: $1" +} + confirm() { $PRINTF \ @@ -153,6 +160,7 @@ ckmacfdisk() echo 1>&2 "$PRG: `command -v $FDISK`: Permission denied" return 1 fi + debug "mac-fdisk is: $FDISK\n" return 0 } @@ -173,6 +181,7 @@ ckfdisk() echo 1>&2 "$PRG: `command -v $FDISK`: Permission denied" return 1 fi + debug "fdisk is: $FDISK\n" return 0 } @@ -184,12 +193,16 @@ findbootblock() ckmacfdisk || return 1 if [ "$FDISK" = pdisk ] ; then ## handle braindamaged pdisk + debug "dealing with pdisk deficiency...\n" BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\'` ; echo ${v%%:*})" + debug "BOOT before fixup: $BOOT\n" if [ -n "$BOOT" ] ; then BOOT="${DISK}${BOOT}" fi + debug "BOOT after fixup: $BOOT\n" else BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\'` ; echo ${v%%[ ]*})" + debug "BOOT=$BOOT\n" fi if [ -z "$BOOT" ] ; then echo 1>&2 "$PRG: Unable to locate bootstrap partition on $DISK..." @@ -199,6 +212,7 @@ findbootblock() else ckfdisk || return 1 BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\'` ; echo ${v%%[ ]*})" + debug "BOOT=$BOOT\n" if [ -z "$BOOT" ] ; then echo 1>&2 "$PRG: Unable to locate bootstrap partition on $DISK..." echo 1>&2 "$PRG: You must create an 800K type: 0x41 PPC PReP Boot partition to make the disk bootable" @@ -306,6 +320,10 @@ if [ $# != 0 ] ; then NOINSTALL=1 shift 1 ;; + --debug) + DEBUG=1 + shift 1 + ;; "") break ;; @@ -358,6 +376,7 @@ fi if [ -z "$ROOT" ] ; then ## IMPORTANT! that last substitution is [] thats all ash will grok ROOT="$(v=`grep '[[:blank:]]/[[:blank:]]' ${CHROOT}etc/fstab` ; echo ${v%%[ ]*})" + debug "ROOT=$ROOT\n" if [ -z "$ROOT" ] ; then echo 1>&2 "$PRG: Could not determine root partition, aborting..." exit 1 @@ -442,6 +461,8 @@ else exit 1 fi +debug "KERNEL=$KERNEL\n" + ## get partition number the kernel lives on, and the OF device= name ## of the whole disk. KERNDEV="$(v=`df "$KERNEL" 2> /dev/null | grep ^/dev/` ; echo ${v%%[ ]*})" @@ -455,10 +476,13 @@ else KERNELDISK="${KERNDEV%%[0-9]*}" fi +debug "KERNEL=$KERNEL\nKERNDEV=$KERNDEV\nKERNDIR=$KERNDIR\nLINKDEV=$LINKDEV\nPARTITION=$PARTITION\nKERNELDISK=$KERNELDISK\n" + ## sanity check for i in "$KERNDEV" "$KERNDIR" "$LINKDEV" "$PARTITION" "$KERNELDISK" ; do if [ -z "$i" ] ; then echo 1>&2 "$PRG: Could not determine necessary information, aborting..." + echo 1>&2 "$PRG: Are you using chroot $PRG instead of $PRG --chroot ?" exit 1 fi done diff --git a/ybin/ybin b/ybin/ybin index a7e790d..976423c 100755 --- a/ybin/ybin +++ b/ybin/ybin @@ -28,7 +28,7 @@ if [ -n "$PATH_PREFIX" ] ; then fi PRG="${0##*/}" SIGINT="$PRG: Interrupt caught ... exiting" -VERSION=1.3.2 +VERSION=1.3.3 DEBUG=0 VERBOSE=0 TMP="${TMPDIR:-/tmp}" @@ -373,6 +373,20 @@ checkconf() fi if [ -n "$magicboot" ] ; then + ## check for bsd loader + if [ -n "$bsd" ] ; then + if [ -f /usr/lib/yaboot/ofwboot -a -r /usr/lib/yaboot/ofwboot ] ; then + BSDLOADER="/usr/lib/yaboot/ofwboot" + elif [ -f /usr/local/lib/yaboot/ofwboot -a -r /usr/local/lib/yaboot/ofwboot ] ; then + BSDLOADER="/usr/local/lib/yaboot/ofwboot" + else + echo 1>&2 "$PRG: /usr/local/lib/yaboot/ofwboot: No such file or directory" + echo 1>&2 "$PRG: With the bsd= option set you must have the bsd boot loader ofwboot" + CONFERR=1 + fi + fi + + ## convert defaultos variable case "$defaultos" in linux|Linux|GNU|Gnu|gnu) defaultos=bootyaboot @@ -757,7 +771,7 @@ util_install() ## if there is a magicboot script to install we will give it the ## hfstype (should be "tbxi") and give yaboot type "boot". - if [ "$magicboot" ] ; then + if [ -n "$magicboot" ] ; then local BTTYPE=boot else local BTTYPE="$hfstype" @@ -827,17 +841,26 @@ util_install() return 1 fi - [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $bootconf to $boot..." + [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $bootconf onto $boot..." hcopy -r "$bootconf" :"$CFFILE" if [ $? != 0 ] ; then echo 1>&2 "$PRG: An error occured while writing to $boot" return 1 fi + if [ -n "$BSDLOADER" ] ; then + [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $BSDLOADER onto $boot..." + hcopy -r "$BSDLOADER" :ofwboot + if [ $? != 0 ] ; then + echo 1>&2 "$PRG: An error occured while writing to $boot" + return 1 + fi + fi + ## set all file's attributes, if a magicboot script exists it ## gets the configured hfstype instead of yaboot (should be ## "tbxi") so it gets booted by OF. - if [ "$magicboot" ] ; then + if [ -n "$magicboot" ] ; then [ "$VERBOSE" = 1 ] && echo "$PRG: Setting attributes on $WRAP..." hattrib -t "$hfstype" -c "$hfscreator" $INVISIBLE $LOCK :ofboot.b if [ $? != 0 ] ; then @@ -860,6 +883,15 @@ util_install() echo 1>&2 "$PRG: This is probably unimportant so we'll ignore it" fi + if [ -n "$BSDLOADER" ] ; then + [ "$VERBOSE" = 1 ] && echo "$PRG: Setting attributes on ofwboot..." + hattrib -t "bsdb" -c "$hfscreator" $INVISIBLE $LOCK :ofwboot + if [ $? != 0 ] ; then + echo 1>&2 "$PRG: Warning: error setting attributes on ofwboot" + echo 1>&2 "$PRG: This is probably unimportant so we'll ignore it" + fi + fi + ## bless the root directory so OF will find the boot file if [ "$bless" = yes ] ; then [ "$VERBOSE" = 1 ] && echo "$PRG: Blessing $boot with Holy Penguin Pee..." @@ -981,7 +1013,7 @@ mnt_install() local CFFILE=yaboot.conf fi - if [ "$magicboot" ] ; then + if [ -n "$magicboot" ] ; then local WRAP="${magicboot##*/}" fi @@ -991,7 +1023,7 @@ mnt_install() ## repoint magicboot as the real first stage loader if using the ## modern automatic generating ofboot.b. - if [ "$FIRST" ] ; then + if [ -n "$FIRST" ] ; then magicboot="$FIRST" [ "$DEBUG" = 1 ] && echo 1>&2 "$PRG: DEBUG: set magicboot to $FIRST" fi @@ -1028,7 +1060,7 @@ mnt_install() return 1 fi - [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $bootconf on $boot..." + [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $bootconf onto $boot..." cp -f "$bootconf" "$TARGET/$CFFILE" if [ $? != 0 ] ; then echo 1>&2 "$PRG: An error occured while writing to $boot" @@ -1036,13 +1068,26 @@ mnt_install() return 1 fi + if [ -n "$BSDLOADER" ] ; then + [ "$VERBOSE" = 1 ] && echo "$PRG: Installing $BSDLOADER onto $boot..." + cp -f "$BSDLOADER" "$TARGET/ofwboot" + if [ $? != 0 ] ; then + echo 1>&2 "$PRG: An error occured while writing to $boot" + umnt failure "$TARGET" + return 1 + fi + fi + if [ "$protect" = yes ] ; then [ "$VERBOSE" = 1 ] && echo "$PRG: Setting read-only attributes..." chmod a-w "$TARGET/$BTFILE" chmod a-w "$TARGET/$CFFILE" - if [ "$magicboot" ] ; then + if [ -n "$magicboot" ] ; then chmod a-w "$TARGET/ofboot.b" fi + if [ -n "$BSDLOADER" ] ; then + chmod a-w "$TARGET/ofwboot" + fi fi sync ; sync @@ -1145,7 +1190,7 @@ mkfirststage() ## assign variables for configured menu options. [ "$usemount" = no -a "$bless" = yes ] && local YB="yaboot GNU l $ofboot ,${BS}${BS}yaboot" [ "$usemount" = yes -o "$bless" = no ] && local YB="yaboot GNU l $ofboot ,${OFDIR}yaboot" - [ -n "$bsd" ] && OS="$(($OS + 1))" && local BSD="bsd BSD b $bsd ,${BS}ofwboot.elf" + [ -n "$bsd" ] && OS="$(($OS + 1))" && local BSD="ybsd BSD b $ofboot ,${BS}${BS}ofwboot/$bsd" [ -n "$macos" ] && OS="$(($OS + 1))" && local MAC="macos MacOS m $macos ,${BS}${BS}:tbxi" [ -n "$macosx" ] && OS="$(($OS + 1))" && local MX="macosx MacOSX x $macosx ,${OSXBOOT}" [ -n "$darwin" ] && OS="$(($OS + 1))" && local DW="darwin Darwin d $darwin ,${BS}${BS}:tbxi"