1.1 --- a/makesd Tue May 28 00:30:18 2019 +0200
1.2 +++ b/makesd Mon Jun 10 01:37:46 2019 +0200
1.3 @@ -23,8 +23,8 @@
1.4 COMMON="$THISDIR/makesd-common"
1.5 DEFS="$THISDIR/makesd-defs"
1.6 EXPAND="$THISDIR/makesd-expand-def"
1.7 +FILTER="$THISDIR/makesd-filter-def"
1.8 FORMAT="$THISDIR/makesd-format"
1.9 -PARTSUMMARY="$THISDIR/makesd-partition-summary"
1.10 PARTITION="$THISDIR/makesd-partition"
1.11
1.12 . "$COMMON"
1.13 @@ -35,16 +35,15 @@
1.14
1.15 if [ "$1" = '--help' ] ; then
1.16 cat 1>&2 <<EOF
1.17 -Usage: $PROGNAME [ --align ] <definition name>
1.18 +Usage: $PROGNAME [ --align ] <system>
1.19 $PROGNAME -a | --all | --defs
1.20
1.21 Partition, format, populate and initialise a device for use with a particular
1.22 -kind of hardware. The given definition name is used to search the database of
1.23 +kind of hardware. The given system name is used to search the database of
1.24 supported hardware devices and to configure the different preparation
1.25 activities.
1.26
1.27 -If the -a, --all or --defs options are specified, all hardware definitions are
1.28 -emitted and no further actions are taken.
1.29 +$(show_definitions_description)
1.30
1.31 $(align_cylinder_description)
1.32 EOF
1.33 @@ -54,7 +53,7 @@
1.34 # Test for the definition output options.
1.35
1.36 if [ "$1" = '-a' ] || [ "$1" = '--all' ] || [ "$1" = '--defs' ] ; then
1.37 - grep '^[[:alpha:]]' "$DEFS" | cut -f1 | sort
1.38 + "$EXPAND" "$1"
1.39 exit 0
1.40 fi
1.41
1.42 @@ -62,8 +61,6 @@
1.43
1.44 check_device
1.45
1.46 -SUMMARY="`basename "$DEV"`.summary"
1.47 -
1.48 # Test for the cylinder alignment option.
1.49
1.50 if test_align_cylinder $* ; then shift 1 ; fi
1.51 @@ -79,28 +76,14 @@
1.52 exit 1
1.53 fi
1.54
1.55 -shift 1
1.56 -
1.57 -# Expand the definition to partitioning options.
1.58 -
1.59 -if ! ARGS=`"$EXPAND" "$DEF"` ; then
1.60 - cat 1>&2 <<EOF
1.61 -Device definition not found: $DEF
1.62 -EOF
1.63 - exit 1
1.64 -fi
1.65 -
1.66 -# Use the options to generate a partition summary.
1.67 -
1.68 - "$PARTSUMMARY" $ARGS \
1.69 -> "$SUMMARY"
1.70 -
1.71 # Partition the given device, passing only partition details to the script.
1.72
1.73 - cut -f 1,2,3 "$SUMMARY" \
1.74 + "$EXPAND" "$DEF" \
1.75 +| "$FILTER" "partition" "position" "size" "type" \
1.76 | "$PARTITION" $ALIGN_CYLINDER
1.77
1.78 # Format the given device, passing only partition types to the script.
1.79
1.80 - cut -f 3 "$SUMMARY" \
1.81 + "$EXPAND" "$DEF" \
1.82 +| "$FILTER" "partition" "type" \
1.83 | "$FORMAT"