guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: grub: Support loading files from TFTP if the


From: guix-commits
Subject: branch master updated: gnu: grub: Support loading files from TFTP if the root filesystem is NFS.
Date: Mon, 14 Sep 2020 08:34:45 -0400

This is an automated email from the git hooks/post-receive script.

dannym pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 8c4f1aa  gnu: grub: Support loading files from TFTP if the root 
filesystem is NFS.
8c4f1aa is described below

commit 8c4f1aa85f3844fc8c989e74cef9d269dd30889c
Author: Stefan <stefan-guix@vodafonemail.de>
AuthorDate: Mon Sep 14 14:20:16 2020 +0200

    gnu: grub: Support loading files from TFTP if the root filesystem is NFS.
    
    * gnu/bootloader/grub.scm (grub-root-search): Set the root to "(tftp)" if
    the searched-for file is stored on NFS.
---
 gnu/bootloader/grub.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index e3febee..f69bf8e 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -295,6 +295,33 @@ code."
         ((? file-system-label? label)
          (format #f "search --label --set ~a"
                  (file-system-label->string label)))
+        ((? (lambda (device)
+              (and (string? device) (string-contains device ":/"))) nfs-uri)
+         ;; This assumes that if your root file system is on NFS, then
+         ;; you also want to load your grub extra files, kernel and initrd
+         ;; from there.
+         ;;
+         ;; We explicitly set "root=(tftp)" here even though if grub.cfg
+         ;; had been loaded via TFTP, Grub would have set "root=(tftp)"
+         ;; automatically anyway.  The reason is if you have a system that
+         ;; used to be on NFS but now is local, root would be set to local
+         ;; disk.  If you then selected an older system generation that is
+         ;; supposed to boot from network in the Grub boot menu, Grub still
+         ;; wouldn't load those files from network otherwise.
+         ;;
+         ;; TFTP is preferred to HTTP because it is used more widely and
+         ;; specified in standards more widely--especially BOOTP/DHCPv4
+         ;; defines a TFTP server for DHCP option 66, but not HTTP.
+         ;;
+         ;; Note: DHCPv6 specifies option 59 to contain a boot-file-url,
+         ;; which can contain a HTTP or TFTP URL.
+         ;;
+         ;; Note: It is assumed that the file paths are of a similar
+         ;; setup on both the TFTP server and the NFS server (it is
+         ;; not possible to search for files on TFTP).
+         ;;
+         ;; TODO: Allow HTTP.
+         "set root=(tftp)")
         ((or #f (? string?))
          #~(format #f "search --file --set ~a" #$file)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]