aboutsummaryrefslogtreecommitdiff
path: root/src/property/disk.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-03 10:48:01 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-03 13:18:22 -0700
commitfbafc55b91b2996565d39c0316302f5afdf3e1df (patch)
tree08b4885096aaedd84c3aee461f2e995b46617ff6 /src/property/disk.lisp
parent6e3c9bb99383cdd8ebd8bead0cc9df77f87b71b4 (diff)
downloadconsfigurator-fbafc55b91b2996565d39c0316302f5afdf3e1df.tar.gz
DISK:HOST-LOGICAL-VOLUMES-EXIST: also add to /etc/fstab & mount
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/disk.lisp')
-rw-r--r--src/property/disk.lisp27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/property/disk.lisp b/src/property/disk.lisp
index 398969f..1b42504 100644
--- a/src/property/disk.lisp
+++ b/src/property/disk.lisp
@@ -511,6 +511,7 @@ We do not specify what logical volumes it contains."))
(defprop host-lvm-logical-volumes-exist :lisp ()
(:desc "Host LVM logical volumes all exist")
+ (:hostattrs (os:required 'os:linux))
(:apply
(assert-euid-root)
(let* ((existing-lvs
@@ -523,9 +524,22 @@ We do not specify what logical volumes it contains."))
unless (member (cons (volume-label volume)
(lvm-volume-group volume))
existing-lvs :test #'equal)
- collect volume)))
+ collect volume))
+ (to-mount
+ (loop for volume in to-create
+ nconc (loop for volume
+ in (subvolumes-of-type 'filesystem volume)
+ when (slot-boundp volume 'mount-point)
+ collect volume))))
(if to-create
- (create-volumes-and-contents to-create)
+ (prog2 (ignoring-hostattrs
+ (consfigurator.property.fstab:entries-for-volumes to-create))
+ (create-volumes-and-contents to-create)
+ (dolist (volume to-create)
+ (open-volume volume nil))
+ (dolist (volume to-mount)
+ (consfigurator.property.mount:mounted
+ :target (mount-point volume))))
:no-change))))
@@ -942,10 +956,13 @@ Do not apply in DEFHOST. Apply with DEPLOY-THESE/HOSTDEPLOY-THESE."
(defproplist host-logical-volumes-exist :lisp ()
"Create missing logical volumes, like LVM logical volumes and BTRFS
subvolumes, as specified by DISK:HAS-VOLUMES. Does not delete or overwrite
-anything. Intended to make it easy to add new logical volumes by just editing
-the volumes specification.
+anything, aside from editing /etc/fstab in some cases. Intended to make it
+easy to add new logical volumes by just editing the volumes specification.
-Currently only creation of LVM logical volumes is implemented."
+For logical volumes containing instances of FILESYSTEM with a specified
+MOUNT-POINT, ensure there's an /etc/fstab entry and try to mount.
+
+Currently only handling of LVM logical volumes is implemented."
(:desc "Host logical volumes all exist")
(host-lvm-logical-volumes-exist))