summary refs log tree commit diff
path: root/gnu/system
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-03-18 01:09:25 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-03-18 01:09:25 +0100
commit7ace97395feedc4b3ec23be65f2ed63f29aac9a9 (patch)
tree768956fa30fc7b21e4e4715eafbb10dab32b2847 /gnu/system
parenta248a9ac6a67213b177ab5ba9ec270638c9dd002 (diff)
parentbe5ed142135e939cd23fcfe88c553fd28b32ac53 (diff)
downloadguix-7ace97395feedc4b3ec23be65f2ed63f29aac9a9.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/install.scm4
-rw-r--r--gnu/system/linux-initrd.scm36
-rw-r--r--gnu/system/mapped-devices.scm51
3 files changed, 52 insertions, 39 deletions
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 97f5abe0b6..920d215272 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -214,7 +214,9 @@ You have been warned.  Thanks for being so brave.\x1b[0m
     (define bare-bones-os
       (load "examples/bare-bones.tmpl"))
 
-    (list (mingetty-service (mingetty-configuration
+    (list (service virtual-terminal-service-type)
+
+          (mingetty-service (mingetty-configuration
                              (tty "tty1")
                              (auto-login "root")))
 
diff --git a/gnu/system/linux-initrd.scm b/gnu/system/linux-initrd.scm
index 1eb5f5130d..e0cb59c009 100644
--- a/gnu/system/linux-initrd.scm
+++ b/gnu/system/linux-initrd.scm
@@ -24,7 +24,6 @@
   #:use-module (guix store)
   #:use-module (guix gexp)
   #:use-module (guix utils)
-  #:use-module (guix i18n)
   #:use-module ((guix store)
                 #:select (%store-prefix))
   #:use-module ((guix derivations)
@@ -38,22 +37,16 @@
                 #:select (%guile-static-stripped))
   #:use-module (gnu system file-systems)
   #:use-module (gnu system mapped-devices)
-  #:autoload   (gnu build linux-modules)
-                 (device-module-aliases matching-modules)
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 vlist)
-  #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
-  #:use-module (srfi srfi-34)
-  #:use-module (srfi srfi-35)
   #:export (expression->initrd
             %base-initrd-modules
             raw-initrd
             file-system-packages
-            base-initrd
-            check-device-initrd-modules))
+            base-initrd))
 
 
 ;;; Commentary:
@@ -350,31 +343,4 @@ loaded at boot time in the order in which they appear."
               #:volatile-root? volatile-root?
               #:on-error on-error))
 
-(define (check-device-initrd-modules device linux-modules location)
-  "Raise an error if DEVICE needs modules beyond LINUX-MODULES to operate.
-DEVICE must be a \"/dev\" file name."
-  (let ((modules (delete-duplicates
-                  (append-map matching-modules
-                              (device-module-aliases device)))))
-    (unless (every (cute member <> linux-modules) modules)
-      (raise (condition
-              (&message
-               (message (format #f (G_ "you may need these modules \
-in the initrd for ~a:~{ ~a~}")
-                                device modules)))
-              (&fix-hint
-               (hint (format #f (G_ "Try adding them to the
-@code{initrd-modules} field of your @code{operating-system} declaration, along
-these lines:
-
-@example
- (operating-system
-   ;; @dots{}
-   (initrd-modules (append (list~{ ~s~})
-                           %base-initrd-modules)))
-@end example\n")
-                             modules)))
-              (&error-location
-               (location (source-properties->location location))))))))
-
 ;;; linux-initrd.scm ends here
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index e6ac635231..a2cca0a93b 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
-;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2017, 2018 Mark H Weaver <mhw@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,13 +25,14 @@
   #:use-module (guix i18n)
   #:use-module ((guix utils)
                 #:select (source-properties->location
+                          &fix-hint
                           &error-location))
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu system uuid)
-  #:use-module ((gnu system linux-initrd)
-                #:select (check-device-initrd-modules))
   #:autoload   (gnu build file-systems) (find-partition-by-luks-uuid)
+  #:autoload   (gnu build linux-modules)
+                 (device-module-aliases matching-modules known-module-aliases)
   #:autoload   (gnu packages cryptsetup) (cryptsetup-static)
   #:autoload   (gnu packages linux) (mdadm-static)
   #:use-module (srfi srfi-1)
@@ -55,6 +56,8 @@
             device-mapping-service-type
             device-mapping-service
 
+            check-device-initrd-modules           ;XXX: needs a better place
+
             luks-device-mapping
             raid-device-mapping))
 
@@ -108,6 +111,48 @@
 
 
 ;;;
+;;; Static checks.
+;;;
+
+(define (check-device-initrd-modules device linux-modules location)
+  "Raise an error if DEVICE needs modules beyond LINUX-MODULES to operate.
+DEVICE must be a \"/dev\" file name."
+  (define aliases
+    ;; Attempt to load 'modules.alias' from the current kernel, assuming we're
+    ;; on GuixSD, and assuming that corresponds to the kernel we'll be
+    ;; installing.  Skip the whole thing if that file cannot be read.
+    (catch 'system-error
+      (lambda ()
+        (known-module-aliases))
+      (const #f)))
+
+  (when aliases
+    (let ((modules (delete-duplicates
+                    (append-map (cut matching-modules <> aliases)
+                                (device-module-aliases device)))))
+      (unless (every (cute member <> linux-modules) modules)
+        (raise (condition
+                (&message
+                 (message (format #f (G_ "you may need these modules \
+in the initrd for ~a:~{ ~a~}")
+                                  device modules)))
+                (&fix-hint
+                 (hint (format #f (G_ "Try adding them to the
+@code{initrd-modules} field of your @code{operating-system} declaration, along
+these lines:
+
+@example
+ (operating-system
+   ;; @dots{}
+   (initrd-modules (append (list~{ ~s~})
+                           %base-initrd-modules)))
+@end example\n")
+                               modules)))
+                (&error-location
+                 (location (source-properties->location location)))))))))
+
+
+;;;
 ;;; Common device mappings.
 ;;;