From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id GOVYGA9pb19SPAAA0tVLHw (envelope-from ) for ; Sat, 26 Sep 2020 16:15:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6G0dFA9pb1+vSQAA1q6Kng (envelope-from ) for ; Sat, 26 Sep 2020 16:15:11 +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 E2A3394023C for ; Sat, 26 Sep 2020 16:15:10 +0000 (UTC) Received: from localhost ([::1]:58898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMCqr-0006pb-VM for larch@yhetil.org; Sat, 26 Sep 2020 12:15:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMCqk-0006pH-Dr for guix-patches@gnu.org; Sat, 26 Sep 2020 12:15:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMCqk-00062j-43 for guix-patches@gnu.org; Sat, 26 Sep 2020 12:15:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kMCqj-0008Hz-Vm for guix-patches@gnu.org; Sat, 26 Sep 2020 12:15:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41011] [PATCH] gnu: grub: Support for network boot via TFTP. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 26 Sep 2020 16:15: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: Stefan Cc: 41011@debbugs.gnu.org, Efraim Flashner Received: via spool by 41011-submit@debbugs.gnu.org id=B41011.160113689431834 (code B ref 41011); Sat, 26 Sep 2020 16:15:01 +0000 Received: (at 41011) by debbugs.gnu.org; 26 Sep 2020 16:14:54 +0000 Received: from localhost ([127.0.0.1]:47652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMCqb-0008HO-UR for submit@debbugs.gnu.org; Sat, 26 Sep 2020 12:14:54 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:57600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kMCqZ-0008HF-O5 for 41011@debbugs.gnu.org; Sat, 26 Sep 2020 12:14:52 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id E719833683FD; Sat, 26 Sep 2020 18:14:49 +0200 (CEST) Date: Sat, 26 Sep 2020 18:13:57 +0200 From: Danny Milosavljevic Message-ID: <20200926181357.1aa2faa4@scratchpost.org> In-Reply-To: <066A5D57-B0B1-4FF4-B07B-1A5030AA789F@vodafonemail.de> References: <9AAFEFF4-8ACE-4C95-975F-67C3F4FDAF81@vodafonemail.de> <20200906163559.1b56c36f@scratchpost.org> <45F0D825-F888-42E9-BDAE-7BB6FA010A6E@vodafonemail.de> <20200909003732.5c401932@scratchpost.org> <20200914065911.GB1717@E5400> <20200916075117.GE19874@E5400> <5C85E809-92D7-48F2-A8E2-2DF57460A6D9@vodafonemail.de> <2A23E912-6919-4A4A-A4CC-0C5FB1A5D5C1@vodafonemail.de> <066A5D57-B0B1-4FF4-B07B-1A5030AA789F@vodafonemail.de> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/oRnESS6NO63ZjXFqMtTBmDa"; protocol="application/pgp-signature"; micalg=pgp-sha512 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.39 X-TUID: sH8qfmQu1oa9 --Sig_/oRnESS6NO63ZjXFqMtTBmDa Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Stefan, I think this is almost ready to be merged. There's still one thing I'm unclear about. I tested it this way: (1) create ~/config.scm with the following contents: (use-modules (gnu)) (operating-system (timezone "UTC") (bootloader (bootloader-configuration (bootloader grub-efi-netboot-bootloader) (target "/boot"))) (file-systems (cons* (file-system (mount-point "/") (device ":/foo") (type "nfs")) %base-file-systems)) (host-name "client1")) (2) mkdir ~/tf (3) ./pre-inst-env guix system init ~/config.scm ~/tf Now, ~/tf contains the system to be booted over the network, right? But ~/tf/boot/efi/Guix/grub.cfg points to the tftp machine's /boot . Is that a bug? Shouldn't it point to the /boot of ~/tf, the system to be booted? Likewise, the gnu store directly inside ~/tf is not used, but ~/tf/boot/gnu points to the tftp machines's /gnu. Shouldn't it point to the former? On Sat, 26 Sep 2020 12:54:00 +0200 Stefan wrote: > + (let* ((net-dir (string-append mount-point target "/")) > + (sub-dir (string-append net-dir #$subdir "/")) > + (store-link (string-append net-dir (%store-prefix))) > + (grub-cfg "/boot/grub/grub.cfg") Shouldn't that be (string-append mount-point "/boot/grub/grub.cfg") ? > + (grub-cfg-link (string-append sub-dir (basename grub-cfg= ))) > + (boot-efi-link (string-append sub-dir #$boot-efi-link))) > + ;; Prepare the symlink to the store. > + (mkdir-p (dirname store-link)) > + (false-if-exception (delete-file store-link)) > + (symlink-relative (%store-prefix) store-link) Shouldn't that be (symlink-relative (string-append mount-point (%store-prefix)) store-link) ? > + ;; Install GRUB, which refers to the grub.cfg, with support f= or > + ;; encrypted partitions, > + (setenv "GRUB_ENABLE_CRYPTODISK" "y") > + (invoke/quiet (string-append bootloader "/bin/grub-mknetdir") > + (string-append "--net-directory=3D" net-dir) > + (string-append "--subdir=3D" #$subdir)) > + ;; Prepare the symlink to the grub.cfg, which points into the= store. > + (false-if-exception (delete-file grub-cfg-link)) > + (symlink-relative grub-cfg grub-cfg-link) > + ;; Prepare the bootloader symlink, which points to GRUB. > + (false-if-exception (delete-file boot-efi-link)) > + (symlink #$efi-bootloader boot-efi-link)))))) Okay. --Sig_/oRnESS6NO63ZjXFqMtTBmDa Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl9vaMUACgkQ5xo1VCww uqXAMwgAhoOQD30qdQ58+VfnoS8bv2fUxKD351NxlQb9N/7BnTEhR0gfQUTfl6ab FgWSfuF5cRT2sl2jM9JlTvhTBcH1TDgk4XisOvbgQykZtYLloA07Pl5BQihsqcAk HMOWj1RYuPSxc684EGtRviMHrzNucROEwmUg1hsmnTEjVnAIWLb5URPBi0D294pi sf1IBd9bakDt5Um0DJ9uFfWdFvC3cm2+TGWr57NRNtequ9KkaytdqlCG3ORk7RrF /4+jARfqqIZp9/l3+EWZh4em0Yd+UHtylFBf6zKHJgPxJQO9QVZbwR7UWd4ZZApE bO6FEfPXpknFuUG6WXFTerl9apSd9Q== =4/QB -----END PGP SIGNATURE----- --Sig_/oRnESS6NO63ZjXFqMtTBmDa--