unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan <stefan-guix@vodafonemail.de>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: 43219@debbugs.gnu.org
Subject: [bug#43219] [PATCH] gnu: Handle nfs-root device strings.
Date: Mon, 7 Sep 2020 14:50:05 +0200	[thread overview]
Message-ID: <6354A850-CD6B-43EC-8DFA-3B1F172C935B@vodafonemail.de> (raw)
In-Reply-To: <20200907110552.0bdef27e@scratchpost.org>

Hi Danny!

>> * gnu/bootloader/grub.scm (grub-root-search): Suppor nfs-root device strings to
>> set the root to tftp.
> 
> Why does having a NFS root "device" imply using TFTP?
> 
> I can see that it would be nice--but I've been using NFS for many years without
> using TFTP.

True. 

If you use an NFS share as the root file system, it’s just very likely that you use a diskless setup.

It is uncommon, that you have some storage device, from which you load the kernel and the initrd, but which is not also your root file system device. Usually the kernel and the initrd are located in the root file system.

But take a closer look at (grub-root-search device file): This function gets a device record or device string, which is expected to contain the file to look for.

If that device string is an NFS share, then GRUB has only two possibilities to access that file: either via TFTP or HTTP. Actually there is no way yet to divide between these two possibilities.

GRUB does not support NFS, and the chance that the searched file on the NFS share is accessible on a local storage as well is very low.

I chose TFTP over HTTP because of this reasons:

 • PXE specifies TFTP but seems not to specify HTTP.
 • The ‘file’ field inside the DHCP header implies TFTP.
 • For BOOTP/DHCPv4 the RFC 2132 defines a TFTP server for option 66.
 • U-Boot supports TFTP but not HTTP (important for chain-loading).
 • The Raspberry Pi only supports TFTP.

Only with DHCPv6 there is RFC 5970, which specifies option 59 to contain a boot-file-url, which may start with ‘http://’ but also allows ‘tftp://’. 

>> +        ((? (lambda (device)
>> +              (and (string? device) (string-contains device ":/"))) nfs-uri)
>> +         "set root=(tftp)")
> 
> What is that required for in practice?

As stated above, (grub-root-search device file) is used to find the device from which to load the file. It normally generates a GRUB search command to specify inside the root variable where to find that file. That the root variable gets set is not obvious from the generated search command. But take a look here, it is the default: <https://www.gnu.org/software/grub/manual/grub/grub.html#search>.

However, searching for files is not possible via TFTP, so with “set root=(tftp)” we specify not to search for the file, but to assume that it is accessible via TFTP. Beside a “set root=(http)” this is the only way to specify the root, if the device is an NFS share.

However, the grub.cfg is loaded via TFTP as well, so root must be preset to ‘(tftp)’ or even ‘(http)’ due to DHCP options. So omitting the search command could be enough and even allow the use of HTTP.

It could also be possible to keep the ‘search —file’ command, if it does not produce an error.

I’ll check that. 

> Pushed all the other hunks except for the one above--for now.
> 
> Guix master commit 1c3b709edb8e6248a9a84dde57b27f3fdc997f21.

Thanks.


Bye

Stefan





  reply	other threads:[~2020-09-07 12:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1A001E6C-A2C2-4364-B40D-C88059941CDF@vodafonemail.de>
2020-09-05 11:26 ` [bug#43219] [PATCH] gnu: Handle nfs-root device strings Stefan
2020-09-06 11:52   ` Stefan
2020-09-06 12:21     ` Danny Milosavljevic
2020-09-07  9:05   ` Danny Milosavljevic
2020-09-07 12:50     ` Stefan [this message]
2020-09-07 18:44       ` Stefan
2020-09-07 13:33     ` Danny Milosavljevic
2020-09-13 18:30     ` Stefan
2020-10-05  8:40       ` Ludovic Courtès
2020-10-05 16:31         ` bug#43219: " Stefan
2020-09-07  9:32   ` [bug#43219] Fwd: " Stefan

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=6354A850-CD6B-43EC-8DFA-3B1F172C935B@vodafonemail.de \
    --to=stefan-guix@vodafonemail.de \
    --cc=43219@debbugs.gnu.org \
    --cc=dannym@scratchpost.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).