]> git.ozlabs.org Git - yaboot.git/commitdiff
Commit yaboot 1.3.3
authorEthan Benson <erbenson@alaska.net>
Mon, 25 Mar 2002 14:50:10 +0000 (14:50 +0000)
committerEthan Benson <erbenson@alaska.net>
Mon, 25 Mar 2002 14:50:10 +0000 (14:50 +0000)
Commit yaboot 1.3.3.
git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-4

ChangeLog
Makefile
changelog
first/ofboot
man.patch
man/yaboot.conf.5
man/yabootconfig.8
ybin/yabootconfig
ybin/ybin

index 48fdfd54dcf99abfca902fa8cc1bd77051b746e7..e517c1e11e7bafb674ec7637250daf1807fc7f27 100644 (file)
--- 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 <erbenson@alaska.net>      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 <erbenson@alaska.net>      patch-3
 
     Summary:
index 9a10eed581b3f2c4fc1654f1a11b0b7efca6af66..c9a55e2dd5175db8db7b63997446aa5401938ad2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 ## Configuration section
 
-VERSION = 1.3.2
+VERSION = 1.3.3
 # Debug mode (verbose)
 DEBUG = 0
 ROOT =
index f091b87338f6e272a12f20af03b36eea780d3c1e..8166c519b4adb775e853b2d571548f26beafc4da 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,16 @@
+2001-09-25  Ethan Benson  <erbenson@alaska.net>
+
+       * 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_root_part>,/bsd" this means
+         the bsd kernel must be at /bsd on the BSD root partition.
+
 2001-09-24  Ethan Benson  <erbenson@alaska.net>
 
        * Version 1.3.2
index fc6b08aac08b16fc43e7aa4083e19265936408a9..7333dfe269be2e3be67bc220674f10eb45e42cee 100644 (file)
@@ -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"
index 18c7f002a88defde8e74df76b938df4e52d6e6e1..24557e9b47da9187de7be896c79d9eff11464138 100644 (file)
--- 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
index 037873905d0401995370a6d423a37f2e8dd397a2..f42ff422bcbb8199511d0f4ecb4d7a8427e772a6 100644 (file)
@@ -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
index 8d169ee0caf42c991449848d8de7a3630ec89abf..9c03bd03555f4cf9881821e5c4759b5afb782f10 100644 (file)
@@ -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<chroot>/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
index e94c4efc5796dbcc684ea40913eb2798342d8483..80c1799e8db1c30da0162207d57d05b99b0a2c70 100755 (executable)
@@ -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 '\<Apple_Bootstrap\>'` ; 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 '\<Apple_Bootstrap\>'` ; 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 '\<PPC PReP Boot\>'` ; 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 [<space><tab>] 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
index a7e790d3dc346f6c494a667558b4d28712b85454..976423c76279a9d193020b47b145a64517901a74 100755 (executable)
--- 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"