From 03ddfaf5fb5fab78f7180089158bea0494072b3c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 3 May 2014 12:16:10 +0200 Subject: vm: Make root file system type a parameter, and default to ext4. * gnu/system/vm.scm (qemu-image): Add #:file-system-type parameter. Pass it to 'initialize-hard-disk'. * guix/build/linux-initrd.scm (mount-root-file-system): Always honor TYPE. (boot-system): Change #:root-fs-type to default to "ext4". Update docstring. * guix/build/vm.scm (initialize-hard-disk): Remove #:mkfs parameter; add #:file-system-type. Adjust 'mkfs' invocation and 'mount' call to honor #:file-system-type. --- guix/build/linux-initrd.scm | 7 +++++-- guix/build/vm.scm | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'guix/build') diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm index 1e0d6e27ec..fd6c0c4673 100644 --- a/guix/build/linux-initrd.scm +++ b/guix/build/linux-initrd.scm @@ -212,7 +212,7 @@ UNIONFS." "/rw-root=RW:/real-root=RO" "/root")) (error "unionfs failed"))) - (mount root "/root" "ext3"))) + (mount root "/root" type))) (lambda args (format (current-error-port) "exception while mounting '~a': ~s~%" root args) @@ -249,7 +249,7 @@ FLAGS must be a list of symbols." qemu-guest-networking? guile-modules-in-chroot? volatile-root? unionfs - (root-fs-type "ext3") + (root-fs-type "ext4") (mounts '())) "This procedure is meant to be called from an initrd. Boot a system by first loading LINUX-MODULES, then setting up QEMU guest networking if @@ -257,6 +257,9 @@ QEMU-GUEST-NETWORKING? is true, mounting the file systems specified in MOUNTS, and finally booting into the new root if any. The initrd supports kernel command-line options '--load', '--root', and '--repl'. +Mount the root file system, of type ROOT-FS-TYPE, specified by the '--root' +command-line argument, if any. + MOUNTS must be a list suitable for 'mount-file-system'. When GUILE-MODULES-IN-CHROOT? is true, make core Guile modules available in diff --git a/guix/build/vm.scm b/guix/build/vm.scm index 33c898d968..1d1abad1dd 100644 --- a/guix/build/vm.scm +++ b/guix/build/vm.scm @@ -183,7 +183,7 @@ as created and modified at the Epoch." (define* (initialize-hard-disk #:key grub.cfg disk-image-size - (mkfs "mkfs.ext3") + (file-system-type "ext4") initialize-store? (closures-to-copy '()) (directives '())) @@ -192,13 +192,14 @@ as created and modified at the Epoch." (- disk-image-size (* 5 (expt 2 20)))) (error "failed to create partition table")) - (display "creating ext3 partition...\n") - (unless (zero? (system* mkfs "-F" "/dev/sda1")) + (format #t "creating ~a partition...\n" file-system-type) + (unless (zero? (system* (string-append "mkfs." file-system-type) + "-F" "/dev/sda1")) (error "failed to create partition")) (display "mounting partition...\n") (mkdir "/fs") - (mount "/dev/sda1" "/fs" "ext3") + (mount "/dev/sda1" "/fs" file-system-type) (when (pair? closures-to-copy) ;; Populate the store. -- cgit v1.2.3