unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: <dian_cecht@zoho.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Can (grub-configuration (device $DEV)) accept UUIDs?
Date: Mon, 6 Mar 2017 11:10:22 -0800	[thread overview]
Message-ID: <20170306111022.54755a03@khaalida> (raw)
In-Reply-To: <87varmped2.fsf@gnu.org>

On Mon, 06 Mar 2017 17:19:21 +0100
ludo@gnu.org (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)
uuid_sub.

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
practical.
[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
config...

      reply	other threads:[~2017-03-06 19:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-26  9:54 Can (grub-configuration (device $DEV)) accept UUIDs? dian_cecht
2017-03-06 16:19 ` Ludovic Courtès
2017-03-06 19:10   ` dian_cecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306111022.54755a03@khaalida \
    --to=dian_cecht@zoho.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).