1.1 --- a/makesd-partition Sat May 25 01:19:39 2019 +0200
1.2 +++ b/makesd-partition Sat May 25 17:00:03 2019 +0200
1.3 @@ -1,6 +1,7 @@
1.4 #!/bin/sh
1.5
1.6 -# Support partitioning of a device using sfdisk.
1.7 +# Support partitioning of a device using sfdisk. This program accepts a
1.8 +# partitioning summary on standard input.
1.9 #
1.10 # Important tasks:
1.11 #
1.12 @@ -11,8 +12,6 @@
1.13 THISDIR=`dirname "$0"`
1.14
1.15 COMMON="$THISDIR/makesd-common"
1.16 -EXPAND="$THISDIR/makesd-expand-def"
1.17 -PARTSUMMARY="$THISDIR/makesd-partition-summary"
1.18 PARTTABLE="$THISDIR/makesd-partition-table"
1.19 SFDISK="/sbin/sfdisk"
1.20
1.21 @@ -37,34 +36,12 @@
1.22
1.23 check_device
1.24
1.25 -# Test for the cylinder alignment option.
1.26 -
1.27 -if [ "$1" = '--align' ] ; then
1.28 - ALIGN_CYLINDER="$1"
1.29 - shift 1
1.30 -else
1.31 - ALIGN_CYLINDER=
1.32 -fi
1.33 -
1.34 -DEF="$1"
1.35 -
1.36 -if [ ! "$DEF" ] ; then
1.37 - cat 1>&2 <<EOF
1.38 -No definition specified.
1.39 -EOF
1.40 - exit 1
1.41 -fi
1.42 -
1.43 # Initialise sfdisk usage.
1.44
1.45 init_sfdisk "$DEV"
1.46
1.47 -# Expand the definition to partitioning options.
1.48 -# Use the options to generate a partition summary.
1.49 -# Convert the summary into a table.
1.50 +# Convert the partitioning summary into a partition table description.
1.51 # Present the table to sfdisk.
1.52
1.53 - "$EXPAND" "$DEF" \
1.54 -| xargs "$PARTSUMMARY" \
1.55 -| "$PARTTABLE" $ALIGN_CYLINDER \
1.56 + "$PARTTABLE" $* \
1.57 | "$SFDISK" $SFDISK_OPTIONS "$DEV"