On Tue, Jun 15, 2021 at 12:19:51PM +0300, Anatoly Pugachev wrote: > On Tue, Jun 15, 2021 at 12:07 AM Alyssa Ross <hi@xxxxxxxxx> wrote: > > > > On Mon, Jun 14, 2021 at 08:40:17PM +0000, Alyssa Ross wrote: > > > In a script, I wanted to look up the device node for the booted EFI > > > partition. systemd-boot exposes this in an EFI variable but it's > > > uppercase, so when I tried to do this, it didn't work: > > > > > > findfs "(< /sys/firmware/efi/vars/LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440)" > > > > Bogus command here, sorry. It should have been: > > > > findfs PARTUUID="$(cat /sys/firmware/efi/vars/LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f/data)" > > > > But my point stands. :) > > probably could use a pipe after cat, like: > > cat ... | tr [:lower:] [:upper:] > > or patch util-linux docs, to implicitly state that comparison is done > with upper case letters (UUID)... Not sure which way is better > (including your patch). There is no guaranty that the UUID will be the upper or lower case although in fstab.5 and mount.8 man pages we have "should be based on lower case characters". libblkid itself does not modify UUID/PARTUUID when reading it from the filesystem. It depends on FS-specific prober in the library or in some cases on the filesystem superblock if UUID is stored as a string there. And it's also important to support 3rd party UUID from another source as you can write whatever to your udev rules and use others tools to get UUIDs. So, I think your request to compare UUIDs in a case-insensitive way makes sense. The library should be smart enough to accept whatever. I'll think about it and try to improve the current situation. Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com