aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/connection/chroot.lisp1
-rw-r--r--src/package.lisp3
-rw-r--r--src/property/mount.lisp11
3 files changed, 14 insertions, 1 deletions
diff --git a/src/connection/chroot.lisp b/src/connection/chroot.lisp
index f0a4c73..2895641 100644
--- a/src/connection/chroot.lisp
+++ b/src/connection/chroot.lisp
@@ -75,6 +75,7 @@ should be the mount point, without the chroot's root prefixed.")
(unless (zerop (mrun :for-exit "mountpoint" "-q" into))
(chroot-mount connection "--bind" into "/"))
;; Now set up the usual bind mounts. Help here from arch-chroot(8).
+ (mount:assert-devtmpfs-udev-/dev)
(dolist (mount *standard-chroot-mounts*)
(apply #'chroot-mount connection mount))
(when (remote-exists-p "/sys/firmware/efi/efivars")
diff --git a/src/package.lisp b/src/package.lisp
index dbf6eb5..11ecb73 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -354,7 +354,8 @@
(:export #:mounted
#:unmounted-below
#:unmounted-below-and-removed
- #:all-mounts))
+ #:all-mounts
+ #:assert-devtmpfs-udev-/dev))
(defpackage :consfigurator.property.service
(:use #:cl #:alexandria #:consfigurator)
diff --git a/src/property/mount.lisp b/src/property/mount.lisp
index 72e6461..aa01050 100644
--- a/src/property/mount.lisp
+++ b/src/property/mount.lisp
@@ -89,3 +89,14 @@ Uses findmnt(8), so Linux-specific."
(runlines "findmnt" "-rn" "--output" "target")))
(mounts-below (remove-if-not (rcurry #'subpathp below) all-mounts)))
(sort mounts-below #'string< :key #'unix-namestring)))
+
+
+;;;; Utilities for :LISP properties
+
+(defun assert-devtmpfs-udev-/dev ()
+ "On a system with the Linux kernel, assert that /dev has fstype devtmpfs."
+ (unless (and (zerop (mrun :for-exit "mountpoint" "-q" "/dev"))
+ (string= "devtmpfs udev"
+ (stripln (run "findmnt" "-nro" "fstype,source" "/dev"))))
+ (failed-change
+ "/dev is not udev devtmpfs; support for other kinds of /dev unimplemented.")))