summary refs log tree commit diff
path: root/scripts/sfdisk-field.awk
blob: 0157027070072c2145b63af3f27d0066b6167279 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/awk -f
#
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>

BEGIN {
	# Field #1 is the partition path, which make-gpt.sh will turn into
	# the size field.  Since it's handled elsewhere, we skip that
	# first field.
	skip=1

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

	for (n in fields) {
		if (n <= skip)
			continue
		printf "%s=%s,", keys[n - skip], fields[n]
	}
}