From d4c87617e5c0c50573019e4621ed318489cf209a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 2 Jun 2014 23:58:50 +0200 Subject: system: File system sources can be marked as labels or devices. * gnu/system/file-systems.scm ()[title]: New field. * gnu/services/base.scm (file-system-service): Add #:title parameter. In 'start' gexp, use 'canonicalize-device-spec' and honor TITLE. * gnu/system.scm (other-file-system-services, operating-system-root-file-system, operating-system-initrd-file): Adjust accordingly. * gnu/system/linux-initrd.scm (file-system->spec): Likewise. * gnu/system/vm.scm (system-disk-image): Add 'title' field for the root file system. * guix/build/linux-initrd.scm (mount-file-system): Expect the second element of SPEC to be the title. (boot-system)[root-mount-point?, root-fs-type]: Likewise. * gnu/services/dmd.scm (dmd-configuration-file): Select 'canonicalize-device-spec'. --- guix/build/linux-initrd.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm index 05f6bf14bf..c1a0247aff 100644 --- a/guix/build/linux-initrd.scm +++ b/guix/build/linux-initrd.scm @@ -37,6 +37,7 @@ (define-module (guix build linux-initrd) disk-partitions partition-label-predicate find-partition-by-label + canonicalize-device-spec check-file-system mount-file-system @@ -485,7 +486,7 @@ (define* (mount-file-system spec #:key (root "/root")) "Mount the file system described by SPEC under ROOT. SPEC must have the form: - (DEVICE MOUNT-POINT TYPE (FLAGS ...) OPTIONS CHECK?) + (DEVICE TITLE MOUNT-POINT TYPE (FLAGS ...) OPTIONS CHECK?) DEVICE, MOUNT-POINT, and TYPE must be strings; OPTIONS can be a string or #f; FLAGS must be a list of symbols. CHECK? is a Boolean indicating whether to @@ -500,8 +501,8 @@ (define flags->bit-mask 0))) (match spec - ((source mount-point type (flags ...) options check?) - (let ((source (canonicalize-device-spec source)) + ((source title mount-point type (flags ...) options check?) + (let ((source (canonicalize-device-spec source title)) (mount-point (string-append root "/" mount-point))) (when check? (check-file-system source type)) @@ -596,12 +597,12 @@ (define (resolve file) (define root-mount-point? (match-lambda - ((device "/" _ ...) #t) + ((device _ "/" _ ...) #t) (_ #f))) (define root-fs-type (or (any (match-lambda - ((device "/" type _ ...) type) + ((device _ "/" type _ ...) type) (_ #f)) mounts) "ext4")) -- cgit v1.2.3