###############################################################################
##
## yabootconfig generates a simple /etc/yaboot.conf
###############################################################################
##
## yabootconfig generates a simple /etc/yaboot.conf
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
}
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
}
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"
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"
## 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%%[ ]*})"
## 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%%[ ]*})"
## 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..."
## 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..."
## if there is a separate /boot partition we must strip off the /boot
## mountpoint or else yaboot will not find the kernel.
if [ "$KERNDIR" != "$CHROOT" ] ; then
## if there is a separate /boot partition we must strip off the /boot
## mountpoint or else yaboot will not find the kernel.
if [ "$KERNDIR" != "$CHROOT" ] ; then
${HEADER}##
## For a dual-boot menu, add one or more of:
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ\n
${HEADER}##
## For a dual-boot menu, add one or more of:
## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ\n