3 ###############################################################################
5 ## yabootconfig generates a simple /etc/yaboot.conf
6 ## Copyright (C) 2001, 2002, 2003 Ethan Benson
8 ## This program is free software; you can redistribute it and/or
9 ## modify it under the terms of the GNU General Public License
10 ## as published by the Free Software Foundation; either version 2
11 ## of the License, or (at your option) any later version.
13 ## This program is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU General Public License for more details.
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program; if not, write to the Free Software
20 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 ###############################################################################
24 PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
25 ## allow to run out of /target in boot-floppies
26 if [ -n "$PATH_PREFIX" ] ; then
27 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"
30 VERSION=1.0.8-UNSUPPORTED_UNRELEASED_DEVEL
32 ## $CONFIG is relative to $CHROOT
33 CONFIG=etc/yaboot.conf
37 SIGINT="$PRG: Interrupt caught ... exiting"
40 ## avoid older versions of ofpath shipped in debian boot-floppies etc.
41 if [ -x "${PATH_PREFIX}/usr/sbin/ofpath" ] ; then
42 OFPATH="${PATH_PREFIX}/usr/sbin/ofpath"
47 ## catch signals, clean up temporary file
50 trap "echo 1>&2 $SIGINT ; exit 130" 2
54 ## check for printf, use it if possible otherwise fall back on
55 ## unreliable echo -e -n ("SUS" says echo shall support no switches)
56 if [ "$(printf printf_test 2>/dev/null)" = printf_test ] ; then
62 ## make sure echo is not lame if we must use it.
63 if [ "$PRINTF" != printf ] ; then
64 if [ "$(echo -e -n echo_test)" != "echo_test" ] ; then
65 echo 1>&2 "$PRG: printf unavailable and echo is broken, sorry."
70 ## make fake `id' if its missing, outputs 0 since if its missing we
71 ## are probably running on boot floppies and thus are root.
72 if (command -v id > /dev/null 2>&1) ; then
86 Written by Ethan Benson
88 Copyright (C) 2001, 2002, 2003 Ethan Benson
89 This is free software; see the source for copying conditions. There is NO
90 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
97 "Usage: $PRG [OPTION]...
98 Generate a working /etc/yaboot.conf.
100 -t, --chroot set root directory $PRG should work from
101 -r, --root set root partition, Example: /dev/hda3
102 default: determined from {chroot}/etc/fstab
103 -b, --boot set bootstrap partition, Example: /dev/hda2
104 default: first type: Apple_Bootstrap partition
105 --kernel-args add an append= line with specified arguments
106 -q, --quiet don't ask any questions/confirmation
107 --noinstall don't automatically run mkofboot
108 -h, --help display this help and exit
109 -V, --version output version information and exit"
114 [ "$DEBUG" = 0 ] && return 0
115 $PRINTF 1>&2 "$PRG: DEBUG: $1"
121 "yaboot is the Linux Loader for PowerPC. $PRG sets up your system to boot directly
122 from your hard disk, without the need for a boot CD, floppy or a network boot.\n"
123 [ "$NOINSTALL" = 0 ] && $PRINTF "Install yaboot bootstrap on $BOOT to boot Linux from $ROOT? [Yes] "
124 [ "$NOINSTALL" = 1 ] && $PRINTF "Create simple ${CHROOT}${CONFIG} to boot Linux from $ROOT? [Yes] "
128 echo "Creating a simple ${CHROOT}${CONFIG}..."
132 if [ "$NOINSTALL" = 0 ] ; then
133 $PRINTF "Create simple ${CHROOT}${CONFIG} without installing the bootstrap? [Yes] "
138 echo 1>&2 "Creating a simple ${CHROOT}${CONFIG}..."
154 ## find out whether we have mac-fdisk or pdisk (they work the same)
157 if (command -v mac-fdisk > /dev/null 2>&1) ; then
159 elif (command -v pdisk > /dev/null 2>&1) ; then
162 echo 1>&2 "$PRG: Unable to locate mac-fdisk"
166 if [ ! -x `command -v $FDISK` 2> /dev/null ] ; then
167 echo 1>&2 "$PRG: `command -v $FDISK`: Permission denied"
170 debug "mac-fdisk is: $FDISK\n"
174 ## find out if we have ddisk or fdisk (fdisk for dos labels) debian
178 if (command -v ddisk > /dev/null 2>&1) ; then
180 elif (command -v fdisk > /dev/null 2>&1) ; then
183 echo 1>&2 "$PRG: Unable to locate fdisk"
187 if [ ! -x `command -v $FDISK` 2> /dev/null ] ; then
188 echo 1>&2 "$PRG: `command -v $FDISK`: Permission denied"
191 debug "fdisk is: $FDISK\n"
195 ## find bootstrap partition, supports IBM CHRP with msdos disklabels
198 ## mac partition table magic == ER
199 if [ "$(dd if="$DISK" bs=2 count=1 2> /dev/null)" = ER ] ; then
200 ckmacfdisk || return 1
201 if [ "$FDISK" = pdisk ] ; then
202 ## handle braindamaged pdisk
203 debug "dealing with pdisk deficiency...\n"
204 BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\<Apple_Bootstrap\>'` ; echo ${v%%:*})"
205 debug "BOOT before fixup: $BOOT\n"
206 if [ -n "$BOOT" ] ; then
207 BOOT="${DISK}${BOOT}"
209 debug "BOOT after fixup: $BOOT\n"
211 BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\<Apple_Bootstrap\>'` ; echo ${v%%[ ]*})"
214 if [ -z "$BOOT" ] ; then
215 echo 1>&2 "$PRG: Unable to locate bootstrap partition on $DISK..."
216 echo 1>&2 "$PRG: You must create an 800K type: Apple_Bootstrap partition to make the disk bootable"
221 BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\<PPC PReP Boot\>'` ; echo ${v%%[ ]*})"
223 if [ -z "$BOOT" ] ; then
224 echo 1>&2 "$PRG: Unable to locate bootstrap partition on $DISK..."
225 echo 1>&2 "$PRG: You must create an 800K type: 0x41 PPC PReP Boot partition to make the disk bootable"
232 ## if readlink is missing use a kludge
233 if (command -v readlink > /dev/null 2>&1) ; then
238 SYMTARGET="$(v=`ls -l "$2" 2>/dev/null` ; echo ${v##*> })"
239 if [ -n "$SYMTARGET" ] ; then
248 ## we have to do some things differently with a retarded devfs name.
252 /dev/ide/*|/dev/scsi/*|/dev/discs/*)
263 if [ -n "$TMPCONF" ] ; then rm -f "$TMPCONF" ; fi
271 if [ $# != 0 ] ; then
283 if [ -n "$2" ] ; then
287 echo 1>&2 "$PRG: option requires an argument $1"
288 echo 1>&2 "Try \`$PRG --help' for more information."
293 if [ -n "$2" ] ; then
297 echo 1>&2 "$PRG: option requires an argument $1"
298 echo 1>&2 "Try \`$PRG --help' for more information."
303 if [ -n "$2" ] ; then
307 echo 1>&2 "$PRG: option requires an argument $1"
308 echo 1>&2 "Try \`$PRG --help' for more information."
313 if [ -n "$2" ] ; then
317 echo 1>&2 "$PRG: option requires an argument $1"
318 echo 1>&2 "Try \`$PRG --help' for more information."
338 echo 1>&2 "$PRG: unrecognized option \`$1'"
339 echo 1>&2 "Try \`$PRG --help' for more information."
346 if [ `id -u` != 0 ] ; then
347 echo 1>&2 "$PRG: You are not root, go away"
351 ## we need /proc because df does
352 if [ ! -f /proc/uptime ] ; then
353 echo 1>&2 "$PRG: This utility requires the /proc filesystem"
357 ## check that chroot exists
358 if [ -d "$CHROOT" ] ; then
359 ## HACK: add trailing / to chroot, otherwise are paths later get b0rked.
368 elif [ ! -e "$CHROOT" ] ; then
369 echo 1>&2 "$PRG: $CHROOT: No such file or directory"
371 elif [ ! -d "$CHROOT" ] ; then
372 echo 1>&2 "$PRG: $CHROOT: Not a directory"
376 ## make sure the chroot is an actual root filesystem
377 if [ ! -f "${CHROOT}etc/fstab" ] ; then
378 echo 1>&2 "$PRG: $CHROOT does not appear to be a valid root filesystem"
383 if [ -z "$ROOT" ] ; then
384 ## IMPORTANT! that last substitution is [<space><tab>] thats all ash will grok
385 ROOT="$(v=`grep '^[^#].*[[:blank:]]/[[:blank:]]' ${CHROOT}etc/fstab` ; echo ${v%%[ ]*})"
387 if [ -z "$ROOT" ] ; then
388 echo 1>&2 "$PRG: Could not determine root partition, aborting..."
393 ## make sure root device exists
394 if [ ! -e "$ROOT" ] ; then
395 echo 1>&2 "$PRG: $ROOT: No such file or directory"
400 if ckdevfs "$ROOT" ; then
401 DISK="${ROOT%/*}/disc"
403 DISK="${ROOT%%[0-9]*}"
405 if [ -z "$DISK" ] ; then
406 echo 1>&2 "$PRG: Could not determine root disk, aborting..."
410 ## make sure main disk exists
411 if [ ! -e "$DISK" ] ; then
412 echo 1>&2 "$PRG: $DISK: No such file or directory"
416 ## find bootstrap partition
417 if [ -z "$BOOT" ] ; then
418 findbootblock || exit 1
421 ## make sure bootstrap device exists
422 if [ ! -e "$BOOT" ] ; then
423 echo 1>&2 "$PRG: $BOOT: No such file or directory"
428 for i in "$DISK" "$ROOT" "$BOOT" ; do
429 if [ ! -b "$i" ] ; then
430 echo 1>&2 "$PRG: $i: Not a block device"
435 ## unless --quiet ask permission to proceed
436 if [ "$QUIET" = 0 ] ; then
440 ## find the kernel in the usual places and (if not --quiet) ask the
441 ## user if we cannot find one.
442 if [ -f "${CHROOT}vmlinux" ] ; then
443 KERNEL="${CHROOT}vmlinux"
444 if [ -f "${CHROOT}initrd" ] ; then
445 INITRD="${CHROOT}initrd"
446 elif [ -f "${CHROOT}initrd.img" ] ; then
447 INITRD="${CHROOT}initrd.img"
448 elif [ -f "${CHROOT}initrd.gz" ] ; then
449 INITRD="${CHROOT}initrd.gz"
451 elif [ -f "${CHROOT}boot/vmlinux" ] ; then
452 KERNEL="${CHROOT}boot/vmlinux"
453 if [ -f "${CHROOT}boot/initrd" ] ; then
454 INITRD="${CHROOT}boot/initrd"
455 elif [ -f "${CHROOT}boot/initrd.img" ] ; then
456 INITRD="${CHROOT}boot/initrd.img"
457 elif [ -f "${CHROOT}boot/initrd.gz" ] ; then
458 INITRD="${CHROOT}boot/initrd.gz"
460 elif [ -f "${CHROOT}boot/vmlinux-`uname -r`" ] ; then
461 KERNEL="${CHROOT}boot/vmlinux-`uname -r`"
462 if [ -f "${CHROOT}boot/initrd-`uname -r`" ] ; then
463 INITRD="${CHROOT}boot/initrd-`uname -r`"
464 elif [ -f "${CHROOT}boot/initrd-`uname -r`.img" ] ; then
465 INITRD="${CHROOT}boot/initrd-`uname -r`.img"
466 elif [ -f "${CHROOT}boot/initrd-`uname -r`.gz" ] ; then
467 INITRD="${CHROOT}boot/initrd-`uname -r`.gz"
469 elif [ -f "${CHROOT}vmlinux-`uname -r`" ] ; then
470 KERNEL="${CHROOT}vmlinux-`uname -r`"
471 if [ -f "${CHROOT}initrd-`uname -r`" ] ; then
472 INITRD="${CHROOT}initrd-`uname -r`"
473 elif [ -f "${CHROOT}initrd-`uname -r`.img" ] ; then
474 INITRD="${CHROOT}initrd-`uname -r`.img"
475 elif [ -f "${CHROOT}initrd-`uname -r`.gz" ] ; then
476 INITRD="${CHROOT}initrd-`uname -r`.gz"
478 elif [ "$QUIET" = 0 ] ; then
479 echo 1>&2 "$PRG: Cannot find a kernel, please locate one"
481 $PRINTF 1>&2 "Enter path to a kernel image: "
483 if [ -f "$KERN" ] ; then
486 elif [ ! -e "$KERN" ] ; then
487 echo 1>&2 "$PRG: $KERN: No such file or directory"
488 elif [ -d "$KERN" ] ; then
489 echo 1>&2 "$PRG: $KERN: Is a directory"
491 echo 1>&2 "$PRG: $KERN: Is not a regular file"
495 $PRINTF 1>&2 "Enter path to an initrd image (hit Enter for none): "
497 if [ -z "$IRD" ] ; then
500 if [ -f "$IRD" ] ; then
503 elif [ ! -e "$IRD" ] ; then
504 echo 1>&2 "$PRG: $IRD: No such file or directory"
505 elif [ -d "$IRD" ] ; then
506 echo 1>&2 "$PRG: $IRD: Is a directory"
508 echo 1>&2 "$PRG: $IRD: Is not a regular file"
512 echo 1>&2 "$PRG: Cannot find a kernel, aborting..."
516 debug "KERNEL=$KERNEL\n"
517 debug "INITRD=$INITRD\n"
519 ## get partition number the kernel lives on, and the OF device= name
520 ## of the whole disk.
521 KERNDEV="$(v=`df "$KERNEL" 2> /dev/null | grep ^/dev/` ; echo ${v%%[ ]*})"
522 KERNDIR="$(v=`df "$KERNEL" 2> /dev/null | grep ^/dev/` ; echo ${v##*[ ]})"
523 LINKDEV="$(v=`df "${KERNEL%/*}/" 2>/dev/null | grep ^/dev/` ; echo ${v%%[ ]*})"
524 PARTITION="${KERNDEV##*[a-z]}"
526 if ckdevfs "$KERNDEV" ; then
527 KERNELDISK="${KERNDEV%/*}/disc"
529 KERNELDISK="${KERNDEV%%[0-9]*}"
532 if [ -n "$INITRD" ] ; then
533 ## get partition number the initrd lives on, and the OF device= name
534 ## of the whole disk.
535 IRDDEV="$(v=`df "$INITRD" 2> /dev/null | grep ^/dev/` ; echo ${v%%[ ]*})"
536 IRDDIR="$(v=`df "$INITRD" 2> /dev/null | grep ^/dev/` ; echo ${v##*[ ]})"
537 IRDLINKDEV="$(v=`df "${INITRD%/*}/" 2>/dev/null | grep ^/dev/` ; echo ${v%%[ ]*})"
538 IRDPARTITION="${KERNDEV##*[a-z]}"
540 if ckdevfs "$IRDDEV" ; then
541 INITRDDISK="${IRDDEV%/*}/disc"
543 INITRDDISK="${IRDDEV%%[0-9]*}"
547 debug "KERNEL=$KERNEL\nKERNDEV=$KERNDEV\nKERNDIR=$KERNDIR\nLINKDEV=$LINKDEV\nPARTITION=$PARTITION\nKERNELDISK=$KERNELDISK\n"
549 if [ -n "$INITRD" ] ; then
550 debug "INITRD=$INITRD\nIRDDEV=$IRDDEV\nIRDDIR=$IRDDIR\nIRDLINKDEV=$IRDLINKDEV\nIRDPARTITION=$IRDPARTITION\nINITRDDISK=$INITRDDISK\n"
554 for i in "$KERNDEV" "$KERNDIR" "$LINKDEV" "$PARTITION" "$KERNELDISK" ; do
555 if [ -z "$i" ] ; then
556 echo 1>&2 "$PRG: Could not determine necessary information, aborting..."
557 echo 1>&2 "$PRG: Are you using chroot $PRG instead of $PRG --chroot ?"
562 if [ -n "$INITRD" ] ; then
564 for i in "$IRDDEV" "$IRDDIR" "$IRDLINKDEV" "$IRDPARTITION" "$INITRDDISK" ; do
565 if [ -z "$i" ] ; then
566 echo 1>&2 "$PRG: Could not determine necessary information, aborting..."
567 echo 1>&2 "$PRG: Are you using chroot $PRG instead of $PRG --chroot ?"
573 ## check for cross device symlink
574 if [ -L "$KERNEL" ] ; then
575 if [ "$KERNDEV" != "$LINKDEV" ] ; then
576 echo 1>&2 "$PRG: Warning: Cross device symlink $KERNEL, using it's target instead"
577 KERNEL="$(readlink -f "$KERNEL" 2>/dev/null)"
578 if [ ! -f "$KERNEL" ] ; then
579 echo 1>&2 "$PRG: Unable to canonicalize symlink's target. Do not create cross device symlinks."
585 if [ -n "$INITRD" ] ; then
586 ## initrd must be on same device as kernel.
587 if [ "$IRDDEV" != "$KERNDEV" -o "$IRDPARTITION" != "$IRDPARTITION" -o "$INITRDDISK" != "$KERNELDISK" ] ; then
588 echo 1>&2 "$PRG: Initrd image must be on same device as kernel image."
592 ## check for cross device symlink
593 if [ -L "$INITRD" ] ; then
594 if [ "$IRDDEV" != "$IRDLINKDEV" ] ; then
595 echo 1>&2 "$PRG: Warning: Cross device symlink $INITRD, using it's target instead"
596 INITRD="$(readlink -f "$INITRD" 2>/dev/null)"
597 if [ ! -f "$INITRD" ] ; then
598 echo 1>&2 "$PRG: Unable to canonicalize symlink's target. Do not create cross device symlinks."
605 ## only powermacs appear to need device=
606 if (cat /proc/cpuinfo 2>/dev/null | grep -q pmac-generation 2> /dev/null) ; then
607 DEVICE="\ndevice=$($OFPATH $KERNELDISK)"
608 if [ $? != 0 ] ; then
609 echo 1>&2 "$PRG: Unable to determine OpenFirmware device name to $KERNELDISK, aborting..."
614 ## if there is a separate /boot partition we must strip off the /boot
615 ## mountpoint or else yaboot will not find the kernel.
616 if [ "$KERNDIR" != "$CHROOT" ] ; then
617 IMAGE="${KERNEL##*$KERNDIR}"
623 if [ "$CHROOT" != / ] ; then
624 IMAGE="${IMAGE##*$CHROOT}"
627 ## fix relative path (caused by chroot path fix)
637 if [ -n "$INITRD" ] ; then
638 ## if there is a separate /boot partition we must strip off the /boot
639 ## mountpoint or else yaboot will not find the kernel.
640 if [ "$IRDDIR" != "$CHROOT" ] ; then
641 INITRDIMG="${INITRD##*$IRDDIR}"
647 if [ "$CHROOT" != / ] ; then
648 INITRDIMG="${INITRDIMG##*$CHROOT}"
651 ## fix relative path (caused by chroot path fix)
657 INITRDIMG="/${INITRDIMG}"
662 ## figure out if yaboot is installed in /usr/local or not
663 if [ -f /usr/local/lib/yaboot/yaboot ] ; then
664 INSTALL=/usr/local/lib/yaboot/yaboot
665 elif [ -f /usr/lib/yaboot/yaboot ] ; then
666 INSTALL=/usr/lib/yaboot/yaboot
668 echo 1>&2 "$PRG: yaboot is not installed correctly"
672 ## newworld powermacs need the ofboot first stage loader
673 if [ "$(v=`cat /proc/cpuinfo 2>/dev/null | grep pmac-generation` ; echo ${v##*:})" = NewWorld ] ; then
674 if [ -f /usr/local/lib/yaboot/ofboot ] ; then
675 OFBOOT="\nmagicboot=/usr/local/lib/yaboot/ofboot"
676 elif [ -f /usr/lib/yaboot/ofboot ] ; then
677 OFBOOT="\nmagicboot=/usr/lib/yaboot/ofboot"
679 echo 1>&2 "$PRG: yaboot is not installed correctly"
684 ## check for properly (read debian) packaged yaboot.
685 if [ -d ${CHROOT}usr/share/doc/yaboot/examples ] ; then
686 HEADER="## see also: /usr/share/doc/yaboot/examples for example configurations.\n"
690 if [ -n "$KERNARGS" ] ; then
691 APPEND="\tappend=\"${KERNARGS}\"\n"
694 ## avoid user confusion when they boot an installer with video=ofonly
695 ## (usually via a install-safe label) and then reboot and have the box
696 ## not boot properly again.
697 if [ -z "$APPEND" ] ; then
698 if (grep -q '\<video=ofonly\>' /proc/cmdline 2> /dev/null) ; then
699 APPEND="\tappend=\"video=ofonly\"\n"
703 ## generate initrd= lines
704 if [ -n "$INITRDIMG" ] ; then
705 INITRDIMGS="\tinitrd=$INITRDIMG\n\tinitrd-size=8192\n"
708 ## generate global section of yaboot.conf
709 GLOBAL="## yaboot.conf generated by $PRG $VERSION
711 ## run: \"man yaboot.conf\" for details. Do not make changes until you have!!
713 ## For a dual-boot menu, add one or more of:
714 ## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ\n
715 boot=${BOOT}${DEVICE:-}
719 install=${INSTALL}${OFBOOT:-}\n"
721 ## generate image= section
725 \tread-only\n${APPEND:-}${INITRDIMGS:-}"
727 ## safely create a tmp file then move it into place after we are sure
729 TMPCONF=`mktemp -q "${CHROOT}${CONFIG}.XXXXXX"`
730 if [ $? != 0 ] ; then
731 echo 1>&2 "$PRG: Unable to write to ${CHROOT}${CONFIG%/*}"
735 $PRINTF "${GLOBAL}${IMAGES}" > "$TMPCONF"
736 if [ $? != 0 ] ; then
737 echo 1>&2 "$PRG: Unable to write temporary file ${TMPCONF}, aborting..."
741 ## rotate backups of /etc/yaboot.conf, 3 backups are kept
742 if [ -f "${CHROOT}${CONFIG}.old" ] ; then
744 if [ -f "${CHROOT}${CONFIG}.old.${i}" ] ; then
745 mv -f "${CHROOT}${CONFIG}.old.$i" "${CHROOT}${CONFIG}.old.$(($i + 1))"
746 if [ $? != 0 ] ; then
747 echo 1>&2 "$PRG: Unable to make backup of existing ${CHROOT}${CONFIG}.old.$i, aborting..."
753 mv -f "${CHROOT}${CONFIG}.old" "${CHROOT}${CONFIG}.old.0"
754 if [ $? != 0 ] ; then
755 echo 1>&2 "$PRG: Unable to make backup of existing ${CHROOT}${CONFIG}.old, aborting..."
760 ## backup /etc/yaboot.conf
761 if [ -f "${CHROOT}${CONFIG}" ] ; then
762 mv -f "${CHROOT}${CONFIG}" "${CHROOT}${CONFIG}.old"
763 if [ $? != 0 ] ; then
764 echo 1>&2 "$PRG: Unable to make backup of existing ${CHROOT}${CONFIG}, aborting..."
769 ## move new config into place
770 mv -f "${TMPCONF}" "${CHROOT}${CONFIG}"
771 if [ $? != 0 ] ; then
772 echo "$PRG: Unable to write file ${CHROOT}${CONFIG}"
775 ## nothing sensitive in generated config, comply with debian policy
776 chmod 644 "${CHROOT}${CONFIG}"
779 ## tell mkofboot where to find the config file if necessary
780 if [ "${CHROOT}${CONFIG}" != /etc/yaboot.conf ] ; then
781 YBINARGS="-C ${CHROOT}${CONFIG}"
784 ## run mkofboot to install the bootstrap, unless --noinstall
785 if [ "$NOINSTALL" = 0 ] ; then
786 if (command -v mkofboot 2>&1 > /dev/null) ; then
787 [ "$QUIET" = 0 ] && echo "Running mkofboot to make the disk bootable..."
788 mkofboot -f $YBINARGS || exit 1
789 [ "$QUIET" = 0 ] && echo "Done"
791 echo 1>&2 "$PRG: yaboot is not installed correctly, not running mkofboot"