Ubuntu Raspberry Pi: Change partitioning script

The partition script for sfdisk does not need another layer of
indirection.  Instead of being a shell script that writes an sfdisk
script, it is now just an sfdisk script directly.  The shell variables
are interpolated by the heredoc anyway.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
This commit is contained in:
Richard Laager
2021-10-30 00:08:41 -05:00
parent aba81046fa
commit cc0dbd6105

View File

@@ -129,22 +129,16 @@ be deleted.
The important numbers are 524288 and 6052348. Store those in variables:: The important numbers are 524288 and 6052348. Store those in variables::
export BOOT=524288 BOOT=524288
export ROOT=6052348 ROOT=6052348
#. Create a partition script:: #. Create a partition script::
vi partitions.sh cat > partitions << EOF
with the following contents:
.. code-block:: sh
cat << EOF
label: dos label: dos
unit: sectors unit: sectors
1 : start= 2048, size=$BOOT, type=c, bootable 1 : start= 2048, size=$BOOT, type=c, bootable
2 : start=$((2048+BOOT)), size=$ROOT, type=83 2 : start=$((2048+BOOT)), size=$ROOT, type=83
3 : start=$((2048+BOOT+ROOT)), size=$ROOT, type=83 3 : start=$((2048+BOOT+ROOT)), size=$ROOT, type=83
EOF EOF
@@ -187,7 +181,7 @@ be deleted.
#. Create the partitions:: #. Create the partitions::
sh -u partitions.sh | sudo sfdisk $DISK sudo sfdisk $DISK < partitions
#. Loopback mount the image:: #. Loopback mount the image::