gardenlinux / builder

Builder used to construct Garden Linux. Re-usable for other OS-projects.
Apache License 2.0
9 stars 2 forks source link

Filter for partition label is too strict #98

Open fwiesel opened 1 month ago

fwiesel commented 1 month ago

What happened:

systemd-sysupdate encodes in the partition name the version of the OS. The UEFI standard specifies the PartitionName as a null-terminated human readable string of up to 72 characters.

GardenLinux versioning is <MAJOR>.<MINOR> So, a sensible partition name could be garden_<MAJOR>.<MINOR>, but if I modify the label from ROOT to that, I end up with no partition label.

$ fdisk -l -o TYPE-UUID,NAME  output/vmware-orabos-amd64-1645.0-local.raw
Disk output/vmware-orabos-amd64-1645.0-local.raw: 2.65 GiB, 2850029568 bytes, 5566464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 548A386F-7E35-E144-EDCC-434F72C026F9

Type-UUID                            Name
C12A7328-F81F-11D2-BA4B-00A0C93EC93B EFI
4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709

What you expected to happen:

$ fdisk -l -o TYPE-UUID,NAME  output/vmware-orabos-amd64-1645.0-local.raw
Disk output/vmware-orabos-amd64-1645.0-local.raw: 2.65 GiB, 2850029568 bytes, 5566464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 548A386F-7E35-E144-EDCC-434F72C026F9

Type-UUID                            Name
C12A7328-F81F-11D2-BA4B-00A0C93EC93B EFI
4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 garden_1645.0

How to reproduce it (as minimally and precisely as possible):

Use the following fstab.mod:

# fstab.mod
set -Eeuo pipefail

currentfstab="$(cat)"

if [ -n "$currentfstab" ]; then
# Expand the UEFI partition and do not create a /usr partition (for now)
sed \
-e'/type=uefi/ s/$/,size=511M/' \
-e 's/LABEL=ROOT/LABEL=garden_'$BUILDER_VERSION'/' \
<<< "$currentfstab"
fi

Anything else we need to know:

Environment: