# HG changeset patch # User Paul Boddie # Date 1558801240 -7200 # Node ID 781f2c4f4724bf400931d42949c1146195106a20 # Parent 8c2e5d04586091a4eb4a9f69e0a3af3b91a3cb62 Added help messages and moved the alignment description into a common function. diff -r 8c2e5d045860 -r 781f2c4f4724 makesd --- a/makesd Sat May 25 17:48:54 2019 +0200 +++ b/makesd Sat May 25 18:20:40 2019 +0200 @@ -1,6 +1,6 @@ #!/bin/sh -# Prepare a disk for booting a hardware device. +# Prepare a disk for booting a specific hardware device. PROGNAME=`basename "$0"` THISDIR=`dirname "$0"` @@ -15,6 +15,22 @@ +# Emit the help message if requested. + +if [ "$1" = '--help' ] ; then + cat 1>&2 < + +Partition, format, populate and initialise a device for use with a particular +kind of hardware. The given definition name is used to search the database of +supported hardware devices and to configure the different preparation +activities. + +$(align_cylinder_description) +EOF + exit 0 +fi + # Obtain details of the selected device. check_device diff -r 8c2e5d045860 -r 781f2c4f4724 makesd-common --- a/makesd-common Sat May 25 17:48:54 2019 +0200 +++ b/makesd-common Sat May 25 18:20:40 2019 +0200 @@ -46,3 +46,12 @@ return 1 fi } + +align_cylinder_description() +{ + cat <&2 < + +Only the type value is employed by this program. Types recognised include ext, +ext2, ext3, ext4, fat and swap. +EOF + exit 0 +fi + # Obtain details of the selected device. check_device diff -r 8c2e5d045860 -r 781f2c4f4724 makesd-partition --- a/makesd-partition Sat May 25 17:48:54 2019 +0200 +++ b/makesd-partition Sat May 25 18:20:40 2019 +0200 @@ -32,6 +32,22 @@ +# Emit the help message if requested. + +if [ "$1" = '--help' ] ; then + cat 1>&2 <&2 < | -p | -s )... +Usage: $PROGNAME [ --align ] Produce partition descriptions, indicating partition type, start position and -size for each partition. Each occurrence of the -f option starts a new partition -description. +size for each partition. + +The input for this program is supplied via standard input as a partitioning +summary with each line providing a collection of tab-separated values. These +values appear in the following order: + + Start positions are indicated as numbers of 512-byte sectors. @@ -196,9 +201,7 @@ Types recognised include ext, ext2, ext3, ext4, fat and swap. Other types are interpreted as Linux partitions. -If the --align option is specified, align partitions to cylinders for the -satisfaction of earlier sfdisk versions that are obsessed with cylinders, heads -and sectors. +$(align_cylinder_description) EOF exit 0 fi