From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id eDSsC8AsVl8fEQAA0tVLHw (envelope-from ) for ; Mon, 07 Sep 2020 12:51:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yKWoB8AsVl+tBgAAB5/wlQ (envelope-from ) for ; Mon, 07 Sep 2020 12:51:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8955A94071A for ; Mon, 7 Sep 2020 12:51:11 +0000 (UTC) Received: from localhost ([::1]:47562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFGc1-0007Kt-LD for larch@yhetil.org; Mon, 07 Sep 2020 08:51:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFGbt-0007I1-Tm for guix-patches@gnu.org; Mon, 07 Sep 2020 08:51:01 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFGbt-00041X-KA for guix-patches@gnu.org; Mon, 07 Sep 2020 08:51:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kFGbt-0007PC-Jq for guix-patches@gnu.org; Mon, 07 Sep 2020 08:51:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43219] [PATCH] gnu: Handle nfs-root device strings. Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Sep 2020 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43219 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 43219@debbugs.gnu.org Received: via spool by 43219-submit@debbugs.gnu.org id=B43219.159948301928418 (code B ref 43219); Mon, 07 Sep 2020 12:51:01 +0000 Received: (at 43219) by debbugs.gnu.org; 7 Sep 2020 12:50:19 +0000 Received: from localhost ([127.0.0.1]:48367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFGbD-0007OH-B9 for submit@debbugs.gnu.org; Mon, 07 Sep 2020 08:50:19 -0400 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:19412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFGbB-0007O3-E0 for 43219@debbugs.gnu.org; Mon, 07 Sep 2020 08:50:18 -0400 Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 5576259D21B; Mon, 7 Sep 2020 12:50:11 +0000 (UTC) Received: from macbook-pro.kuh-wiese.my-router.de (unknown [178.5.77.113]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id EB152539A12; Mon, 7 Sep 2020 12:50:06 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Stefan In-Reply-To: <20200907110552.0bdef27e@scratchpost.org> Date: Mon, 7 Sep 2020 14:50:05 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <6354A850-CD6B-43EC-8DFA-3B1F172C935B@vodafonemail.de> References: <4D0B1280-3FB5-48E5-B985-24773F966618@vodafonemail.de> <20200907110552.0bdef27e@scratchpost.org> X-Mailer: Apple Mail (2.3124) X-VADE-STATUS: LEGIT X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: MdCYo+PzUlmi Hi Danny! >> * gnu/bootloader/grub.scm (grub-root-search): Suppor nfs-root device = strings to >> set the root to tftp. >=20 > Why does having a NFS root "device" imply using TFTP? >=20 > I can see that it would be nice--but I've been using NFS for many = years without > using TFTP. True.=20 If you use an NFS share as the root file system, it=E2=80=99s 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: =E2=80=A2 PXE specifies TFTP but seems not to specify HTTP. =E2=80=A2 The =E2=80=98file=E2=80=99 field inside the DHCP header = implies TFTP. =E2=80=A2 For BOOTP/DHCPv4 the RFC 2132 defines a TFTP server for = option 66. =E2=80=A2 U-Boot supports TFTP but not HTTP (important for = chain-loading). =E2=80=A2 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 =E2=80=98http://=E2=80=99 but also = allows =E2=80=98tftp://=E2=80=99.=20 >> + ((? (lambda (device) >> + (and (string? device) (string-contains device ":/"))) = nfs-uri) >> + "set root=3D(tftp)") >=20 > 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: = . However, searching for files is not possible via TFTP, so with =E2=80=9Cse= t root=3D(tftp)=E2=80=9D we specify not to search for the file, but to = assume that it is accessible via TFTP. Beside a =E2=80=9Cset = root=3D(http)=E2=80=9D 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 =E2=80=98(tftp)=E2=80=99 or even =E2=80=98(http)=E2=80=99 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 =E2=80=98search =E2=80=94file=E2=80=99= command, if it does not produce an error. I=E2=80=99ll check that.=20 > Pushed all the other hunks except for the one above--for now. >=20 > Guix master commit 1c3b709edb8e6248a9a84dde57b27f3fdc997f21. Thanks. Bye Stefan