From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KOGYEnKx4V7GCAAA0tVLHw (envelope-from ) for ; Thu, 11 Jun 2020 04:22:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4N9KDnKx4V60HAAAbx9fmQ (envelope-from ) for ; Thu, 11 Jun 2020 04:22:10 +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 B1BE09400D3 for ; Thu, 11 Jun 2020 04:22:09 +0000 (UTC) Received: from localhost ([::1]:38506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjEjA-0004qS-BR for larch@yhetil.org; Thu, 11 Jun 2020 00:22:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjEj4-0004q6-1z for guix-patches@gnu.org; Thu, 11 Jun 2020 00:22:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jjEj3-0007p2-Oz for guix-patches@gnu.org; Thu, 11 Jun 2020 00:22:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jjEj3-0000A3-K6 for guix-patches@gnu.org; Thu, 11 Jun 2020 00:22:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Jun 2020 04:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41011 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: Stefan , 41011@debbugs.gnu.org Received: via spool by 41011-submit@debbugs.gnu.org id=B41011.1591849280567 (code B ref 41011); Thu, 11 Jun 2020 04:22:01 +0000 Received: (at 41011) by debbugs.gnu.org; 11 Jun 2020 04:21:20 +0000 Received: from localhost ([127.0.0.1]:35767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjEiO-000094-E1 for submit@debbugs.gnu.org; Thu, 11 Jun 2020 00:21:20 -0400 Received: from mail-qv1-f66.google.com ([209.85.219.66]:45208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jjEiM-00008q-8C for 41011@debbugs.gnu.org; Thu, 11 Jun 2020 00:21:19 -0400 Received: by mail-qv1-f66.google.com with SMTP id di13so2093781qvb.12 for <41011@debbugs.gnu.org>; Wed, 10 Jun 2020 21:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=nHxE/uxiUPpq30Z+2+erb4DZKoloHm0/+s6fRvq/f+E=; b=jsYA7nfjCIHw4ZhaRKbdKbMZBiVprJsvKHcDXyGToHkDkVjQWOM5AcxRBDboLV25eM NdtBtA1jd112KGSeCCvhQhFMGLszlW1OD7haXV4MhUr+jMb/1/QNYoKiNrvf/g95/zsV F/augQEgG/gS+o2wpmvHGc8f+l1xXQp2GzsraFsbHeGO3v4KfTWJtUW44snXqcdYhkSV RlK1ELe0MOXxWbIps8I/59AXQdpOSXD7nEYaziu1bPDmeqXAKdrchvEr/rQNaqLrQGXi fHPsqpJ74QAmu2k5HDIF9QKxFBYMDjPCei6iqwJ7DRKigf05+gOGKkU99UDq8O+rfEsu 7hnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=nHxE/uxiUPpq30Z+2+erb4DZKoloHm0/+s6fRvq/f+E=; b=lwWCKJO0XyJWqHoX5TifDXY5r1WSnpuRE5khY9yEluFjTiJ0Rwvoxuxo++nWjJaTl9 5R5K1w/0xXpIKZXM9NTKudA5dVN1Y0g0K9ZpesPf4+mYG1UzmfoVkWhqRoT8xyKqNBB/ hpK0enNsspJik6o/a1JVa4Fdm8MwjVIKnbPLpccpqn7chC6OOH1+Pe1qjSPcKjB6slFP +U5sNJZN37Cn7xY6kJXdvjej2J4RsRuGGBMfwykwwV6hmlFOUstq0IGoH1VKhgXsGNnL DvtGFYiWQolE3ynsxe/S7j08jYguJcUoMRuKpX1qhtONSHRWG2H/F9XmvM2Kko7bLKDJ 6s9A== X-Gm-Message-State: AOAM5307fGjq2b097Y95YQLr2aeJnej40nbLbeaoWvVaNuDM1BeZiUba s4KVYSk2OVMEoGLYEnq3F36wgPZ2uvM= X-Google-Smtp-Source: ABdhPJxYAhLKHR3RvWGVUYRXBNMkn0VmoJvkzIlrsPecBBjnz0D8lHCakaGgjjJZ82FMc6Xq71OSVg== X-Received: by 2002:ad4:556e:: with SMTP id w14mr6173232qvy.137.1591849272479; Wed, 10 Jun 2020 21:21:12 -0700 (PDT) Received: from hurd (dsl-10-134-63.b2b2c.ca. [72.10.134.63]) by smtp.gmail.com with ESMTPSA id q24sm1455777qkj.103.2020.06.10.21.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 21:21:11 -0700 (PDT) From: Maxim Cournoyer References: <9AAFEFF4-8ACE-4C95-975F-67C3F4FDAF81@vodafonemail.de> <87a72gi4kz.fsf@gmail.com> <1179D890-7D6C-43D8-A286-DA7A0F61D585@vodafonemail.de> <87h7w7cc55.fsf@gnu.org> <92DB8E2B-1CA2-41AE-9265-53C4F5337686@vodafonemail.de> <20200606193721.1e126131@scratchpost.org> <46CD97B3-9994-4AB7-AA7D-4DE39AB7A238@vodafonemail.de> <20200609154400.4c7d2f90@scratchpost.org> Date: Thu, 11 Jun 2020 00:21:11 -0400 In-Reply-To: <20200609154400.4c7d2f90@scratchpost.org> (Danny Milosavljevic's message of "Tue, 9 Jun 2020 15:44:00 +0200") Message-ID: <87bllqi66g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=jsYA7nfj; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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.09 X-TUID: Ok4G31yEndVM Hello Danny, Danny Milosavljevic writes: > Hi Stefan, > > On Tue, 9 Jun 2020 14:16:18 +0200 > Stefan wrote: > >> I made your requested change (using ), but when trying a 'gui= x system reconfigure =E2=80=A6' I only get this error: >>=20 >> guix system: error: #: invalid G-expr= ession input >>=20 >> There is no backtrace, no nothing. I can=E2=80=99t figure out, which par= t of the code tries to read this serialisation. Do you have a clue? > > I think it's a problem in the transfer of the record from host side to bu= ild > side, in this case mostly via Linux kernel command line arguments, which = are > strings. > > The host side code can use these records, but eventually the build side c= ode > has to get a string and reconstruct it. > > I don't know how to debug it except for running the translation in my hea= d. > The error reporting facility could be improved a lot :( > > gnu/build/linux-boot.scm is build side. It runs when the system boots. > > In there it has=20 > > (define (device-string->file-system-device device-string) > ;; The "--root=3DSPEC" kernel command-line option always provides a > ;; string, but the string can represent a device, a UUID, a > ;; label or a NFS spec. So check for all three. > (cond ((string-prefix? "/" device-string) device-string) > ((uuid device-string) =3D> identity) > (else (file-system-label device-string)))) > > But looking at the condition (uuid device-string) I have no idea what tha= t means, > or is bound to! It means that if the device-string (a string as its name imply) contains something that represent a UUID, return its corresponding UUID object. `uuid' comes from (gnu system uuid). Does that answer your question? > It was introduced by: > > commit 281d80d8e547fe663aaacb3226119166dd3100f9 > Author: Maxim Cournoyer > Date: Tue Feb 11 14:00:06 2020 -0500 > > linux-boot: Refactor boot-system. >=20=20=20=20=20 > The --root option can now be omitted, and inferred from the root file= system > declaration instead. >=20=20=20=20=20 > * gnu/build/file-systems.scm (canonicalize-device-spec): Extend to su= pport NFS > directly, and... > * gnu/build/linux-boot.scm (boot-system): ...remove NFS special casin= g from > here. Remove nested definitions for root-fs-type, root-fs-flags and > root-fs-options, and bind those inside the let* instead. Make "--roo= t" take > precedence over the device field string representation of the root fi= le > system. > * doc/guix.texi (Initial RAM Disk): Document that "--root" can be left > unspecified. > > If "--root" is not specified, it should then pick up the root from the ro= ot > file system declaration.=20 > > @Maxim: How can we use your commit to boot from NFS? I see no way to lea= ve > "--root" off in the first place for a regular user. (Stefan's patch adds > support for network boot via tftp/nfs via grub efi net)=20 This commit just makes it so that if --root was ever removed from the generated GRUB configuration, it'd still be able to find it automatically. It was added to be consistent with the fact that mount options are automatically taken from the root file system without any user option (and I initially had a rootflags user option but this was deemed unnecessary at the time). I'll probably add it back soon now that I've found a valid use case for it (passing the 'degraded' mount option for booting from a degraded Btrfs RAID is one). Does it cause a problem for the NFS boot via 'grub efi net' (I know nothing about it -- any link for a recommended reading?) When booting from NFS using the nfsroot Linux option, it's possible to specify a '/dev/nfs' as the root kernel parameter. /dev/nfs is not a real block device, it's just a stub hinting the kernel that its root file system is on NFS. Perhaps that can be used? Maxim