]> git.ozlabs.org Git - yaboot.git/blob - ybin/yabootconfig
fae93b3e2a8619f2f60caef6528915bb6c7ceb15
[yaboot.git] / ybin / yabootconfig
1 #! /bin/sh
2
3 ###############################################################################
4 ##
5 ## yabootconfig generates a simple /etc/yaboot.conf
6 ## Copyright (C) 2001, 2002 Ethan Benson
7 ##
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.
12 ##
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.
17 ##
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.
21 ##
22 ###############################################################################
23
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"
28 fi
29 PRG="${0##*/}"
30 VERSION=1.0.6
31 CHROOT=/
32 ## $CONFIG is relative to $CHROOT
33 CONFIG=etc/yaboot.conf
34 NOINSTALL=0
35 QUIET=0
36 DEBUG=0
37 SIGINT="$PRG: Interrupt caught ... exiting"
38 export LC_COLLATE=C
39
40 ## catch signals, clean up temporary file
41 trap "cleanup" 0
42 trap "exit 129" 1
43 trap "echo 1>&2 $SIGINT ; exit 130" 2
44 trap "exit 131" 3
45 trap "exit 143" 15
46
47 ## check for printf, use it if possible otherwise fall back on
48 ## unreliable echo -e -n ("SUS" says echo shall support no switches)
49 if [ "$(printf printf_test 2>/dev/null)" = printf_test ] ; then
50     PRINTF=printf
51 else
52     PRINTF="echo -e -n"
53 fi
54
55 ## make sure echo is not lame if we must use it.
56 if [ "$PRINTF" != printf ] ; then
57     if [ "$(echo -e -n echo_test)" != "echo_test" ] ; then
58         echo 1>&2 "$PRG: printf unavailable and echo is broken, sorry."
59         exit 1
60     fi
61 fi
62
63 ## make fake `id' if its missing, outputs 0 since if its missing we
64 ## are probably running on boot floppies and thus are root.
65 if (command -v id > /dev/null 2>&1) ; then 
66     true
67 else
68     id()
69     {
70     echo 0
71     }
72 fi
73
74 ## --version output
75 version()
76 {
77 echo \
78 "$PRG $VERSION
79 Written by Ethan Benson
80
81 Copyright (C) 2001, 2002 Ethan Benson
82 This is free software; see the source for copying conditions.  There is NO
83 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84 }
85
86 ## --help output.
87 usage()
88 {
89 echo \
90 "Usage: $PRG [OPTION]...
91 Generate a working /etc/yaboot.conf.
92
93   -t, --chroot               set root directory $PRG should work from
94   -r, --root                 set root partition, Example: /dev/hda3
95                                default: determined from {chroot}/etc/fstab
96   -b, --boot                 set bootstrap partition, Example: /dev/hda2
97                                default: first type: Apple_Bootstrap partition
98       --kernel-args          add an append= line with specified arguments
99   -q, --quiet                don't ask any questions/confirmation
100       --noinstall            don't automatically run mkofboot
101   -h, --help                 display this help and exit
102   -V, --version              output version information and exit"
103 }
104
105 debug()
106 {
107     [ "$DEBUG" = 0 ] && return 0
108     $PRINTF 1>&2 "$PRG: DEBUG: $1"
109 }
110
111 confirm()
112 {
113     $PRINTF \
114 "yaboot is the Linux Loader for PowerPC.  $PRG sets up your system to boot directly
115 from your hard disk, without the need for a boot CD, floppy or a network boot.\n"
116 [ "$NOINSTALL" = 0 ] && $PRINTF "Install yaboot bootstrap on $BOOT to boot Linux from $ROOT? [Yes] "
117 [ "$NOINSTALL" = 1 ] && $PRINTF "Create simple ${CHROOT}${CONFIG} to boot Linux from $ROOT? [Yes] "
118     read ans
119     case "$ans" in
120         Y|y|Yes|yes|YES|"")
121         echo "Creating a simple ${CHROOT}${CONFIG}..."
122         return 0
123         ;;
124         *)
125         if [ "$NOINSTALL" = 0 ] ; then
126             $PRINTF "Create simple ${CHROOT}${CONFIG} without installing the bootstrap? [Yes] "
127             read ans
128             case "$ans" in
129                 Y|y|Yes|yes|YES|"")
130                 NOINSTALL=1
131                 echo 1>&2 "Creating a simple ${CHROOT}${CONFIG}..."
132                 return 0
133                 ;;
134                 *)
135                 echo "OK, quitting"
136                 return 1
137                 ;;
138             esac
139         else
140             echo "OK, quitting"
141             return 1
142         fi
143         ;;
144     esac
145 }
146
147 ## find out whether we have mac-fdisk or pdisk (they work the same)
148 ckmacfdisk()
149 {
150     if (command -v mac-fdisk > /dev/null 2>&1) ; then
151         FDISK=mac-fdisk
152     elif (command -v pdisk > /dev/null 2>&1) ; then
153         FDISK=pdisk
154     else
155         echo 1>&2 "$PRG: Unable to locate mac-fdisk"
156         return 1
157     fi
158
159     if [ ! -x `command -v $FDISK` 2> /dev/null ] ; then
160         echo 1>&2 "$PRG: `command -v $FDISK`: Permission denied"
161         return 1
162     fi
163     debug "mac-fdisk is: $FDISK\n"
164     return 0
165 }
166
167 ## find out if we have ddisk or fdisk (fdisk for dos labels) debian
168 ## uses both names
169 ckfdisk()
170 {
171     if (command -v ddisk > /dev/null 2>&1) ; then
172         FDISK=ddisk
173     elif (command -v fdisk > /dev/null 2>&1) ; then
174         FDISK=fdisk
175     else
176         echo 1>&2 "$PRG: Unable to locate fdisk"
177         return 1
178     fi
179
180     if [ ! -x `command -v $FDISK` 2> /dev/null ] ; then
181         echo 1>&2 "$PRG: `command -v $FDISK`: Permission denied"
182         return 1
183     fi
184     debug "fdisk is: $FDISK\n"
185     return 0
186 }
187
188 ## find bootstrap partition, supports IBM CHRP with msdos disklabels
189 findbootblock()
190 {
191     ## mac partition table magic == ER
192     if [ "$(dd if="$DISK" bs=2 count=1 2> /dev/null)" = ER ] ; then
193         ckmacfdisk || return 1
194         if [ "$FDISK" = pdisk ] ; then
195             ## handle braindamaged pdisk
196             debug "dealing with pdisk deficiency...\n"
197             BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\<Apple_Bootstrap\>'` ; echo ${v%%:*})"
198             debug "BOOT before fixup: $BOOT\n"
199             if [ -n "$BOOT" ] ; then
200                 BOOT="${DISK}${BOOT}"
201             fi
202             debug "BOOT after fixup: $BOOT\n"
203         else
204             BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\<Apple_Bootstrap\>'` ; echo ${v%%[ ]*})"
205             debug "BOOT=$BOOT\n"
206         fi
207         if [ -z "$BOOT" ] ; then
208             echo 1>&2 "$PRG: Unable to locate bootstrap partition on $DISK..."
209             echo 1>&2 "$PRG: You must create an 800K type: Apple_Bootstrap partition to make the disk bootable"
210             return 1
211         fi
212     else
213         ckfdisk || return 1
214         BOOT="$(v=`$FDISK -l "$DISK" 2>/dev/null | grep '\<PPC PReP Boot\>'` ; echo ${v%%[ ]*})"
215         debug "BOOT=$BOOT\n"
216         if [ -z "$BOOT" ] ; then
217             echo 1>&2 "$PRG: Unable to locate bootstrap partition on $DISK..."
218             echo 1>&2 "$PRG: You must create an 800K type: 0x41 PPC PReP Boot partition to make the disk bootable"
219             return 1
220         fi
221     fi
222     return 0
223 }
224
225 ## if readlink is missing use a kludge
226 if (command -v readlink > /dev/null 2>&1) ; then
227     true
228 else
229     readlink()
230     {
231         SYMTARGET="$(v=`ls -l "$2" 2>/dev/null` ; echo ${v##*> })"
232         if [ -n "$SYMTARGET" ] ; then
233             echo "$SYMTARGET"
234             return 0
235         else
236             return 1
237         fi
238     }
239 fi
240
241 ## we have to do some things differently with a retarded devfs name.
242 ckdevfs()
243 {
244     case "$1" in
245         /dev/ide/*|/dev/scsi/*|/dev/discs/*)
246         return 0
247         ;;
248         *)
249         return 1
250         ;;
251     esac
252 }
253
254 cleanup()
255 {
256     if [ -n "$TMPCONF" ] ; then rm -f "$TMPCONF" ; fi
257     return 0
258 }
259
260 ##########
261 ## Main ##
262 ##########
263
264 if [ $# != 0 ] ; then
265     while true ; do
266         case "$1" in 
267             -V|--version)
268                 version
269                 exit 0
270                 ;;
271             -h|--help)
272                 usage
273                 exit 0
274                 ;;
275             -t|--chroot)
276                 if [ -n "$2" ] ; then
277                     CHROOT="$2"
278                     shift 2
279                 else
280                     echo 1>&2 "$PRG: option requires an argument $1"
281                     echo 1>&2 "Try \`$PRG --help' for more information."
282                     exit 1
283                 fi
284                 ;;
285             -b|--boot)
286                 if [ -n "$2" ] ; then
287                     BOOT="$2"
288                     shift 2
289                 else
290                     echo 1>&2 "$PRG: option requires an argument $1"
291                     echo 1>&2 "Try \`$PRG --help' for more information."
292                     exit 1
293                 fi
294                 ;;
295             -r|--root)
296                 if [ -n "$2" ] ; then
297                     ROOT="$2"
298                     shift 2
299                 else
300                     echo 1>&2 "$PRG: option requires an argument $1"
301                     echo 1>&2 "Try \`$PRG --help' for more information."
302                     exit 1
303                 fi
304                 ;;
305             --kernel-args)
306                 if [ -n "$2" ] ; then
307                     KERNARGS="$2"
308                     shift 2
309                 else
310                     echo 1>&2 "$PRG: option requires an argument $1"
311                     echo 1>&2 "Try \`$PRG --help' for more information."
312                     exit 1
313                 fi
314                 ;;
315             -q|--quiet)
316                 QUIET=1
317                 shift 1
318                 ;;
319             --noinstall)
320                 NOINSTALL=1
321                 shift 1
322                 ;;
323             --debug)
324                 DEBUG=1
325                 shift 1
326                 ;;
327             "")
328                 break
329                 ;;
330             *)
331                 echo 1>&2 "$PRG: unrecognized option \`$1'"
332                 echo 1>&2 "Try \`$PRG --help' for more information."
333                 exit 1
334                 ;;
335         esac
336     done
337 fi
338
339 if [ `id -u` != 0 ] ; then
340     echo 1>&2 "$PRG: You are not root, go away"
341     exit 1
342 fi
343
344 ## we need /proc because df does
345 if [ ! -f /proc/uptime ] ; then
346     echo 1>&2 "$PRG: This utility requires the /proc filesystem"
347     exit 1
348 fi
349
350 ## check that chroot exists
351 if [ -d "$CHROOT" ] ; then
352     ## HACK: add trailing / to chroot, otherwise are paths later get b0rked.
353     case "$CHROOT" in
354         */)
355         true
356         ;;
357         *)
358         CHROOT="${CHROOT}/"
359         ;;
360     esac
361 elif [ ! -e "$CHROOT" ] ; then
362     echo 1>&2 "$PRG: $CHROOT: No such file or directory"
363     exit 1
364 elif [ ! -d "$CHROOT" ] ; then
365     echo 1>&2 "$PRG: $CHROOT: Not a directory"
366     exit 1
367 fi
368
369 ## make sure the chroot is an actual root filesystem
370 if [ ! -f "${CHROOT}etc/fstab" ] ; then
371     echo 1>&2 "$PRG: $CHROOT does not appear to be a valid root filesystem"
372     exit 1
373 fi
374
375 ## find / device
376 if [ -z "$ROOT" ] ; then
377     ## IMPORTANT! that last substitution is [<space><tab>] thats all ash will grok
378     ROOT="$(v=`grep '^[^#].*[[:blank:]]/[[:blank:]]' ${CHROOT}etc/fstab` ; echo ${v%%[  ]*})"
379     debug "ROOT=$ROOT\n"
380     if [ -z "$ROOT" ] ; then
381         echo 1>&2 "$PRG: Could not determine root partition, aborting..."
382         exit 1
383     fi
384 fi
385
386 ## make sure root device exists
387 if [ ! -e "$ROOT" ] ; then
388     echo 1>&2 "$PRG: $ROOT: No such file or directory"
389     exit 1
390 fi
391
392 ## find root disk.
393 if ckdevfs "$ROOT" ; then
394     DISK="${ROOT%/*}/disc"
395 else
396     DISK="${ROOT%%[0-9]*}"
397 fi
398 if [ -z "$DISK" ] ; then
399     echo 1>&2 "$PRG: Could not determine root disk, aborting..."
400     exit 1
401 fi
402
403 ## make sure main disk exists
404 if [ ! -e "$DISK" ] ; then
405     echo 1>&2 "$PRG: $DISK: No such file or directory"
406     exit 1
407 fi
408
409 ## find bootstrap partition
410 if [ -z "$BOOT" ] ; then
411     findbootblock || exit 1
412 fi
413
414 ## make sure bootstrap device exists
415 if [ ! -e "$BOOT" ] ; then
416     echo 1>&2 "$PRG: $BOOT: No such file or directory"
417     exit 1
418 fi
419
420 ## sanity check
421 for i in "$DISK" "$ROOT" "$BOOT" ; do
422     if [ ! -b "$i" ] ; then
423         echo 1>&2 "$PRG: $i: Not a block device"
424         exit 1
425     fi
426 done
427
428 ## unless --quiet ask permission to proceed
429 if [ "$QUIET" = 0 ] ; then
430     confirm || exit 2
431 fi
432
433 ## find the kernel in the usual places and (if not --quiet) ask the
434 ## user if we cannot find one.
435 if [ -f "${CHROOT}vmlinux" ] ; then
436     KERNEL="${CHROOT}vmlinux"
437 elif [ -f "${CHROOT}boot/vmlinux" ] ; then
438     KERNEL="${CHROOT}boot/vmlinux"
439 elif [ -f "${CHROOT}boot/vmlinux-`uname -r`" ] ; then
440     KERNEL="${CHROOT}boot/vmlinux-`uname -r`"
441 elif [ -f "${CHROOT}vmlinux-`uname -r`" ] ; then
442     KERNEL="${CHROOT}vmlinux-`uname -r`"
443 elif [ "$QUIET" = 0 ] ; then
444     echo 1>&2 "$PRG: Cannot find a kernel, please locate one"
445     while true ; do
446         $PRINTF 1>&2 "Enter path to a kernel image: "
447         read KERN
448         if [ -f "$KERN" ] ; then
449             KERNEL="$KERN"
450             break
451         elif [ ! -e "$KERN" ] ; then
452             echo 1>&2 "$PRG: $KERN: No such file or directory"
453         elif [ -d "$KERN" ] ; then
454             echo 1>&2 "$PRG: $KERN: Is a directory"
455         else
456             echo 1>&2 "$PRG: $KERN: Is not a regular file"
457         fi
458     done
459 else
460     echo 1>&2 "$PRG: Cannot find a kernel, aborting..."
461     exit 1
462 fi
463
464 debug "KERNEL=$KERNEL\n"
465
466 ## get partition number the kernel lives on, and the OF device= name
467 ## of the whole disk.
468 KERNDEV="$(v=`df "$KERNEL" 2> /dev/null | grep ^/dev/` ; echo ${v%%[ ]*})"
469 KERNDIR="$(v=`df "$KERNEL" 2> /dev/null | grep ^/dev/` ; echo ${v##*[ ]})"
470 LINKDEV="$(v=`df "${KERNEL%/*}/" 2>/dev/null | grep ^/dev/` ; echo ${v%%[ ]*})"
471 PARTITION="${KERNDEV##*[a-z]}"
472
473 if ckdevfs "$KERNDEV" ; then
474     KERNELDISK="${KERNDEV%/*}/disc"
475 else
476     KERNELDISK="${KERNDEV%%[0-9]*}"
477 fi
478
479 debug "KERNEL=$KERNEL\nKERNDEV=$KERNDEV\nKERNDIR=$KERNDIR\nLINKDEV=$LINKDEV\nPARTITION=$PARTITION\nKERNELDISK=$KERNELDISK\n"
480
481 ## sanity check
482 for i in "$KERNDEV" "$KERNDIR" "$LINKDEV" "$PARTITION" "$KERNELDISK" ; do
483     if [ -z "$i" ] ; then
484         echo 1>&2 "$PRG: Could not determine necessary information, aborting..."
485         echo 1>&2 "$PRG: Are you using chroot $PRG instead of $PRG --chroot ?"
486         exit 1
487     fi
488 done
489
490 ## check for cross device symlink
491 if [ -L "$KERNEL" ] ; then
492     if [ "$KERNDEV" != "$LINKDEV" ] ; then
493         echo 1>&2 "$PRG: Warning: Cross device symlink $KERNEL, using it's target instead"
494         KERNEL="$(readlink -f "$KERNEL" 2>/dev/null)"
495         if [ ! -f "$KERNEL" ] ; then
496             echo 1>&2 "$PRG: Unable to canonicalize symlink's target.  Do not create cross device symlinks."
497             exit 1
498         fi
499     fi
500 fi
501
502 ## only powermacs appear to need device=
503 if (cat /proc/cpuinfo 2>/dev/null | grep -q pmac-generation 2> /dev/null) ; then
504     DEVICE="\ndevice=$(ofpath $KERNELDISK)"
505     if [ $? != 0 ] ; then
506         echo 1>&2 "$PRG: Unable to determine OpenFirmware device name to $KERNELDISK, aborting..."
507         exit 1
508     fi
509 fi
510
511 ## if there is a separate /boot partition we must strip off the /boot
512 ## mountpoint or else yaboot will not find the kernel.
513 if [ "$KERNDIR" != "$CHROOT" ] ; then
514     IMAGE="${KERNEL##*$KERNDIR}"
515 else
516     IMAGE="$KERNEL"
517 fi
518
519 ## fix chrooted path
520 if [ "$CHROOT" != / ] ; then
521     IMAGE="${IMAGE##*$CHROOT}"
522 fi
523
524 ## fix relative path (caused by chroot path fix)
525 case "$IMAGE" in
526     /*)
527     true
528     ;;
529     *)
530     IMAGE="/${IMAGE}"
531     ;;
532 esac
533
534 ## figure out if yaboot is installed in /usr/local or not
535 if [ -f /usr/local/lib/yaboot/yaboot ] ; then
536     INSTALL=/usr/local/lib/yaboot/yaboot
537 elif [ -f /usr/lib/yaboot/yaboot ] ; then
538     INSTALL=/usr/lib/yaboot/yaboot
539 else
540     echo 1>&2 "$PRG: yaboot is not installed correctly"
541     exit 1
542 fi
543
544 ## newworld powermacs need the ofboot first stage loader
545 if [ "$(v=`cat /proc/cpuinfo 2>/dev/null | grep pmac-generation` ; echo ${v##*:})" = NewWorld ] ; then
546     if [ -f /usr/local/lib/yaboot/ofboot ] ; then
547         OFBOOT="\nmagicboot=/usr/local/lib/yaboot/ofboot"
548     elif [ -f /usr/lib/yaboot/ofboot ] ; then
549         OFBOOT="\nmagicboot=/usr/lib/yaboot/ofboot"
550     else
551         echo 1>&2 "$PRG: yaboot is not installed correctly"
552         exit 1
553     fi
554 fi    
555
556 ## check for properly (read debian) packaged yaboot.
557 if [ -d ${CHROOT}usr/share/doc/yaboot/examples ] ; then
558     HEADER="## see also: /usr/share/doc/yaboot/examples for example configurations.\n"
559 fi
560
561 ## setup append line
562 if [ -n "$KERNARGS" ] ; then
563     APPEND="\tappend=\"${KERNARGS}\"\n"
564 fi
565
566 ## generate global section of yaboot.conf
567 GLOBAL="## yaboot.conf generated by $PRG $VERSION
568 ##
569 ## run: \"man yaboot.conf\" for details. Do not make changes until you have!!
570 ${HEADER}##
571 ## For a dual-boot menu, add one or more of: 
572 ## bsd=/dev/hdaX, macos=/dev/hdaY, macosx=/dev/hdaZ\n
573 boot=${BOOT}${DEVICE:-}
574 partition=$PARTITION
575 root=$ROOT
576 timeout=30
577 install=${INSTALL}${OFBOOT:-}\n"
578
579 ## generate image= section
580 IMAGES="
581 image=$IMAGE
582 \tlabel=Linux
583 \tread-only\n${APPEND:-}"
584
585 ## safely create a tmp file then move it into place after we are sure
586 ## it was written.
587 TMPCONF=`mktemp -q "${CHROOT}${CONFIG}.XXXXXX"`
588 if [ $? != 0 ] ; then
589     echo 1>&2 "$PRG: Unable to write to ${CHROOT}${CONFIG%/*}"
590     exit 1
591 fi
592
593 $PRINTF "${GLOBAL}${IMAGES}" > "$TMPCONF"
594 if [ $? != 0 ] ; then
595     echo 1>&2 "$PRG: Unable to write temporary file ${TMPCONF}, aborting..."
596     exit 1
597 fi
598
599 ## rotate backups of /etc/yaboot.conf, 3 backups are kept
600 if [ -f "${CHROOT}${CONFIG}.old" ] ; then
601     for i in 1 0 ; do
602         if [ -f "${CHROOT}${CONFIG}.old.${i}" ] ; then
603             mv -f "${CHROOT}${CONFIG}.old.$i" "${CHROOT}${CONFIG}.old.$(($i + 1))"
604             if [ $? != 0 ] ; then
605                 echo 1>&2 "$PRG: Unable to make backup of existing ${CHROOT}${CONFIG}.old.$i, aborting..."
606                 exit 1
607             fi
608         fi
609     done
610
611     mv -f "${CHROOT}${CONFIG}.old" "${CHROOT}${CONFIG}.old.0"
612     if [ $? != 0 ] ; then
613         echo 1>&2 "$PRG: Unable to make backup of existing ${CHROOT}${CONFIG}.old, aborting..."
614         exit 1
615     fi
616 fi
617
618 ## backup /etc/yaboot.conf
619 if [ -f "${CHROOT}${CONFIG}" ] ; then
620     mv -f "${CHROOT}${CONFIG}" "${CHROOT}${CONFIG}.old"
621     if [ $? != 0 ] ; then
622         echo 1>&2 "$PRG: Unable to make backup of existing ${CHROOT}${CONFIG}, aborting..."
623         exit 1
624     fi
625 fi
626
627 ## move new config into place
628 mv -f "${TMPCONF}" "${CHROOT}${CONFIG}"
629 if [ $? != 0 ] ; then
630     echo "$PRG: Unable to write file ${CHROOT}${CONFIG}"
631     exit 1
632 else
633     ## nothing sensitive in generated config, comply with debian policy
634     chmod 644 "${CHROOT}${CONFIG}"
635 fi
636
637 ## tell mkofboot where to find the config file if necessary
638 if [ "${CHROOT}${CONFIG}" != /etc/yaboot.conf ] ; then
639     YBINARGS="-C ${CHROOT}${CONFIG}"
640 fi
641
642 ## run mkofboot to install the bootstrap, unless --noinstall
643 if [ "$NOINSTALL" = 0 ] ; then
644     if (command -v mkofboot 2>&1 > /dev/null) ; then
645         [ "$QUIET" = 0 ] && echo "Running mkofboot to make the disk bootable..."
646         mkofboot -f $YBINARGS || exit 1
647         [ "$QUIET" = 0 ] && echo "Done"
648     else
649         echo 1>&2 "$PRG: yaboot is not installed correctly, not running mkofboot"
650         exit 1
651     fi
652 fi
653
654 exit 0