remakesd

Change of makesd

12:8c2e5d045860
makesd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/makesd	Sat May 25 17:48:54 2019 +0200
     1.3 @@ -0,0 +1,61 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +# Prepare a disk for booting a hardware device.
     1.7 +
     1.8 +PROGNAME=`basename "$0"`
     1.9 +THISDIR=`dirname "$0"`
    1.10 +
    1.11 +COMMON="$THISDIR/makesd-common"
    1.12 +EXPAND="$THISDIR/makesd-expand-def"
    1.13 +FORMAT="$THISDIR/makesd-format"
    1.14 +PARTSUMMARY="$THISDIR/makesd-partition-summary"
    1.15 +PARTITION="$THISDIR/makesd-partition"
    1.16 +
    1.17 +. "$COMMON"
    1.18 +
    1.19 +
    1.20 +
    1.21 +# Obtain details of the selected device.
    1.22 +
    1.23 +check_device
    1.24 +
    1.25 +SUMMARY="`basename "$DEV"`.summary"
    1.26 +
    1.27 +# Test for the cylinder alignment option.
    1.28 +
    1.29 +if test_align_cylinder $* ; then shift 1 ; fi
    1.30 +
    1.31 +# Obtain the definition name.
    1.32 +
    1.33 +DEF="$1"
    1.34 +
    1.35 +if [ ! "$DEF" ] ; then
    1.36 +    cat 1>&2 <<EOF
    1.37 +No definition specified.
    1.38 +EOF
    1.39 +    exit 1
    1.40 +fi
    1.41 +
    1.42 +shift 1
    1.43 +
    1.44 +# Expand the definition to partitioning options.
    1.45 +
    1.46 +if ! ARGS=`"$EXPAND" "$DEF"` ; then
    1.47 +    cat 1>&2 <<EOF
    1.48 +Device definition not found: $DEF
    1.49 +EOF
    1.50 +    exit 1
    1.51 +fi
    1.52 +
    1.53 +# Use the options to generate a partition summary.
    1.54 +
    1.55 + "$PARTSUMMARY" $ARGS \
    1.56 +> "$SUMMARY"
    1.57 +
    1.58 +# Partition the given device.
    1.59 +
    1.60 +"$PARTITION" $ALIGN_CYLINDER < "$SUMMARY"
    1.61 +
    1.62 +# Format the given device.
    1.63 +
    1.64 +"$FORMAT" < "$SUMMARY"