[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can (grub-configuration (device $DEV)) accept UUIDs?

From: dian_cecht
Subject: Re: Can (grub-configuration (device $DEV)) accept UUIDs?
Date: Mon, 6 Mar 2017 11:10:22 -0800

On Mon, 06 Mar 2017 17:19:21 +0100
address@hidden (Ludovic Courtès) wrote:
> Unfortunately it can’t, because there are no UUIDs (that I know of) to
> identify drives.
> However, as the manual vaguely suggests (too vaguely I admit), you can
> use a GRUB device identifier such as “(hd0)”.  This is stable across
> reboot, AIUI.  I’ve never tried it but if you can confirm that it
> works this way, we could/should update the documentation to propose
> that.

How about a (maybe better) option; if (grub-configuration ...) is
passed something like (uuid "$UUID"), instead of simply passing this
directly to grub-install (or whatever is used), guix /could/ take the
UUID, check what drive the UUID points to, then pass the related
arguement to GRUB. It would be a reasonably fix for what I'd assume is
a bug/missing feature in GRUB.

In my quick searching, apparently blkid can accept '-t', which lets you
search for a drive by label, uuid, or (the manpage doesn't state this)

I don't know Guile nor Guix so I can't submit a patch, but what I
think /should/ work is, if grub-configuration is called with a UUID,
the UUID is passed to blkid[0] (probably checking both UUID[1] and
UUID_SUB[2]), and the output checked for a valid drive (in the form,
I'd expect, of /dev/sda or similar), cleaned up, then that is passed
to grub-configuration.

Someone with better knowledge of Guile, Guix, and Linux can probably
expand on this (or figure out how it might be broken), but it should be
a start for adding this feature.

[0]. According to blkid, it's simply an interface to libblkid, so
maybe a FFI call (or several) would be better here than just calling the
CLI program?
[1]. RAID members will share a UUID, so simply relying on that isn't
[2]. UUID_SUB is the actual UUID of the underlying drive (apparently),
and should probably be used when someone it trying to install GRUB,
otherwise you could end up with multiple RAID members as output, and
then I can only see things becoming hard[3].
[3]. Like trying to decide which drive the sysadmin meant, or if they
meant all of them, or if they passed the wrong UUID(_SUB) in the system

reply via email to

[Prev in Thread] Current Thread [Next in Thread]