[PATCH v2 2/6] scripts/make-gpt.sh: add support for labels

Alyssa Ross
2022-10-10T23:33:11Z

The label parameter is placed after the UUID one, because it doesn't
always make sense to specify a label, but specifying a UUID should
really be mandatory to ensure reproducible builds.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
scripts/make-gpt.sh | 4 ++--
scripts/sfdisk-field.awk | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/make-gpt.sh b/scripts/make-gpt.sh
index 56076d3..e6c3b37 100755
--- a/scripts/make-gpt.sh
+++ b/scripts/make-gpt.sh
@@ -3,7 +3,7 @@
# SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is>
# SPDX-License-Identifier: EUPL-1.2+
#
-# usage: make-gpt.sh GPT_PATH PATH:PARTTYPE[:PARTUUID]...
+# usage: make-gpt.sh GPT_PATH PATH:PARTTYPE[:PARTUUID[:PARTLABEL]]...

ONE_MiB=1048576
TWO_MiB=2097152
@@ -26,7 +26,7 @@ fillPartition() {
dd if="$3" of="$1" seek="$start" count="$size" conv=notrunc)
}

-# Prints the partition path from a PATH:PARTTYPE[:PARTUUID] string.
+# Prints the partition path from a PATH:PARTTYPE[:PARTUUID[:PARTLABEL]] string.
partitionPath() {
awk -F: '{print $1}' <<EOF
$1
diff --git a/scripts/sfdisk-field.awk b/scripts/sfdisk-field.awk
index b9fa457..0157027 100644
--- a/scripts/sfdisk-field.awk
+++ b/scripts/sfdisk-field.awk
@@ -9,7 +9,7 @@ BEGIN {
# first field.
skip=1

- split("type uuid", keys)
+ split("type uuid name", keys)
split(partition, fields, ":")

for (n in fields) {
--
2.37.1