summaryrefslogtreecommitdiff
path: root/gnu/system.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2017-10-07 12:54:40 +0200
committerMarius Bakke <mbakke@fastmail.com>2017-10-07 12:54:40 +0200
commitad3a937dae2586aa5a66ceed32a1c2005ee486c9 (patch)
treeb44dd9e8bf4e2772c566086fbb7e8fbf30533473 /gnu/system.scm
parent6a317919cf0f9dbc651a4a41f9ed99c49bf2d543 (diff)
parent3ae76f7f57706cf5cc4144d4ff62968e3d4c3aa4 (diff)
downloadpatches-ad3a937dae2586aa5a66ceed32a1c2005ee486c9.tar
patches-ad3a937dae2586aa5a66ceed32a1c2005ee486c9.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/system.scm')
-rw-r--r--gnu/system.scm15
1 files changed, 9 insertions, 6 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index 8ab4801b74..0e834ba5ed 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -231,6 +231,14 @@ directly by the user."
(kernel-arguments boot-parameters-kernel-arguments)
(initrd boot-parameters-initrd))
+(define (ensure-not-/dev device)
+ "If DEVICE starts with a slash, return #f. This is meant to filter out
+Linux device names such as /dev/sda, and to preserve GRUB device names and
+file system labels."
+ (if (and (string? device) (string-prefix? "/" device))
+ #f
+ device))
+
(define (read-boot-parameters port)
"Read boot parameters from PORT and return the corresponding
<boot-parameters> object or #f if the format is unrecognized."
@@ -243,11 +251,6 @@ directly by the user."
((? string? device)
device)))
- (define (ensure-not-/dev device)
- (if (and (string? device) (string-prefix? "/" device))
- #f
- device))
-
(match (read port)
(('boot-parameters ('version 0)
('label label) ('root-device root)
@@ -939,7 +942,7 @@ kernel arguments for that derivation to <boot-parameters>."
(operating-system-user-kernel-arguments os)))
(initrd initrd)
(bootloader-name bootloader-name)
- (store-device (fs->boot-device store))
+ (store-device (ensure-not-/dev (fs->boot-device store)))
(store-mount-point (file-system-mount-point store))))))
(define (device->sexp device)