# HG changeset patch # User Paul Boddie # Date 1558799307 -7200 # Node ID 358363607059991f597f45605b4ee7daaad4ac1a # Parent 173b637752348e667cda13912db103e371a65f9a Introduced a common function for testing for the cylinder alignment option. Propagate the option explicitly in the scripts. diff -r 173b63775234 -r 358363607059 makesd-common --- a/makesd-common Sat May 25 17:47:08 2019 +0200 +++ b/makesd-common Sat May 25 17:48:27 2019 +0200 @@ -31,3 +31,18 @@ IFS=$OLDIFS return $STATUS } + +# test_align_cylinder +# +# Test for the cylinder alignment option. + +test_align_cylinder() +{ + if [ "$1" = '--align' ] ; then + ALIGN_CYLINDER="$1" + return 0 + else + ALIGN_CYLINDER= + return 1 + fi +} diff -r 173b63775234 -r 358363607059 makesd-partition --- a/makesd-partition Sat May 25 17:47:08 2019 +0200 +++ b/makesd-partition Sat May 25 17:48:27 2019 +0200 @@ -36,6 +36,10 @@ check_device +# Test for the cylinder alignment option. + +if test_align_cylinder $* ; then shift 1 ; fi + # Initialise sfdisk usage. init_sfdisk "$DEV" @@ -43,5 +47,5 @@ # Convert the partitioning summary into a partition table description. # Present the table to sfdisk. - "$PARTTABLE" $* \ + "$PARTTABLE" $ALIGN_CYLINDER \ | "$SFDISK" $SFDISK_OPTIONS "$DEV" diff -r 173b63775234 -r 358363607059 makesd-partition-table --- a/makesd-partition-table Sat May 25 17:47:08 2019 +0200 +++ b/makesd-partition-table Sat May 25 17:48:27 2019 +0200 @@ -205,12 +205,7 @@ # Test for the cylinder alignment option. -if [ "$1" = '--align' ] ; then - ALIGN_CYLINDER="$1" - shift 1 -else - ALIGN_CYLINDER= -fi +if test_align_cylinder $* ; then shift 1 ; fi # Obtain details of the selected device.