diff options
Diffstat (limited to 'gnu/build')
-rw-r--r-- | gnu/build/file-systems.scm | 4 | ||||
-rw-r--r-- | gnu/build/linux-boot.scm | 14 | ||||
-rw-r--r-- | gnu/build/linux-container.scm | 14 | ||||
-rw-r--r-- | gnu/build/marionette.scm | 7 | ||||
-rw-r--r-- | gnu/build/vm.scm | 8 |
5 files changed, 33 insertions, 14 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 3e516a4d3c..145b3b14e7 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -261,11 +261,11 @@ volume descriptor from ~s" "Return the raw contents of DEVICE's iso9660 primary volume descriptor as a bytevector, or #f if DEVICE does not contain an iso9660 file system." ;; Start reading at sector 16. - ;; Since we are not sure that the device contains an ISO9660 filesystem, + ;; Since we are not sure that the device contains an ISO9660 file system, ;; we have to find that out first. (if (read-superblock device (* 2048 16) 2048 iso9660-superblock?) (read-iso9660-primary-volume-descriptor device (* 2048 16)) - #f)) ; Device does not contain an iso9660 filesystem. + #f)) ; Device does not contain an iso9660 file system. (define (iso9660-superblock-uuid sblock) "Return the modification time of an iso9660 primary volume descriptor diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 997107a67a..18d87260a9 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -37,11 +37,11 @@ #:export (mount-essential-file-systems linux-command-line find-long-option + find-long-options make-essential-device-nodes make-static-device-nodes configure-qemu-networking - bind-mount device-number boot-system)) @@ -99,6 +99,16 @@ Return the value associated with OPTION, or #f on failure." (lambda (arg) (substring arg (+ 1 (string-index arg #\=))))))) +(define (find-long-options option arguments) + "Find OPTIONs among ARGUMENTS, where OPTION is something like \"console\". +Return the values associated with OPTIONs as a list, or the empty list if +OPTION doesn't appear in ARGUMENTS." + (let ((opt (string-append option "="))) + (filter-map (lambda (arg) + (and (string-prefix? opt arg) + (substring arg (+ 1 (string-index arg #\=))))) + arguments))) + (define* (make-disk-device-nodes base major #:optional (minor 0)) "Make the block device nodes around BASE (something like \"/root/dev/sda\") with the given MAJOR number, starting with MINOR." @@ -188,7 +198,7 @@ with the given MAJOR number, starting with MINOR." (lambda args (apply report-system-error name args)))) -;; Create a device node like the <device-node> passed here on the filesystem. +;; Create a device node like the <device-node> passed here on the file system. (define create-device-node (match-lambda (($ <device-node> xname type major minor module) diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm index 70e789403f..65e1325577 100644 --- a/gnu/build/linux-container.scm +++ b/gnu/build/linux-container.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 David Thompson <davet@gnu.org> -;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -61,9 +61,14 @@ exists." (const #t) (lambda () (thunk) - (primitive-exit 0)) + + ;; XXX: Somehow we sometimes get EBADF from write(2) or close(2) upon + ;; exit (coming from fd finalizers) when used by the Shepherd. To work + ;; around that, exit forcefully so fd finalizers don't have a chance to + ;; run and fail. + (primitive-_exit 0)) (lambda () - (primitive-exit 1)))) + (primitive-_exit 1)))) (define (purify-environment) "Unset all environment variables." @@ -335,7 +340,8 @@ return the exit status." (match (container-excursion pid (lambda () (close-port in) - (write (thunk) out))) + (write (thunk) out) + (close-port out))) (0 (close-port out) (let ((result (read in))) diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 7554a710a0..173a67cef9 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -97,8 +97,11 @@ QEMU monitor and to the guest's backdoor REPL." "-monitor" (string-append "unix:" socket-directory "/monitor") "-chardev" (string-append "socket,id=repl,path=" socket-directory "/repl") + + ;; See + ;; <http://www.linux-kvm.org/page/VMchannel_Requirements#Invocation>. "-device" "virtio-serial" - "-device" "virtconsole,chardev=repl")) + "-device" "virtserialport,chardev=repl,name=org.gnu.guix.port.0")) (define (accept* port) (match (select (list port) '() (list port) timeout) diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 404f324045..fe003ea458 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm @@ -262,7 +262,7 @@ actual /dev name based on DEVICE." (define* (create-ext-file-system partition type #:key label uuid) - "Create an ext-family filesystem of TYPE on PARTITION. If LABEL is true, + "Create an ext-family file system of TYPE on PARTITION. If LABEL is true, use that as the volume name. If UUID is true, use it as the partition UUID." (format #t "creating ~a partition...\n" type) (unless (zero? (apply system* (string-append "mkfs." type) @@ -277,8 +277,8 @@ use that as the volume name. If UUID is true, use it as the partition UUID." (define* (create-fat-file-system partition #:key label uuid) - "Create a FAT filesystem on PARTITION. The number of File Allocation Tables -will be determined based on filesystem size. If LABEL is true, use that as the + "Create a FAT file system on PARTITION. The number of File Allocation Tables +will be determined based on file system size. If LABEL is true, use that as the volume name." ;; FIXME: UUID is ignored! (format #t "creating FAT partition...\n") @@ -425,7 +425,7 @@ GRUB configuration and OS-DRV as the stuff in it." "run=/tmp/root/run" ;; /mnt is used as part of the installation ;; process, as the mount point for the target - ;; filesystem, so create it. + ;; file system, so create it. "mnt=/tmp/root/mnt" "--" "-volid" ,(string-upcase volume-id) |