1.1 --- a/makesd Sat May 25 18:20:40 2019 +0200
1.2 +++ b/makesd Sat May 25 23:38:04 2019 +0200
1.3 @@ -6,6 +6,7 @@
1.4 THISDIR=`dirname "$0"`
1.5
1.6 COMMON="$THISDIR/makesd-common"
1.7 +DEFS="$THISDIR/makesd-defs"
1.8 EXPAND="$THISDIR/makesd-expand-def"
1.9 FORMAT="$THISDIR/makesd-format"
1.10 PARTSUMMARY="$THISDIR/makesd-partition-summary"
1.11 @@ -20,17 +21,28 @@
1.12 if [ "$1" = '--help' ] ; then
1.13 cat 1>&2 <<EOF
1.14 Usage: $PROGNAME [ --align ] <definition name>
1.15 + $PROGNAME -a | --all | --defs
1.16
1.17 Partition, format, populate and initialise a device for use with a particular
1.18 kind of hardware. The given definition name is used to search the database of
1.19 supported hardware devices and to configure the different preparation
1.20 activities.
1.21
1.22 +If the -a, --all or --defs options are specified, all hardware definitions are
1.23 +emitted and no further actions are taken.
1.24 +
1.25 $(align_cylinder_description)
1.26 EOF
1.27 exit 0
1.28 fi
1.29
1.30 +# Test for the definition output options.
1.31 +
1.32 +if [ "$1" = '-a' ] || [ "$1" = '--all' ] || [ "$1" = '--defs' ] ; then
1.33 + grep '^[[:alpha:]]' "$DEFS" | cut -f1 | sort
1.34 + exit 0
1.35 +fi
1.36 +
1.37 # Obtain details of the selected device.
1.38
1.39 check_device
2.1 --- a/makesd-expand-def Sat May 25 18:20:40 2019 +0200
2.2 +++ b/makesd-expand-def Sat May 25 23:38:04 2019 +0200
2.3 @@ -6,8 +6,7 @@
2.4 PROGNAME=`basename "$0"`
2.5 THISDIR=`dirname "$0"`
2.6
2.7 -DEFSFILE="makesd-defs"
2.8 -DEFSPATH="$THISDIR/$DEFSFILE"
2.9 +DEFS="$THISDIR/makesd-defs"
2.10
2.11
2.12
2.13 @@ -30,7 +29,7 @@
2.14
2.15 Search for a definition of the given name in the definitions file:
2.16
2.17 -$DEFSPATH
2.18 +$DEFS
2.19
2.20 If the definition can be found, the value of the definition is emitted and an
2.21 exit value of 0 returned. Otherwise, no output is produced and an exit value of
2.22 @@ -53,13 +52,13 @@
2.23
2.24 # Obtain the line number of the matching definition.
2.25
2.26 - LINENUM=`grep -h -n "^$1\s" "$DEFSPATH" | cut -d: -f1`
2.27 + LINENUM=`grep -h -n "^$1\s" "$DEFS" | cut -d: -f1`
2.28
2.29 if [ "$LINENUM" ] ; then
2.30
2.31 # Read from the definition line. Line continuations are observed.
2.32
2.33 - tail -n "+$LINENUM" "$DEFSPATH" | if read LINE ; then
2.34 + tail -n "+$LINENUM" "$DEFS" | if read LINE ; then
2.35 echo "$LINE"
2.36 break
2.37 fi