1 #!/bin/sh 2 3 # Prepare a disk for booting a hardware device. 4 5 PROGNAME=`basename "$0"` 6 THISDIR=`dirname "$0"` 7 8 COMMON="$THISDIR/makesd-common" 9 EXPAND="$THISDIR/makesd-expand-def" 10 FORMAT="$THISDIR/makesd-format" 11 PARTSUMMARY="$THISDIR/makesd-partition-summary" 12 PARTITION="$THISDIR/makesd-partition" 13 14 . "$COMMON" 15 16 17 18 # Obtain details of the selected device. 19 20 check_device 21 22 SUMMARY="`basename "$DEV"`.summary" 23 24 # Test for the cylinder alignment option. 25 26 if test_align_cylinder $* ; then shift 1 ; fi 27 28 # Obtain the definition name. 29 30 DEF="$1" 31 32 if [ ! "$DEF" ] ; then 33 cat 1>&2 <<EOF 34 No definition specified. 35 EOF 36 exit 1 37 fi 38 39 shift 1 40 41 # Expand the definition to partitioning options. 42 43 if ! ARGS=`"$EXPAND" "$DEF"` ; then 44 cat 1>&2 <<EOF 45 Device definition not found: $DEF 46 EOF 47 exit 1 48 fi 49 50 # Use the options to generate a partition summary. 51 52 "$PARTSUMMARY" $ARGS \ 53 > "$SUMMARY" 54 55 # Partition the given device. 56 57 "$PARTITION" $ALIGN_CYLINDER < "$SUMMARY" 58 59 # Format the given device. 60 61 "$FORMAT" < "$SUMMARY"