* [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
@ 2020-06-11 23:37 Stefan
2020-06-21 9:35 ` Mathieu Othacehe
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-06-11 23:37 UTC (permalink / raw)
To: 41820; +Cc: Danny Milosavljevic
* doc/guix.texi: Add description for 'nfs-share'.
* gnu/bootloader/grub.scm (grub-root-search): Support 'nfs-share'.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support 'nfs-share'.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
'nfs-share'.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Support
'nfs-share'.
* gnu/services/base.scm (file-system->fstab-entry): Support 'nfs-share'.
* gnu/system.scm (read-boot-parameters, device-sexp->device, device->sexp):
Support 'nfs-share'.
* gnu/system/file-systems.scm (<nfs-share>): New record type with printer.
(nfs-share): New function to conditionally construct an 'nfs-share' record.
(nfs-share->string): New function.
(nfs-share?): New predicate.
(file-system-device->string, file-system->spec, spec->file-system): Support
'nfs-share'.
* guix/scripts/system.scm (display-system-generation, check-initrd-modules):
Support 'nfs-share'.
---
doc/guix.texi | 38 ++++++++++++++++++++++++++++++-------
gnu/bootloader.scm | 4 ++--
gnu/bootloader/grub.scm | 2 ++
gnu/build/file-systems.scm | 12 ++++++------
gnu/build/linux-boot.scm | 7 ++++---
gnu/machine/ssh.scm | 23 ++++++++++++++++++++++
gnu/services/base.scm | 2 ++
gnu/system.scm | 4 ++++
gnu/system/file-systems.scm | 36 +++++++++++++++++++++++++++++++++--
guix/scripts/system.scm | 9 +++++++--
10 files changed, 115 insertions(+), 22 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 15e077a41c..4fd3793a4f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11723,10 +11723,10 @@ This is a string specifying the type of the file system---e.g.,
This designates the place where the file system is to be mounted.
@item @code{device}
-This names the ``source'' of the file system. It can be one of three
-things: a file system label, a file system UUID, or the name of a
-@file{/dev} node. Labels and UUIDs offer a way to refer to file
-systems without having to hard-code their actual device
+This names the ``source'' of the file system. It can be one of four
+things: a file system label, a file system UUID, the name of a
+@file{/dev} node, or an NFS share. Labels and UUIDs offer a way to
+refer to file systems without having to hard-code their actual device
name@footnote{Note that, while it is tempting to use
@file{/dev/disk/by-uuid} and similar device names to achieve the same
result, this is not recommended: These special device nodes are created
@@ -11735,9 +11735,10 @@ mounted.}.
@findex file-system-label
File system labels are created using the @code{file-system-label}
-procedure, UUIDs are created using @code{uuid}, and @file{/dev} node are
-plain strings. Here's an example of a file system referred to by its
-label, as shown by the @command{e2label} command:
+procedure, UUIDs are created using @code{uuid}, NFS shares are created
+using @code{nfs-share}, and @file{/dev} nodes are plain strings. Here's
+an example of a file system referred to by its label, as shown by the
+@command{e2label} command:
@lisp
(file-system
@@ -11762,6 +11763,29 @@ like this:
(device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
@end lisp
+@findex nfs-share
+An NFS share is defined in one of the following ways. Please note that
+the NFS server for a root file system needs to be passed as IP address
+via the @code{options} field as @code{"addr="} option.
+
+@lisp
+(file-system
+ (mount-point "/")
+ (type "nfs")
+ (device (nfs-share ":/srv/nfs/guix-root"))
+ (options "addr=10.10.10.10,vers=4.1")
+ (needed-for-boot? #t))
+@end lisp
+
+@lisp
+(file-system
+ (mount-point "/music")
+ (type "nfs")
+ (device (nfs-share "music-server.local:/srv/nfs/music"))
+ (options "vers=4.1")
+ (needed-for-boot? #f))
+@end lisp
+
When the source of a file system is a mapped device (@pxref{Mapped
Devices}), its @code{device} field @emph{must} refer to the mapped
device name---e.g., @file{"/dev/mapper/root-partition"}.
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 2eebb8e9d9..62c585670b 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -77,8 +77,8 @@
menu-entry make-menu-entry
menu-entry?
(label menu-entry-label)
- (device menu-entry-device ; file system uuid, label, or #f
- (default #f))
+ (device menu-entry-device ; uuid, file-system-label,
+ (default #f)) ; nfs-share, or #f
(device-mount-point menu-entry-device-mount-point
(default #f))
(linux menu-entry-linux
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index b905ae360c..d82c09a79d 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -295,6 +295,8 @@ code."
((? file-system-label? label)
(format #f "search --label --set ~a"
(file-system-label->string label)))
+ ((? nfs-share?)
+ "set root=(tftp)")
((or #f (? string?))
#~(format #f "search --file --set ~a" #$file)))))
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index ad92d8a496..306cff75fb 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -636,8 +636,8 @@ were found."
^L
(define (canonicalize-device-spec spec)
- "Return the device name corresponding to SPEC, which can be a <uuid>, a
-<file-system-label>, or a string (typically a /dev file name)."
+ "Return the device name corresponding to SPEC, which can be a <uuid>, an
+<nfs-share>, a <file-system-label>, or a string (typically a /dev file name)."
(define max-trials
;; Number of times we retry partition label resolution, 1 second per
;; trial. Note: somebody reported a delay of 16 seconds (!) before their
@@ -661,10 +661,10 @@ were found."
(match spec
((? string?)
- (if (string-contains spec ":/")
- spec ; do not resolve NFS devices
- ;; Nothing to do, but wait until SPEC shows up.
- (resolve identity spec identity)))
+ ;; Nothing to do, but wait until SPEC shows up.
+ (resolve identity spec identity))
+ ((? nfs-share?)
+ (nfs-share->string spec))
((? file-system-label?)
;; Resolve the label.
(resolve find-partition-by-label
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 80fe0cfb9d..8a609f6eff 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -469,10 +469,11 @@ upon error."
(define (device-string->file-system-device device-string)
;; The "--root=SPEC" kernel command-line option always provides a
- ;; string, but the string can represent a device, a UUID, or a
- ;; label. So check for all three.
- (cond ((string-prefix? "/" device-string) device-string)
+ ;; string, but the string can represent a device, a UUID, an nfs-share,
+ ;; or a label. So check for all of theme.
+ (cond ((nfs-share device-string #:on-error (const #f)) => identity)
((uuid device-string) => identity)
+ ((string-prefix? "/" device-string) device-string)
(else (file-system-label device-string))))
(display "Welcome, this is GNU's early boot Guile.\n")
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 116da86327..aa42a082c2 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -222,6 +222,24 @@ exist on the machine."
(message (format #f (G_ "no file system with UUID '~a'")
(uuid->string (file-system-device fs))))))))))
+ (define (check-nfs-share fs)
+ (define remote-exp
+ (with-imported-modules (source-module-closure
+ '((gnu build file-systems)))
+ #~(begin
+ (use-modules (gnu build file-systems))
+
+ ;; TODO: Try to mount the share or to ping the server.
+ (nfs-share->string (nfs-share
+ #$(nfs-share->string (file-system-device fs)))))))
+
+ (remote-let ((result remote-exp))
+ (unless result
+ (raise (condition
+ (&message
+ (message (format #f (G_ "no nfs-share '~a'")
+ (nfs-share->string (file-system-device fs))))))))))
+
(append (map check-literal-file-system
(filter (lambda (fs)
(string? (file-system-device fs)))
@@ -233,6 +251,10 @@ exist on the machine."
(map check-uuid-file-system
(filter (lambda (fs)
(uuid? (file-system-device fs)))
+ file-systems))
+ (map check-nfs-share
+ (filter (lambda (fs)
+ (nfs-share? (file-system-device fs)))
file-systems))))
(define (machine-check-initrd-modules machine)
@@ -257,6 +279,7 @@ not available in the initrd."
(define dev
#$(cond ((string? device) device)
+ ((nfs-share? device) (nfs-share->string device))
((uuid? device) #~(find-partition-by-uuid
(string->uuid
#$(uuid->string device))))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6ea7ef8e7e..beef30fdf4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -200,6 +200,8 @@
(file-system-label->string label)))
((? uuid? uuid)
(string-append "UUID=" (uuid->string uuid)))
+ ((? nfs-share? share)
+ (nfs-share->string share))
((? string? device)
device))
"\t"
diff --git a/gnu/system.scm b/gnu/system.scm
index d51691fe76..660255b9e9 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -306,6 +306,8 @@ file system labels."
(bytevector->uuid bv type))
(('file-system-label (? string? label))
(file-system-label label))
+ (('nfs-share (? string? share))
+ (nfs-share share))
((? bytevector? bv) ;old format
(bytevector->uuid bv 'dce))
((? string? device)
@@ -1240,6 +1242,8 @@ such as '--root' and '--load' to <boot-parameters>."
`(uuid ,(uuid-type uuid) ,(uuid-bytevector uuid)))
((? file-system-label? label)
`(file-system-label ,(file-system-label->string label)))
+ ((? nfs-share? share)
+ `(nfs-share ,(nfs-share->string share)))
(_
device)))
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 0f94577760..13ef38e490 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -59,6 +59,10 @@
file-system-label?
file-system-label->string
+ nfs-share
+ nfs-share?
+ nfs-share->string
+
file-system->spec
spec->file-system
specification->file-system-mapping
@@ -102,7 +106,8 @@
(define-record-type* <file-system> %file-system
make-file-system
file-system?
- (device file-system-device) ; string | <uuid> | <file-system-label>
+ (device file-system-device) ; <uuid> | <file-system-label>
+ ; <nfs-share> | string
(mount-point file-system-mount-point) ; string
(type file-system-type) ; string
(flags file-system-flags ; list of symbols
@@ -134,6 +139,27 @@
(format port "#<file-system-label ~s>"
(file-system-label->string obj))))
+;; An nfs-share for use in the 'device' field.
+(define-record-type <nfs-share>
+ (make-nfs-share share)
+ nfs-share?
+ (share nfs-share->string))
+
+(define* (nfs-share share #:key (on-error
+ (lambda (share)
+ (error "The nfs-share is missing \":/\" in"
+ share))))
+ "Try to construct an nfs-share, return (on-errer share) if share is invalid.
+Use #:on-error (const #f)' to check validity and avoid an error to be thrown."
+ (if (string-contains share ":/")
+ (make-nfs-share share)
+ (on-error share)))
+
+(set-record-type-printer! <nfs-share>
+ (lambda (obj port)
+ (format port "#<nfs-share ~s>"
+ (nfs-share->string obj))))
+
(define-syntax report-deprecation
(lambda (s)
"Report the use of the now-deprecated 'title' field."
@@ -149,7 +175,7 @@
file line column)
#t)))))
-;; Helper for 'process-file-system-declaration'.
+;; Helper for the deprecated 'process-file-system-declaration'.
(define-syntax device-expression
(syntax-rules (quote label uuid device)
((_ (quote label) dev)
@@ -257,6 +283,8 @@ UUID-TYPE, a symbol such as 'dce or 'iso9660."
(if uuid-type
(uuid->string (uuid-bytevector device) uuid-type)
(uuid->string device)))
+ ((? nfs-share?)
+ (nfs-share->string device))
((? string?)
device)))
@@ -303,6 +331,8 @@ initrd code."
`(uuid ,(uuid-type device) ,(uuid-bytevector device)))
((file-system-label? device)
`(file-system-label ,(file-system-label->string device)))
+ ((nfs-share? device)
+ `(nfs-share ,(nfs-share->string device)))
(else device))
mount-point type flags options check?))))
@@ -316,6 +346,8 @@ initrd code."
(bytevector->uuid bv type))
(('file-system-label (? string? label))
(file-system-label label))
+ (('nfs-share (? string? share))
+ (nfs-share share))
(_
device)))
(mount-point mount-point) (type type)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3d7aa77cb7..27b324deac 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -497,12 +497,15 @@ list of services."
;; root device: UUID: 12345-678
;; or:
;; root device: label: "my-root"
+ ;; or:
+ ;; root device: nfs-share: 0.0.0.0:/my-root
;; or just:
;; root device: /dev/sda3
- (format #t (G_ " root device: ~[UUID: ~a~;label: ~s~;~a~]~%")
+ (format #t (G_ " root device: ~[UUID: ~a~;label: ~s~;nfs-share: ~a~;~a~]~%")
(cond ((uuid? root-device) 0)
((file-system-label? root-device) 1)
- (else 2))
+ ((nfs-share? root-device) 2)
+ (else 3))
(file-system-device->string root-device))
(format #t (G_ " kernel: ~a~%") kernel)
@@ -649,6 +652,8 @@ checking this by themselves in their 'check' procedure."
(match device
((? string?)
device)
+ ((? nfs-share?)
+ (nfs-share->string device))
((? uuid?)
(find-partition-by-uuid device))
((? file-system-label?)
--
2.26.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
2020-06-11 23:37 [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device Stefan
@ 2020-06-21 9:35 ` Mathieu Othacehe
2020-07-01 18:48 ` Stefan
2020-07-01 18:48 ` Stefan
0 siblings, 2 replies; 8+ messages in thread
From: Mathieu Othacehe @ 2020-06-21 9:35 UTC (permalink / raw)
To: Stefan; +Cc: Danny Milosavljevic, 41820
Hello Stefan,
Thanks a lot for this patch, overall it look nice! Without going into
details here are a few remarks:
* As you probably noticed the bootloading & system part of Guix is
moving a lot recently. This patch does not apply on master, so it would
be nice if you could rebase it and pass "--base=auto" option to "git
format-patch" so that it's easier to apply it.
* It would be nice to have tests for this functionality. There's already
a (gnu tests nfs) module, testing the NFS service. Maybe you could add a
test case of a marionette booting from a local NFS share.
* Finally, now that file-system "device" field can be a label, a UUID, a
"/dev" node and an "nfs-share", it makes me think that we could need a
new layer of abstraction here, but this can come later and I need to
think more about it.
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
2020-06-21 9:35 ` Mathieu Othacehe
@ 2020-07-01 18:48 ` Stefan
2020-07-01 18:48 ` Stefan
1 sibling, 0 replies; 8+ messages in thread
From: Stefan @ 2020-07-01 18:48 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: Danny Milosavljevic, 41820
Hi Mathieu!
> * As you probably noticed the bootloading & system part of Guix is
> moving a lot recently. This patch does not apply on master, so it would
> be nice if you could rebase it and pass "--base=auto" option to "git
> format-patch" so that it's easier to apply it.
OK.
> * It would be nice to have tests for this functionality. There's already
> a (gnu tests nfs) module, testing the NFS service. Maybe you could add a
> test case of a marionette booting from a local NFS share.
I tried. Unfortunately on my little aarch64 SBC compiling the necessary packages takes days – there are no substitutes available – and in the end qemu-5 has a failing test. I retried and rebased and retried and wasted days in the end. I’m a bit frustrated. :-(
TEST iotest-qcow2: 244 [fail]
QEMU -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../aarch64-softmmu/qemu-system-aarch64" -nodefaults -display none -machine
virt -accel qtest
QEMU_IMG -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu-img"
QEMU_IO -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu-io" --cache writeback --aio threads -f qcow2
QEMU_NBD -- "/tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/../../qemu-nbd"
IMGFMT -- qcow2 (compat=1.1)
IMGPROTO -- file
PLATFORM -- Linux/aarch64 5.5.9
TEST_DIR -- /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/scratch
SOCK_DIR -- /tmp/guix-build-qemu-5.0.0.drv-0/tmp.qUme9gv2Jy
SOCKET_SCM_HELPER -- /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/socket_scm_helper
--- /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/244.out 2020-04-28 16:49:25.000000000 +0000
+++ /tmp/guix-build-qemu-5.0.0.drv-0/qemu-5.0.0/tests/qemu-iotests/244.out.bad 2020-06-29 10:27:02.036147483 +0000
@@ -74,6 +74,7 @@
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 1048576/1048576 bytes at offset 1048576
1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Pattern verification failed at offset 2097152, 2097152 bytes
read 2097152/2097152 bytes at offset 2097152
2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 1048576/1048576 bytes at offset 4194304
@@ -108,7 +109,7 @@
read 4194304/4194304 bytes at offset 2097152
4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Images are identical.
+Content mismatch at offset 2097152!
qcow2 file size after I/O: 327680
=== bdrv_co_block_status test for file and offset=0 ===
This is the test that I wrote and wanted to try. Maybe you can pick it up and give it a try.
(define (run-nfs-root-fs-test)
"Run a test of an OS mounting its root file system via NFS."
(define nfs-root-server-os
(marionette-operating-system
(operating-system
(inherit %nfs-os)
(file-systems %base-file-systems)
(services
(modify-services (operating-system-user-services %nfs-os)
(nfs-service-type
config
=>
(nfs-configuration
(debug '(nfs nfsd mountd))
(exports '(("/export"
"*(rw,insecure,no_subtree_check,crossmnt,fsid=root,no_root_squash,insecure,async)"))))))))
#:requirements '(nscd)
#:imported-modules '((gnu services herd)
(guix combinators))))
(define nfs-root-client-os
(marionette-operating-system
(operating-system
(inherit %nfs-os)
(kernel-arguments '("ip=dhcp"))
(file-systems (cons
(file-system
(type "nfs")
(mount-point "/")
(device (nfs-share ":/export"))
(options "addr=0.0.0.0,vers=4.2"))
%base-file-systems)))
#:requirements '(nscd)
#:imported-modules '((gnu services herd)
(guix combinators))))
(define test
(with-imported-modules '((gnu build marionette))
#~(begin
(use-modules (gnu build marionette)
(srfi srfi-64))
(define server-marionette
(make-marionette (list #$(virtual-machine nfs-root-server-os))))
(define client-marionette
(make-marionette (list #$(virtual-machine nfs-root-client-os))))
(mkdir #$output)
(chdir #$output)
(test-begin "start-nfs-root-server")
(marionette-eval
'(begin
(use-modules (gnu services herd))
(current-output-port
(open-file "/dev/console" "w0"))
(chmod "/export" #o777)
(symlink "/gnu" "/export/gnu")
(start-service 'nscd))
(start-service 'networking)
(start-service 'nfs)
server-marionette)
;; Wait for the NFS services to be up and running.
(test-assert "nfs services are running"
(wait-for-file "/var/run/rpc.statd.pid" server-marionette))
(test-begin "boot-nfs-root-client")
(marionette-eval
'(begin
(use-modules (gnu services herd))
(current-output-port
(open-file "/dev/console" "w0"))
(with-output-to-file "/var/run/mounts"
(lambda () (system* "mount")))
(chmod "/var/run/mounts" #o777))
client-marionette)
(test-assert "nfs-root-client booted")
(marionelle-eval
'(begin
(and (file-exists? "/export/var/run/mounts")
(system* "cat" "/export/var/run/mounts")))
server-marionette)
(test-end)
(exit (= (test-runner-fail-count (test-runner-current)) 0)))))
(gexp->derivation "nfs-server-test" test))
(define %test-nfs-root-fs
(system-test
(name "nfs-root-fs")
(description "Test that an NFS server can be started and exported
directories can be mounted.")
(value (run-nfs-root-fs-test))))
Bye
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
2020-06-21 9:35 ` Mathieu Othacehe
2020-07-01 18:48 ` Stefan
@ 2020-07-01 18:48 ` Stefan
2020-07-18 13:55 ` Stefan
1 sibling, 1 reply; 8+ messages in thread
From: Stefan @ 2020-07-01 18:48 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: Danny Milosavljevic, 41820
* doc/guix.texi: Add description for 'nfs-share'.
* gnu/bootloader/grub.scm (grub-root-search): Support 'nfs-share'.
* gnu/build/file-systems.scm (canonicalize-device-spec): Support 'nfs-share'.
* gnu/build/linux-boot.scm (device-string->file-system-device): Support
'nfs-share'.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Support
'nfs-share'.
* gnu/services/base.scm (file-system->fstab-entry): Support 'nfs-share'.
* gnu/system.scm (read-boot-parameters, device-sexp->device, device->sexp):
Support 'nfs-share'.
* gnu/system/file-systems.scm (<nfs-share>): New record type with printer.
(nfs-share): New function to conditionally construct an 'nfs-share' record.
(nfs-share->string): New function.
(nfs-share?): New predicate.
(file-system-device->string, file-system->spec, spec->file-system): Support
'nfs-share'.
* guix/scripts/system.scm (display-system-generation, check-initrd-modules):
Support 'nfs-share'.
---
doc/guix.texi | 38 ++++++++++++++++++++++++++++++-------
gnu/bootloader.scm | 4 ++--
gnu/bootloader/grub.scm | 2 ++
gnu/build/file-systems.scm | 12 ++++++------
gnu/build/linux-boot.scm | 7 ++++---
gnu/machine/ssh.scm | 23 ++++++++++++++++++++++
gnu/services/base.scm | 2 ++
gnu/system.scm | 4 ++++
gnu/system/file-systems.scm | 36 +++++++++++++++++++++++++++++++++--
guix/scripts/system.scm | 9 +++++++--
10 files changed, 115 insertions(+), 22 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 15e077a41c..4fd3793a4f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11723,10 +11723,10 @@ This is a string specifying the type of the file system---e.g.,
This designates the place where the file system is to be mounted.
@item @code{device}
-This names the ``source'' of the file system. It can be one of three
-things: a file system label, a file system UUID, or the name of a
-@file{/dev} node. Labels and UUIDs offer a way to refer to file
-systems without having to hard-code their actual device
+This names the ``source'' of the file system. It can be one of four
+things: a file system label, a file system UUID, the name of a
+@file{/dev} node, or an NFS share. Labels and UUIDs offer a way to
+refer to file systems without having to hard-code their actual device
name@footnote{Note that, while it is tempting to use
@file{/dev/disk/by-uuid} and similar device names to achieve the same
result, this is not recommended: These special device nodes are created
@@ -11735,9 +11735,10 @@ mounted.}.
@findex file-system-label
File system labels are created using the @code{file-system-label}
-procedure, UUIDs are created using @code{uuid}, and @file{/dev} node are
-plain strings. Here's an example of a file system referred to by its
-label, as shown by the @command{e2label} command:
+procedure, UUIDs are created using @code{uuid}, NFS shares are created
+using @code{nfs-share}, and @file{/dev} nodes are plain strings. Here's
+an example of a file system referred to by its label, as shown by the
+@command{e2label} command:
@lisp
(file-system
@@ -11762,6 +11763,29 @@ like this:
(device (uuid "4dab5feb-d176-45de-b287-9b0a6e4c01cb")))
@end lisp
+@findex nfs-share
+An NFS share is defined in one of the following ways. Please note that
+the NFS server for a root file system needs to be passed as IP address
+via the @code{options} field as @code{"addr="} option.
+
+@lisp
+(file-system
+ (mount-point "/")
+ (type "nfs")
+ (device (nfs-share ":/srv/nfs/guix-root"))
+ (options "addr=10.10.10.10,vers=4.1")
+ (needed-for-boot? #t))
+@end lisp
+
+@lisp
+(file-system
+ (mount-point "/music")
+ (type "nfs")
+ (device (nfs-share "music-server.local:/srv/nfs/music"))
+ (options "vers=4.1")
+ (needed-for-boot? #f))
+@end lisp
+
When the source of a file system is a mapped device (@pxref{Mapped
Devices}), its @code{device} field @emph{must} refer to the mapped
device name---e.g., @file{"/dev/mapper/root-partition"}.
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 2eebb8e9d9..62c585670b 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -77,8 +77,8 @@
menu-entry make-menu-entry
menu-entry?
(label menu-entry-label)
- (device menu-entry-device ; file system uuid, label, or #f
- (default #f))
+ (device menu-entry-device ; uuid, file-system-label,
+ (default #f)) ; nfs-share, or #f
(device-mount-point menu-entry-device-mount-point
(default #f))
(linux menu-entry-linux
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index b905ae360c..d82c09a79d 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -295,6 +295,8 @@ code."
((? file-system-label? label)
(format #f "search --label --set ~a"
(file-system-label->string label)))
+ ((? nfs-share?)
+ "set root=(tftp)")
((or #f (? string?))
#~(format #f "search --file --set ~a" #$file)))))
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
index ad92d8a496..306cff75fb 100644
--- a/gnu/build/file-systems.scm
+++ b/gnu/build/file-systems.scm
@@ -636,8 +636,8 @@ were found."
^L
(define (canonicalize-device-spec spec)
- "Return the device name corresponding to SPEC, which can be a <uuid>, a
-<file-system-label>, or a string (typically a /dev file name)."
+ "Return the device name corresponding to SPEC, which can be a <uuid>, an
+<nfs-share>, a <file-system-label>, or a string (typically a /dev file name)."
(define max-trials
;; Number of times we retry partition label resolution, 1 second per
;; trial. Note: somebody reported a delay of 16 seconds (!) before their
@@ -661,10 +661,10 @@ were found."
(match spec
((? string?)
- (if (string-contains spec ":/")
- spec ; do not resolve NFS devices
- ;; Nothing to do, but wait until SPEC shows up.
- (resolve identity spec identity)))
+ ;; Nothing to do, but wait until SPEC shows up.
+ (resolve identity spec identity))
+ ((? nfs-share?)
+ (nfs-share->string spec))
((? file-system-label?)
;; Resolve the label.
(resolve find-partition-by-label
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 80fe0cfb9d..8a609f6eff 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -469,10 +469,11 @@ upon error."
(define (device-string->file-system-device device-string)
;; The "--root=SPEC" kernel command-line option always provides a
- ;; string, but the string can represent a device, a UUID, or a
- ;; label. So check for all three.
- (cond ((string-prefix? "/" device-string) device-string)
+ ;; string, but the string can represent a device, a UUID, an nfs-share,
+ ;; or a label. So check for all of theme.
+ (cond ((nfs-share device-string #:on-error (const #f)) => identity)
((uuid device-string) => identity)
+ ((string-prefix? "/" device-string) device-string)
(else (file-system-label device-string))))
(display "Welcome, this is GNU's early boot Guile.\n")
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 116da86327..aa42a082c2 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -222,6 +222,24 @@ exist on the machine."
(message (format #f (G_ "no file system with UUID '~a'")
(uuid->string (file-system-device fs))))))))))
+ (define (check-nfs-share fs)
+ (define remote-exp
+ (with-imported-modules (source-module-closure
+ '((gnu build file-systems)))
+ #~(begin
+ (use-modules (gnu build file-systems))
+
+ ;; TODO: Try to mount the share or to ping the server.
+ (nfs-share->string (nfs-share
+ #$(nfs-share->string (file-system-device fs)))))))
+
+ (remote-let ((result remote-exp))
+ (unless result
+ (raise (condition
+ (&message
+ (message (format #f (G_ "no nfs-share '~a'")
+ (nfs-share->string (file-system-device fs))))))))))
+
(append (map check-literal-file-system
(filter (lambda (fs)
(string? (file-system-device fs)))
@@ -233,6 +251,10 @@ exist on the machine."
(map check-uuid-file-system
(filter (lambda (fs)
(uuid? (file-system-device fs)))
+ file-systems))
+ (map check-nfs-share
+ (filter (lambda (fs)
+ (nfs-share? (file-system-device fs)))
file-systems))))
(define (machine-check-initrd-modules machine)
@@ -257,6 +279,7 @@ not available in the initrd."
(define dev
#$(cond ((string? device) device)
+ ((nfs-share? device) (nfs-share->string device))
((uuid? device) #~(find-partition-by-uuid
(string->uuid
#$(uuid->string device))))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6ea7ef8e7e..beef30fdf4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -200,6 +200,8 @@
(file-system-label->string label)))
((? uuid? uuid)
(string-append "UUID=" (uuid->string uuid)))
+ ((? nfs-share? share)
+ (nfs-share->string share))
((? string? device)
device))
"\t"
diff --git a/gnu/system.scm b/gnu/system.scm
index d51691fe76..660255b9e9 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -306,6 +306,8 @@ file system labels."
(bytevector->uuid bv type))
(('file-system-label (? string? label))
(file-system-label label))
+ (('nfs-share (? string? share))
+ (nfs-share share))
((? bytevector? bv) ;old format
(bytevector->uuid bv 'dce))
((? string? device)
@@ -1240,6 +1242,8 @@ such as '--root' and '--load' to <boot-parameters>."
`(uuid ,(uuid-type uuid) ,(uuid-bytevector uuid)))
((? file-system-label? label)
`(file-system-label ,(file-system-label->string label)))
+ ((? nfs-share? share)
+ `(nfs-share ,(nfs-share->string share)))
(_
device)))
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 0f94577760..13ef38e490 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -59,6 +59,10 @@
file-system-label?
file-system-label->string
+ nfs-share
+ nfs-share?
+ nfs-share->string
+
file-system->spec
spec->file-system
specification->file-system-mapping
@@ -102,7 +106,8 @@
(define-record-type* <file-system> %file-system
make-file-system
file-system?
- (device file-system-device) ; string | <uuid> | <file-system-label>
+ (device file-system-device) ; <uuid> | <file-system-label>
+ ; <nfs-share> | string
(mount-point file-system-mount-point) ; string
(type file-system-type) ; string
(flags file-system-flags ; list of symbols
@@ -134,6 +139,27 @@
(format port "#<file-system-label ~s>"
(file-system-label->string obj))))
+;; An nfs-share for use in the 'device' field.
+(define-record-type <nfs-share>
+ (make-nfs-share share)
+ nfs-share?
+ (share nfs-share->string))
+
+(define* (nfs-share share #:key (on-error
+ (lambda (share)
+ (error "The nfs-share is missing \":/\" in"
+ share))))
+ "Try to construct an nfs-share, return (on-errer share) if share is invalid.
+Use #:on-error (const #f)' to check validity and avoid an error to be thrown."
+ (if (string-contains share ":/")
+ (make-nfs-share share)
+ (on-error share)))
+
+(set-record-type-printer! <nfs-share>
+ (lambda (obj port)
+ (format port "#<nfs-share ~s>"
+ (nfs-share->string obj))))
+
(define-syntax report-deprecation
(lambda (s)
"Report the use of the now-deprecated 'title' field."
@@ -149,7 +175,7 @@
file line column)
#t)))))
-;; Helper for 'process-file-system-declaration'.
+;; Helper for the deprecated 'process-file-system-declaration'.
(define-syntax device-expression
(syntax-rules (quote label uuid device)
((_ (quote label) dev)
@@ -257,6 +283,8 @@ UUID-TYPE, a symbol such as 'dce or 'iso9660."
(if uuid-type
(uuid->string (uuid-bytevector device) uuid-type)
(uuid->string device)))
+ ((? nfs-share?)
+ (nfs-share->string device))
((? string?)
device)))
@@ -303,6 +331,8 @@ initrd code."
`(uuid ,(uuid-type device) ,(uuid-bytevector device)))
((file-system-label? device)
`(file-system-label ,(file-system-label->string device)))
+ ((nfs-share? device)
+ `(nfs-share ,(nfs-share->string device)))
(else device))
mount-point type flags options check?))))
@@ -316,6 +346,8 @@ initrd code."
(bytevector->uuid bv type))
(('file-system-label (? string? label))
(file-system-label label))
+ (('nfs-share (? string? share))
+ (nfs-share share))
(_
device)))
(mount-point mount-point) (type type)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3d7aa77cb7..27b324deac 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -497,12 +497,15 @@ list of services."
;; root device: UUID: 12345-678
;; or:
;; root device: label: "my-root"
+ ;; or:
+ ;; root device: nfs-share: 0.0.0.0:/my-root
;; or just:
;; root device: /dev/sda3
- (format #t (G_ " root device: ~[UUID: ~a~;label: ~s~;~a~]~%")
+ (format #t (G_ " root device: ~[UUID: ~a~;label: ~s~;nfs-share: ~a~;~a~]~%")
(cond ((uuid? root-device) 0)
((file-system-label? root-device) 1)
- (else 2))
+ ((nfs-share? root-device) 2)
+ (else 3))
(file-system-device->string root-device))
(format #t (G_ " kernel: ~a~%") kernel)
@@ -649,6 +652,8 @@ checking this by themselves in their 'check' procedure."
(match device
((? string?)
device)
+ ((? nfs-share?)
+ (nfs-share->string device))
((? uuid?)
(find-partition-by-uuid device))
((? file-system-label?)
base-commit: cbd9581acc41cd49eb81c2432452cad4de805cbd
--
2.26.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
2020-07-01 18:48 ` Stefan
@ 2020-07-18 13:55 ` Stefan
2020-07-21 14:33 ` Danny Milosavljevic
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-07-18 13:55 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: Danny Milosavljevic, 41820
A friendly ping …
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device.
2020-07-18 13:55 ` Stefan
@ 2020-07-21 14:33 ` Danny Milosavljevic
0 siblings, 0 replies; 8+ messages in thread
From: Danny Milosavljevic @ 2020-07-21 14:33 UTC (permalink / raw)
To: Stefan; +Cc: Mathieu Othacehe, 41820, Brice Waegeneire
[-- Attachment #1: Type: text/plain, Size: 1887 bytes --]
Hi Stefan,
just a heads-up, I've forwarded this to Brice Waegeneire, who I think is best
qualified to review and merge your work. He is working on PXE booting,
starting with regular x86_64 machines. So NFS root is totally something he
both needs and can help with.
Myself, I'm quite satisfied with your version, I'd just like there to be some
minimal tests of the functionality and that's pretty much it.
About the <nfs-share> record, if you think it's better without the record, we
can also do without--but I'd like to know Brice's opinion on it.
The idea was to have the record be something like
https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
if we could have used it. We can't use "nfsroot=" directly because we don't
have network drivers built into the kernel and instead use modules for those.
That also means that the initrd modules have to be automatically extended
by network card drivers, I guess.
So the initrd would basically emulate the fields of "nfsroot=" from the link
above.
So it would be <nfs-root> and would have fields like
server-ip
root-dir
nfs-options (a list)
You're right that having a <nfs-share> with just the host and directory does
not make much sense as a record. But we actually need to configure the
machine as a client in the network to be able to reach the nfs server,
right?
I guess we could ignore the problem and have the DHCP server do
it, and I'm all for it--but some use cases might need manual configuration,
too. Even then, is it possible to know which NFS protocol version to use
for the NFS root automatically? Even in your case, you don't actually
get the nfs IP from the DHCP server either, but you make the user pass it
by splicing it to some string, right?
So some kind of <nfs-root-client> or whatever record is necessary, I'd say.
@Brice: ?
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
@ 2020-05-01 20:32 Stefan
2020-05-10 8:20 ` Mathieu Othacehe
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-05-01 20:32 UTC (permalink / raw)
To: 41011
* gnu/bootloader/grub.scm (grub-efi-net-bootloader): New efi bootloader for
network booting via tftp/nfs and possibly images, prepared for chain loading.
(install-grub-efi-net): New bootloader installer for tftp and possibly images,
does not need root rights.
(grub-root-search): Adding support for tftp root.
(eye-candy): Enable gfxterm support for all systems.
* gnu/system.scm (read-boot-parameters): Prevent devices with ":/" from being
treated as a file system label.
---
gnu/bootloader/grub.scm | 107 +++++++++++++++++++++++++++++++---------
gnu/system.scm | 3 +-
2 files changed, 86 insertions(+), 24 deletions(-)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 190b717163..9ca4f016f6 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -23,7 +23,7 @@
(define-module (gnu bootloader grub)
#:use-module (guix records)
- #:use-module ((guix utils) #:select (%current-system))
+ #:use-module ((guix utils) #:select (%current-system %current-target-system))
#:use-module (guix gexp)
#:use-module (gnu artwork)
#:use-module (gnu bootloader)
@@ -53,6 +53,7 @@
grub-bootloader
grub-efi-bootloader
+ grub-efi-net-bootloader
grub-mkrescue-bootloader
grub-configuration))
@@ -142,34 +143,20 @@ WIDTH/HEIGHT, or #f if none was found."
#:width width #:height height))))
(define* (eye-candy config store-device store-mount-point
- #:key system port)
+ #:key port)
"Return a gexp that writes to PORT (a port-valued gexp) the
'grub.cfg' part concerned with graphics mode, background images, colors, and
all that. STORE-DEVICE designates the device holding the store, and
STORE-MOUNT-POINT is its mount point; these are used to determine where the
-background image and fonts must be searched for. SYSTEM must be the target
-system string---e.g., \"x86_64-linux\"."
+background image and fonts must be searched for."
(define setup-gfxterm-body
- (let ((gfxmode
- (or (and-let* ((theme (bootloader-configuration-theme config))
- (gfxmode (grub-gfxmode theme)))
- (string-join gfxmode ";"))
- "auto")))
-
- ;; Intel and EFI systems need to be switched into graphics mode, whereas
- ;; most other modern architectures have no other mode and therefore
- ;; don't need to be switched.
-
- ;; XXX: Do we really need to restrict to x86 systems? We could imitate
- ;; what the GRUB default configuration does and decide based on whether
- ;; a user provided 'gfxterm' in the terminal-outputs field of their
- ;; bootloader-configuration record.
- (if (string-match "^(x86_64|i[3-6]86)-" system)
- (format #f "
+ (format #f "
set gfxmode=~a
insmod all_video
- insmod gfxterm~%" gfxmode)
- "")))
+ insmod gfxterm~%"
+ (string-join
+ (grub-gfxmode (bootloader-theme config))
+ ";")))
(define (setup-gfxterm config font-file)
(if (memq 'gfxterm (bootloader-configuration-terminal-outputs config))
@@ -316,6 +303,9 @@ 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)
+ "set root=(tftp)")
((or #f (? string?))
#~(format #f "search --file --set ~a" #$file)))))
@@ -355,7 +345,6 @@ entries corresponding to old generations of the system."
(eye-candy config
(menu-entry-device (first all-entries))
(menu-entry-device-mount-point (first all-entries))
- #:system system
#:port #~port))
(define keyboard-layout-config
@@ -443,6 +432,68 @@ fi~%"))))
"--bootloader-id=Guix"
"--efi-directory" target-esp))))
+(define (install-grub-efi-net efi-subdir)
+ "Define a grub-efi bootloader installer for installation in EFI-SUBDIR,
+which is usually \"efi/guix\" or \"efi/boot\"."
+ (let* ((arch (car (string-split (or (%current-target-system)
+ (%current-system))
+ #\-)))
+ (efi-bootloader-link (string-append "boot"
+ (match arch
+ ("i686" "ia32")
+ ("x86_64" "x64")
+ ("armhf" "arm")
+ ("aarch64" "aa64")
+ ("riscv" "riscv32")
+ ("riscv64" "riscv64"))
+ ".efi"))
+ (efi-bootloader (string-append (match arch
+ ("i686" "i386")
+ ("x86_64" "x86_64")
+ ("armhf" "arm")
+ ("aarch64" "arm64")
+ ("riscv" "riscv32")
+ ("riscv64" "riscv64"))
+ "-efi/core.efi")))
+ #~(lambda (bootloader target mount-point)
+ "Install GRUB as e.g. \"bootx64.efi\" or \"bootarm64.efi\" \"into
+EFI-SUBDIR, which is usually \"efi/guix\" or \"efi/boot\" below the directory
+TARGET for the system whose root is mounted at MOUNT-POINT."
+ (let* ((mount-point-list (delete "" (string-split mount-point #\/)))
+ (target-list (delete "" (string-split target #\/)))
+ (net-dir
+ (string-append "/" (string-join (append
+ mount-point-list
+ target-list)
+ "/")))
+ (subdir #$efi-subdir)
+ (efi-bootloader-link
+ (string-append net-dir "/" subdir "/" #$efi-bootloader-link))
+ (store-name (car (delete "" (string-split bootloader #\/))))
+ (store
+ ;; Use target-list to construct a "../gnu" link with a correct
+ ;; number of "../" to the store.
+ (string-join (append (make-list (length target-list) "..")
+ (list store-name))
+ "/"))
+ (store-link (string-append net-dir "/" store-name)))
+ ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
+ ;; root partition.
+ (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+ (invoke/quiet (string-append bootloader "/bin/grub-mknetdir")
+ (string-append "--net-directory=" net-dir)
+ (string-append "--subdir=" subdir))
+ (catch 'system-error
+ (lambda () (delete-file efi-bootloader-link))
+ (lambda _ #f))
+ (symlink #$efi-bootloader
+ efi-bootloader-link)
+ (catch 'system-error
+ (lambda () (delete-file store-link))
+ (lambda _ #f))
+ (symlink store
+ store-link)))))
+
^L
;;;
@@ -464,6 +515,16 @@ fi~%"))))
(name 'grub-efi)
(package grub-efi)))
+(define* (grub-efi-net-bootloader #:key (target #f) (efi-subdir #f))
+ (let ((target (or target "boot"))
+ (efi-subdir (or efi-subdir "efi/boot")))
+ (bootloader
+ (inherit grub-bootloader)
+ (name 'grub-efi-net-bootloader)
+ (package grub-efi)
+ (installer (install-grub-efi-net efi-subdir))
+ (configuration-file (string-append target "/" efi-subdir "/grub.cfg")))))
+
(define* grub-mkrescue-bootloader
(bootloader
(inherit grub-efi-bootloader)
diff --git a/gnu/system.scm b/gnu/system.scm
index 29e622872d..540f0e4a9e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -297,7 +297,8 @@ file system labels."
((? string? device)
;; It used to be that we would not distinguish between labels and
;; device names. Try to infer the right thing here.
- (if (string-prefix? "/dev/" device)
+ (if (or (string-prefix? "/dev/" device)
+ (string-contains device ":/")) ; nfs
device
(file-system-label device)))))
--
2.26.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
2020-05-01 20:32 [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs Stefan
@ 2020-05-10 8:20 ` Mathieu Othacehe
2020-05-10 21:13 ` Stefan
0 siblings, 1 reply; 8+ messages in thread
From: Mathieu Othacehe @ 2020-05-10 8:20 UTC (permalink / raw)
To: Stefan; +Cc: 41011
Hello Stefan,
This patch does not apply here. Could you rebase it on top of master?
> -
> - ;; Intel and EFI systems need to be switched into graphics mode, whereas
> - ;; most other modern architectures have no other mode and therefore
> - ;; don't need to be switched.
> -
> - ;; XXX: Do we really need to restrict to x86 systems? We could imitate
> - ;; what the GRUB default configuration does and decide based on whether
> - ;; a user provided 'gfxterm' in the terminal-outputs field of their
> - ;; bootloader-configuration record.
> - (if (string-match "^(x86_64|i[3-6]86)-" system)
> - (format #f "
> + (format #f "
> set gfxmode=~a
> insmod all_video
> - insmod gfxterm~%" gfxmode)
> - "")))
> + insmod gfxterm~%"
> + (string-join
> + (grub-gfxmode (bootloader-theme config))
> + ";")))
Why not enable graphic mode only if 'gfxterm' is provided in
terminal-outputs fields, like suggested by the comment?
> + (efi-bootloader-link (string-append "boot"
> + (match arch
> + ("i686" "ia32")
> + ("x86_64" "x64")
> + ("armhf" "arm")
If cross-building for "arm-linux-gnueabihf", arch will be "arm" and
won't match anything here.
> + (catch 'system-error
> + (lambda () (delete-file efi-bootloader-link))
> + (lambda _ #f))
You can use "false-if-exception" here I think.
> + (symlink #$efi-bootloader
> + efi-bootloader-link)
> + (catch 'system-error
> + (lambda () (delete-file store-link))
> + (lambda _ #f))
Same here.
> +(define* (grub-efi-net-bootloader #:key (target #f) (efi-subdir #f))
#f if implicit if omitted.
> + (let ((target (or target "boot"))
> + (efi-subdir (or efi-subdir "efi/boot")))
It would be better to keep grub-efi-net-bootloader as a variable, like
all other bootloaders. You could default configuration-file to
"boot/efi/boot/grub.cfg" instead?
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
2020-05-10 8:20 ` Mathieu Othacehe
@ 2020-05-10 21:13 ` Stefan
2020-05-23 8:02 ` Mathieu Othacehe
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-05-10 21:13 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 41011
Hi Mathieu!
Thanks for your reply again! :-)
> Am 10.05.2020 um 10:20 schrieb Mathieu Othacehe <m.othacehe@gmail.com>:
>
> This patch does not apply here. Could you rebase it on top of master?
I’ll try.
>> - ;; Intel and EFI systems need to be switched into graphics mode, whereas
>> - ;; most other modern architectures have no other mode and therefore
>> - ;; don't need to be switched.
>> -
>> - ;; XXX: Do we really need to restrict to x86 systems? We could imitate
>> - ;; what the GRUB default configuration does and decide based on whether
>> - ;; a user provided 'gfxterm' in the terminal-outputs field of their
>> - ;; bootloader-configuration record.
>> - (if (string-match "^(x86_64|i[3-6]86)-" system)
>> - (format #f "
>> + (format #f "
>> set gfxmode=~a
>> insmod all_video
>> - insmod gfxterm~%" gfxmode)
>> - "")))
>> + insmod gfxterm~%"
>> + (string-join
>> + (grub-gfxmode (bootloader-theme config))
>> + ";")))
>
> Why not enable graphic mode only if 'gfxterm' is provided in
> terminal-outputs fields, like suggested by the comment?
Good point.
Looking into this topic it seem's questionable to me that the default of (bootloader-configuration (terminal-output …)) with '(gfxterm) is grub-specific. This doesn't make sense for other boot-loaders, e.g. U-Boot. I expect this to be changed in future. ;-)
>> + (efi-bootloader-link (string-append "boot"
>> + (match arch
>> + ("i686" "ia32")
>> + ("x86_64" "x64")
>> + ("armhf" "arm")
>
> If cross-building for "arm-linux-gnueabihf", arch will be "arm" and
> won't match anything here.
Good catch!
>> + (catch 'system-error
>> + (lambda () (delete-file efi-bootloader-link))
>> + (lambda _ #f))
>
> You can use "false-if-exception" here I think.
Nice trick.
>> + (symlink #$efi-bootloader
>> + efi-bootloader-link)
>> + (catch 'system-error
>> + (lambda () (delete-file store-link))
>> + (lambda _ #f))
>
> Same here.
Sure.
>> +(define* (grub-efi-net-bootloader #:key (target #f) (efi-subdir #f))
>
> #f if implicit if omitted.
I wasn’t aware of this.
>> + (let ((target (or target "boot"))
>> + (efi-subdir (or efi-subdir "efi/boot")))
>
> It would be better to keep grub-efi-net-bootloader as a variable, like
> all other bootloaders. You could default configuration-file to
> "boot/efi/boot/grub.cfg" instead?
Actually there is a problem with all this in guix: There is (bootloader (target …)), which gives the impression that one is able to freely chose a folder for the bootloader files. However, the path “/boot/grub.cfg” is kind of hard coded.
Yes, it’s kind of possible to inherit from grub-efi-bootloader and overwrite the (configuration-file) field. In a first step this seems to work. But when e.g. deleting a system generation, in guix/scripts/system.scm (reinstall-bootloader) there is this code:
;; Use the detected bootloader with default configuration.
;; It will be enough to allow the system to boot.
(bootloader-config (bootloader-configuration
(bootloader bootloader)))
It reads this information form /var/guix/profiles/system/parameters: (bootloader-name grub-efi-bootloader).
With this again the hard-coded path “/boot/grub.cfg” of is used, ignoring any value overwritten in (configuration-file).
Another issue is (install-dir (string-append mount-point "/boot")) in (install-grub-efi), which ignores any (configuration-file) setting, too – well, it has no access to that setting –, and implies at least “/boot” to be the prefix of (bootloader (target …)).
Beside the wish to avoid this hard-coded “/boot“ assumption, I made this a function with two parameters for two more reasons.
One is simply to suite my needs. The folder for my tftp server is not “boot” but “boot-nfs”. For my SBC I’m using different operating systems from time to time, e.g. LibreELEC. As I have bad experiences with unreliable micro SD cards and as an nfs root file system is nice for tinkering, I copy such operating systems onto my tftp/nfs server. This includes of corse their “boot” folder. The build-in update functionalities overwrite stuff inside there. But I need to modify stuff for network booting. To not loose these modifications during updates and for later comparisons I keep such modifications in a copy as “boot-nfs”.
The other reason is that I’m not sure, if the efi-dir for network booting should be “efi/Guix” instead of “efi/boot” in other constellations. U-Boot expects “efi/boot“ over tftp like for a removable media by default. I guess this can be changed with DNS options. Also for real UEFI firmware this might be configurable. I don’t know, so I don’t want these paths to be hard-coded.
However, digging up all this and now re-trying to delete a system generation, I get this error with my new boot-efi-net-bootloader as a function:
stefan@guix ~/development/guix$ sudo guix system delete-generations 151
/var/guix/profiles/system-151-link wird gelöscht
guix system: error: grub-efi-net-bootloader: no such bootloader
So thanks for your hint, it can’t be a function! (Not now …)
Bye
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
2020-05-10 21:13 ` Stefan
@ 2020-05-23 8:02 ` Mathieu Othacehe
2020-05-24 10:18 ` Stefan
0 siblings, 1 reply; 8+ messages in thread
From: Mathieu Othacehe @ 2020-05-23 8:02 UTC (permalink / raw)
To: Stefan; +Cc: 41011
Hello Stefan,
> Yes, it’s kind of possible to inherit from grub-efi-bootloader and overwrite the (configuration-file) field. In a first step this seems to work. But when e.g. deleting a system generation, in guix/scripts/system.scm (reinstall-bootloader) there is this code:
>
> ;; Use the detected bootloader with default configuration.
> ;; It will be enough to allow the system to boot.
> (bootloader-config (bootloader-configuration
> (bootloader bootloader)))
>
> It reads this information form /var/guix/profiles/system/parameters: (bootloader-name grub-efi-bootloader).
> With this again the hard-coded path “/boot/grub.cfg” of is used, ignoring any value overwritten in (configuration-file).
Oh, we need to fix that! It means that we would need to add a
"bootloader-configuration-file" field to <boot-parameters> record, is
that correct?
> Another issue is (install-dir (string-append mount-point "/boot")) in (install-grub-efi), which ignores any (configuration-file) setting, too – well, it has no access to that setting –, and implies at least “/boot” to be the prefix of (bootloader (target …)).
>
> Beside the wish to avoid this hard-coded “/boot“ assumption, I made this a function with two parameters for two more reasons.
Could it be an option to infer the bootloader installation directory and
the efi subdir from the install-grub-efi/install-grub-efi-net functions?
If TARGET is /boot-nfs/efi/Guix", could we suppose that the
boot-directory is "/boot-nfs" and the efi-subdir is "efi/Guix"?
The make-grub-efi-net-bootloader macro is a nice hack, but I fear that
it makes the bootloader configuration (even more) difficult.
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
2020-05-23 8:02 ` Mathieu Othacehe
@ 2020-05-24 10:18 ` Stefan
2020-06-06 13:30 ` Stefan
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-05-24 10:18 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 41011
Hi Mathieu!
> Am 23.05.2020 um 10:02 schrieb Mathieu Othacehe <othacehe@gnu.org>:
>
>> It reads this information form /var/guix/profiles/system/parameters: (bootloader-name grub-efi-bootloader).
>> With this again the hard-coded path “/boot/grub.cfg” is used, ignoring any value overwritten in (configuration-file).
>
> Oh, we need to fix that! It means that we would need to add a
> "bootloader-configuration-file" field to <boot-parameters> record, is
> that correct?
Yes, I would guess so. But I’m not sure, if the field bootloader-name can be dropped then from <boot-parameters>. But if, then we could probably also drop the field name from the <bootloader> record.
>> Another issue is (install-dir (string-append mount-point "/boot")) in (install-grub-efi), which ignores any (configuration-file) setting, too – well, it has no access to that setting –, and implies at least “/boot” to be the prefix of (bootloader (target …)).
>>
>> Beside the wish to avoid this hard-coded “/boot“ assumption, I made this a function with two parameters for two more reasons.
>
> Could it be an option to infer the bootloader installation directory and
> the efi subdir from the install-grub-efi/install-grub-efi-net functions?
> If TARGET is /boot-nfs/efi/Guix", could we suppose that the
> boot-directory is "/boot-nfs" and the efi-subdir is "efi/Guix"?
For the new install-grub-efi-net I see first of all no issue in keeping it a function. This gives the needed flexibility.
For the existing grub-efi-bootloader the assumption seems to be that there will always be a /boot/grub.cfg. This is just not stated in the documentation. But it gave me the impression that there is some control about it with (bootloader (target …) …). But this is not the case. For the legacy grub-bootlouder the (bootloader (target …) …) needs to be a device, and the /boot/grub.cfg is implied and hard coded as well.
Actually thinking about it again, mounting the efi partition at e.g. /foo/efi, doesn't brake anything in the first place. Then GRUB will be installed at the target /foo/efi, basically into the efi partition it belongs. It will just read its configuration from /boot/grub.cfg, from a different partition.
The actual difference to the new grub-efi-net-bootloader is that it has only TFTP access to its files and its configuration file; there is only one place to lookup both, instead of two partitions in case of the grub-efi-bootloader.
For deleting system generations the path to the always present, not configurable /boot/grub.cfg is looked up. This works for the existing grub-efi-bootloader and grub-bootloader. But it does not work for the grub-efi-net-bootloader, because its configuration file does not live at /boot/grub.cfg, as its path is now implicitly configurable via (bootloader (target …) …). In addition for my setup I used a /boot-nfs folder instead of a /boot folder, and saw no benefit then in keeping the /boot folder.
I think there is a second possibility. It may be possible to create a symlink from /boot-nfs/efi/boot/grub.cfg to ../../../boot/grub.cfg. Then the assumption that there will always be a /boot/grub.cfg file stays valid.
But personally I do not like this idea.
In <boot-parameters> it seems – but I’m not sure yet – that we only keep a symbol name to figure out the path to the grub.cfg, although it is possible to just put that path directly there instead. And using the symbol makes it hard do get a configurable bootloader: A new bootloader has to be a variable, tricks with macros come up. Also inheriting from a bootloader and overwriting the configuration-file field – for whatever reason – is problematic: It seems to work at the beginning, but only fails badly when removing a system generation. It seems to have subtle bugs. It’s not usable like other parts in guix. It’s not hackable. I’d really prefer to change this.
> The make-grub-efi-net-bootloader macro is a nice hack, but I fear that
> it makes the bootloader configuration (even more) difficult.
At least it gives me the flexibility which was missing so far. I suggest to keep it for the moment and do a different patch once we are clear which way to go. If we add a bootloader-configuration-file field to the <boot-parameters> record, than the macro can be removed anyway.
Bye
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
2020-05-24 10:18 ` Stefan
@ 2020-06-06 13:30 ` Stefan
2020-06-06 13:33 ` Stefan
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-06-06 13:30 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 41011
Hi Mathieu!
I changed my mind. I think it is better in a first step to keep the convention to have a fixed /boot/grub/grub.cfg. Therefore I create another link at /<target>/efi/boot/grub.cfg pointing to that file. Then there is no trouble with the <boot-parameters> yet, and the grub-efi-net-bootloader doesn't need to know about the target directory before installation.
I removed the macro as well, hence fixing the path to efi/boot. To boot different systems – because of the grub.cfg link – there needs to be some redirection via PXE or DNS on some higher level. With the macro you could have several /<target>/efi/Guix<n> directories on the same tftp server, but their grub.cfg link would still all point to the same location: ../../../boot/grub/grub. So the macro makes no sense anymore.
Bye
Stefan
^ permalink raw reply [flat|nested] 8+ messages in thread
* [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs.
2020-06-06 13:30 ` Stefan
@ 2020-06-06 13:33 ` Stefan
2020-06-06 17:37 ` Danny Milosavljevic
0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2020-06-06 13:33 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 41011
* gnu/bootloader/grub.scm (grub-efi-net-bootloader): New efi bootloader for
network booting via tftp/nfs.
(install-grub-efi-net): New bootloader installer for tftp.
(grub-root-search): Adding support for tftp root.
(eye-candy): Use 'gfxterm' for all systems if selected via 'terminal-outputs'.
* gnu/system.scm (read-boot-parameters): Prevent devices with ":/" from being
treated as a file system label.
* gnu/build/linux-boot.scm (device-string->file-system-device): Prevent devices
with ":/" from being treated as a file system label.
---
gnu/bootloader/grub.scm | 127 +++++++++++++++++++++++++++------------
gnu/build/linux-boot.scm | 1 +
gnu/system.scm | 3 +-
3 files changed, 93 insertions(+), 38 deletions(-)
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 2d9a39afc3..60b3a12037 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -23,7 +23,7 @@
(define-module (gnu bootloader grub)
#:use-module (guix records)
- #:use-module ((guix utils) #:select (%current-system))
+ #:use-module ((guix utils) #:select (%current-system %current-target-system))
#:use-module (guix gexp)
#:use-module (gnu artwork)
#:use-module (gnu bootloader)
@@ -47,6 +47,8 @@
grub-bootloader
grub-efi-bootloader
+ make-grub-efi-net-bootloader
+ grub-efi-net-bootloader
grub-mkrescue-bootloader
grub-minimal-bootloader
@@ -135,41 +137,25 @@ file with the resolution provided in CONFIG."
(_ #f)))))
(define* (eye-candy config store-device store-mount-point
- #:key store-directory-prefix system port)
+ #:key store-directory-prefix port)
"Return a gexp that writes to PORT (a port-valued gexp) the 'grub.cfg' part
concerned with graphics mode, background images, colors, and all that.
STORE-DEVICE designates the device holding the store, and STORE-MOUNT-POINT is
its mount point; these are used to determine where the background image and
-fonts must be searched for. SYSTEM must be the target system string---e.g.,
-\"x86_64-linux\". STORE-DIRECTORY-PREFIX is a directory prefix to prepend to
-any store file name."
- (define setup-gfxterm-body
- (let ((gfxmode
- (or (and-let* ((theme (bootloader-configuration-theme config))
- (gfxmode (grub-theme-gfxmode theme)))
- (string-join gfxmode ";"))
- "auto")))
-
- ;; Intel and EFI systems need to be switched into graphics mode, whereas
- ;; most other modern architectures have no other mode and therefore
- ;; don't need to be switched.
-
- ;; XXX: Do we really need to restrict to x86 systems? We could imitate
- ;; what the GRUB default configuration does and decide based on whether
- ;; a user provided 'gfxterm' in the terminal-outputs field of their
- ;; bootloader-configuration record.
- (if (string-match "^(x86_64|i[3-6]86)-" system)
- (format #f "
- set gfxmode=~a
- insmod all_video
- insmod gfxterm~%" gfxmode)
- "")))
-
+fonts must be searched for. STORE-DIRECTORY-PREFIX is a directory prefix to
+prepend to any store file name."
(define (setup-gfxterm config font-file)
(if (memq 'gfxterm (bootloader-configuration-terminal-outputs config))
- #~(format #f "if loadfont ~a; then
- setup_gfxterm
-fi~%" #+font-file)
+ #~(format #f "
+if loadfont ~a; then
+ set gfxmode=~a
+ insmod all_video
+ insmod gfxterm
+fi~%"
+ #$font-file
+ #$(string-join
+ (grub-theme-gfxmode (bootloader-theme config))
+ ";"))
""))
(define (theme-colors type)
@@ -190,8 +176,6 @@ fi~%" #+font-file)
(and image
#~(format #$port "
-function setup_gfxterm {~a}
-
# Set 'root' to the partition that contains /gnu/store.
~a
@@ -206,7 +190,6 @@ else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi~%"
- #$setup-gfxterm-body
#$(grub-root-search store-device font-file)
#$(setup-gfxterm config font-file)
#$(grub-setup-io config)
@@ -313,6 +296,9 @@ 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)
+ "set root=(tftp)")
((or #f (? string?))
#~(format #f "search --file --set ~a" #$file)))))
@@ -358,7 +344,6 @@ when booting a root file system on a Btrfs subvolume."
(menu-entry-device (first all-entries))
(menu-entry-device-mount-point (first all-entries))
#:store-directory-prefix store-directory-prefix
- #:system system
#:port #~port))
(define keyboard-layout-config
@@ -498,11 +483,73 @@ fi~%"))))
"--bootloader-id=Guix"
"--efi-directory" target-esp))))
+(define (install-grub-efi-net subdir)
+ "Define a grub-efi bootloader installer for installation in SUBDIR,
+which is usually \"efi/boot\" or \"efi/Guix\"."
+ (let* ((arch (car (string-split (or (%current-target-system)
+ (%current-system))
+ #\-)))
+ (efi-bootloader-link (string-append "/boot"
+ (match arch
+ ("i686" "ia32")
+ ("x86_64" "x64")
+ ("arm" "arm")
+ ("armhf" "arm")
+ ("aarch64" "aa64")
+ ("riscv" "riscv32")
+ ("riscv64" "riscv64"))
+ ".efi"))
+ (efi-bootloader (string-append (match arch
+ ("i686" "i386")
+ ("x86_64" "x86_64")
+ ("arm" "arm")
+ ("armhf" "arm")
+ ("aarch64" "arm64")
+ ("riscv" "riscv32")
+ ("riscv64" "riscv64"))
+ "-efi/core.efi")))
+ #~(lambda (bootloader target mount-point)
+ "Install GRUB as e.g. \"bootx64.efi\" or \"bootarm64.efi\" \"into
+SUBDIR, which is usually \"efi/boot\" or \"efi/Guix\" below the directory TARGET
+for the system whose root is mounted at MOUNT-POINT."
+ (let* (;; Use target-depth and subdir-depth to construct links to
+ ;; "../gnu" and "../../../boot/grub/grub.cfg" with the correct
+ ;; number of "../". Note: This doesn't consider ".." or ".",
+ ;; which may appear inside target or subdir.
+ (target-depth (length (delete "" (string-split target #\/))))
+ (subdir-depth (length (delete "" (string-split #$subdir #\/))))
+ (up1 (string-join (make-list target-depth "..") "/" 'suffix))
+ (up2 (string-join (make-list subdir-depth "..") "/" 'suffix))
+ (net-dir (string-append mount-point target "/"))
+ (store-name (car (delete "" (string-split bootloader #\/))))
+ (store (string-append up1 store-name))
+ (store-link (string-append net-dir store-name))
+ (grub-cfg (string-append up1 up2 "boot/grub/grub.cfg"))
+ (grub-cfg-link (string-append net-dir #$subdir "/grub.cfg"))
+ (efi-bootloader-link
+ (string-append net-dir #$subdir #$efi-bootloader-link)))
+ ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
+ ;; root partition.
+ (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+ (invoke/quiet (string-append bootloader "/bin/grub-mknetdir")
+ (string-append "--net-directory=" net-dir)
+ (string-append "--subdir=" #$subdir))
+ (false-if-exception (delete-file store-link))
+ (symlink store store-link)
+ (false-if-exception (delete-file grub-cfg-link))
+ (symlink grub-cfg grub-cfg-link)
+ (false-if-exception (delete-file efi-bootloader-link))
+ (symlink #$efi-bootloader efi-bootloader-link)))))
+
^L
;;;
;;; Bootloader definitions.
;;;
+;;; For all these grub-bootloader variables the path to /boot/grub/grub.cfg
+;;; is fixed. Inheriting and overwriting the field 'configuration-file' will
+;;; break 'guix system delete-generations', 'guix system switch-generation',
+;;; and 'guix system roll-back'.
(define grub-bootloader
(bootloader
@@ -513,12 +560,12 @@ fi~%"))))
(configuration-file "/boot/grub/grub.cfg")
(configuration-file-generator grub-configuration-file)))
-(define* grub-minimal-bootloader
+(define grub-minimal-bootloader
(bootloader
(inherit grub-bootloader)
(package grub-minimal)))
-(define* grub-efi-bootloader
+(define grub-efi-bootloader
(bootloader
(inherit grub-bootloader)
(installer install-grub-efi)
@@ -526,7 +573,13 @@ fi~%"))))
(name 'grub-efi)
(package grub-efi)))
-(define* grub-mkrescue-bootloader
+(define grub-efi-net-bootloader
+ (bootloader
+ (inherit grub-efi-bootloader)
+ (name 'grub-efi-net-bootloader)
+ (installer (install-grub-efi-net "efi/boot"))))
+
+(define grub-mkrescue-bootloader
(bootloader
(inherit grub-efi-bootloader)
(package grub-hybrid)))
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index f08bb11514..3a79cfd461 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -503,6 +503,7 @@ upon error."
;; string, but the string can represent a device, a UUID, or a
;; label. So check for all three.
(cond ((string-prefix? "/" device-string) device-string)
+ ((string-contains device-string ":/") device-string)
((uuid device-string) => identity)
(else (file-system-label device-string))))
diff --git a/gnu/system.scm b/gnu/system.scm
index ac8bbd1d16..91caba7012 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -301,7 +301,8 @@ file system labels."
((? string? device)
;; It used to be that we would not distinguish between labels and
;; device names. Try to infer the right thing here.
- (if (string-prefix? "/dev/" device)
+ (if (or (string-prefix? "/dev/" device)
+ (string-contains device ":/")) ; nfs
device
(file-system-label device)))))
--
2.26.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-07-21 14:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 23:37 [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device Stefan
2020-06-21 9:35 ` Mathieu Othacehe
2020-07-01 18:48 ` Stefan
2020-07-01 18:48 ` Stefan
2020-07-18 13:55 ` Stefan
2020-07-21 14:33 ` Danny Milosavljevic
-- strict thread matches above, loose matches on Subject: below --
2020-05-01 20:32 [bug#41011] [PATCH] gnu: grub: Support for network boot via tftp/nfs Stefan
2020-05-10 8:20 ` Mathieu Othacehe
2020-05-10 21:13 ` Stefan
2020-05-23 8:02 ` Mathieu Othacehe
2020-05-24 10:18 ` Stefan
2020-06-06 13:30 ` Stefan
2020-06-06 13:33 ` Stefan
2020-06-06 17:37 ` Danny Milosavljevic
[not found] ` <46CD97B3-9994-4AB7-AA7D-4DE39AB7A238@vodafonemail.de>
2020-06-09 13:44 ` Danny Milosavljevic
2020-06-11 4:21 ` Maxim Cournoyer
2020-06-11 23:43 ` [bug#41820] [PATCH] file-systems: Add record type <nfs-share> for a file system device Stefan
2020-06-20 13:52 ` Stefan
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.