From f453f637d5410f4d1e0b3787caa8d34b9b72d7d8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 1 Jan 2016 22:45:58 +0100 Subject: system: Allow the root file system to be named by UUID. * gnu/build/file-systems.scm (canonicalize-device-spec)[canonical-title]: Use 'string->uuid' to check whether SPEC is a UUID. When SPEC is a string and CANONICAL-TITLE is 'uuid, call 'string->uuid'. * gnu/system.scm (operating-system-grub.cfg): Add 'root-device' variable and use it for the "--root=" argument. --- gnu/system.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index acb7f15e4e..6dfcc0fe3a 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -673,12 +673,14 @@ listed in OS. The C library expects to find it under ((system (operating-system-derivation os)) (root-fs -> (operating-system-root-file-system os)) (kernel -> (operating-system-kernel os)) + (root-device -> (if (eq? 'uuid (file-system-title root-fs)) + (uuid->string (file-system-device root-fs)) + (file-system-device root-fs))) (entries -> (list (menu-entry (label (kernel->grub-label kernel)) (linux kernel) (linux-arguments - (cons* (string-append "--root=" - (file-system-device root-fs)) + (cons* (string-append "--root=" root-device) #~(string-append "--system=" #$system) #~(string-append "--load=" #$system "/boot") -- cgit v1.2.3