1.1 --- a/makesd-partition-table Tue May 28 00:30:18 2019 +0200
1.2 +++ b/makesd-partition-table Mon Jun 10 01:37:46 2019 +0200
1.3 @@ -202,11 +202,12 @@
1.4 Produce partition descriptions, indicating partition type, start position and
1.5 size for each partition.
1.6
1.7 -The input for this program is supplied via standard input as a partitioning
1.8 -summary with each line providing a collection of tab-separated values. These
1.9 -values appear in the following order:
1.10 +The input for this program is supplied via standard input as partition
1.11 +definitions employing the following pertinent properties:
1.12
1.13 -<start> <size> <type>
1.14 +position: <start>
1.15 +size: <size>
1.16 +type: <type>
1.17
1.18 Start positions are indicated as numbers of 512-byte sectors.
1.19
1.20 @@ -235,9 +236,34 @@
1.21
1.22 # Read and emit partition details.
1.23
1.24 -while read_fields ; do
1.25 +SECTION=
1.26 +
1.27 +while read LINE ; do
1.28 +
1.29 + if [ "$LINE" ] && [ ! "$SECTION" ] ; then
1.30 + SECTION=$LINE
1.31 +
1.32 + elif [ ! "$LINE" ] ; then
1.33 + SECTION=
1.34 + next_partition
1.35 +
1.36 + elif [ "$SECTION" ] ; then
1.37 + FIELD=`get_field "$LINE"`
1.38 + VALUE=`get_value "$LINE"`
1.39 +
1.40 + case "$FIELD" in
1.41 + ( 'position' ) set_value "START" "$VALUE" ;;
1.42 + ( 'size' ) set_value "SIZE" "$VALUE" ;;
1.43 + ( 'type' ) set_value "TYPE" "$VALUE" ;;
1.44 + esac
1.45 + fi
1.46 +done
1.47 +
1.48 +# Finish any open section.
1.49 +
1.50 +if [ "$SECTION" ] ; then
1.51 next_partition
1.52 -done
1.53 +fi
1.54
1.55 # Emit the last partition.
1.56