remakesd

Changeset

19:075e1897863f
2019-05-28 Paul Boddie raw files shortlog changelog graph Filter summary columns for scripts, the formatter accepting one value per line.
makesd (file) makesd-format (file)
     1.1 --- a/makesd	Mon May 27 23:58:01 2019 +0200
     1.2 +++ b/makesd	Tue May 28 00:01:48 2019 +0200
     1.3 @@ -92,13 +92,15 @@
     1.4  
     1.5  # Use the options to generate a partition summary.
     1.6  
     1.7 - "$PARTSUMMARY" $ARGS \
     1.8 +  "$PARTSUMMARY" $ARGS \
     1.9  > "$SUMMARY"
    1.10  
    1.11 -# Partition the given device.
    1.12 +# Partition the given device, passing only partition details to the script.
    1.13  
    1.14 -"$PARTITION" $ALIGN_CYLINDER < "$SUMMARY"
    1.15 +  cut -f 1,2,3 "$SUMMARY" \
    1.16 +| "$PARTITION" $ALIGN_CYLINDER
    1.17  
    1.18 -# Format the given device.
    1.19 +# Format the given device, passing only partition types to the script.
    1.20  
    1.21 -"$FORMAT" < "$SUMMARY"
    1.22 +  cut -f 3 "$SUMMARY" \
    1.23 +| "$FORMAT"
     2.1 --- a/makesd-format	Mon May 27 23:58:01 2019 +0200
     2.2 +++ b/makesd-format	Tue May 28 00:01:48 2019 +0200
     2.3 @@ -62,14 +62,9 @@
     2.4      cat 1>&2 <<EOF
     2.5  Usage: $PROGNAME
     2.6  
     2.7 -The input for this program is supplied via standard input as a partitioning
     2.8 -summary with each line providing a collection of tab-separated values. These
     2.9 -values appear in the following order:
    2.10 -
    2.11 -<start> <size> <type>
    2.12 -
    2.13 -Only the type value is employed by this program. Types recognised include ext,
    2.14 -ext2, ext3, ext4, fat and swap.
    2.15 +The input for this program is supplied via standard input as a list of partition
    2.16 +types, one per line. Types recognised include ext, ext2, ext3, ext4, fat and
    2.17 +swap.
    2.18  EOF
    2.19      exit 0
    2.20  fi
    2.21 @@ -78,9 +73,11 @@
    2.22  
    2.23  check_device
    2.24  
    2.25 +# Read partition types, one per line.
    2.26 +
    2.27  PARTNUM=1
    2.28  
    2.29 -while read_fields ; do
    2.30 +while read TYPE ; do
    2.31      DEVICE="${DEV}${PARTNUM}"
    2.32      format "$DEVICE" "$TYPE"
    2.33      PARTNUM=$(($PARTNUM + 1))