On Di, 25.03.25 16:53, Thayne Harbaugh (tha...@mastodonlabs.com) wrote:

> Greetings,
>
> systemd-repart MountPoint fails to generate a correct fstab entry for
> esp partitions.  It generates a standard partition UUID which does not
> work for FAT file systems - a FAT volume ID must be used analogous to
> what is generated for vfat in mkfs-util.c:make_filesystem().  The FAT
> volume ID is in the form of 32 bits of uppercase hex digits with a
> dash "-" between the high and low 16 bits: XXXX-XXXX (where X
> represents an uppercase hex digit).
>
> Attached is a patch I have been using with systemd v257 to provide
> correct behavior.

> Use the PARTUUID to mount ESP partitions
>
> The ESP vfat partition fails to mount because the UUID generated by repart
> matches neither the vfat serial number (although it's somewhat comparable) nor
> the partition UUID.  The vfat serial number is quite short compared to a UUID
> and may not be sufficiently long for use in mounting.  This generates the 
> fstab
> entry for the ESP partition as a FAT volume ID in the form of XXXX-XXXX where 
> X
> is an uppercase hex digit.

Could you please submit this as Github PR? we can do reviews much
better there.

> +                        what = strjoin("UUID=",
> SD_ID128_TO_FATUUID_STRING(p->fs_uuid));

SD_ID128_TO_FATUUID_STRING should not be public api (but the SD_
prefix is for public apis only). just add this as local helper.

Also, this should be conditioned on the fstype (i.e. p->format), not
the partition type uuid, since it really applies to all fat
partitions, not just esps. (xbootldr for example needs the same).

Lennart

--
Lennart Poettering, Berlin

Reply via email to