aboutsummaryrefslogtreecommitdiff
path: root/src/property/mount.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/property/mount.lisp')
-rw-r--r--src/property/mount.lisp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/property/mount.lisp b/src/property/mount.lisp
index 72eb8d7..53d1b2e 100644
--- a/src/property/mount.lisp
+++ b/src/property/mount.lisp
@@ -18,6 +18,17 @@
(in-package :consfigurator.property.mount)
(named-readtables:in-readtable :consfigurator)
+(defprop mounted :posix (&key target)
+ "Ensures that TARGET, a mount point configured in /etc/fstab, is mounted.
+Mainly useful as a dependency of properties which might do the wrong thing if
+the mount is not actually active."
+ (:desc #?"${target} mounted")
+ (:hostattrs (os:required 'os:linux))
+ (:check (zerop (mrun :for-exit "findmnt" target)))
+ (:apply (assert-euid-root)
+ (file:directory-exists target)
+ (mrun "mount" target)))
+
(defprop unmounted-below :posix (dir)
"Unmount anything mounted at or below DIR.