aboutsummaryrefslogtreecommitdiff
path: root/src/property
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-04-01 17:31:33 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-04-01 17:31:33 -0700
commit1eafa3b6486c2abe56e093e14cfdc4941cfbf282 (patch)
tree7842bc755ac02fee166a3ff830235730eb3189bc /src/property
parent6d5c8b2d399a949fca10afcba88a1a5a68917221 (diff)
downloadconsfigurator-1eafa3b6486c2abe56e093e14cfdc4941cfbf282.tar.gz
FSTAB & CRYPTTAB: prepend HAS- to names of exported properties
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property')
-rw-r--r--src/property/crypttab.lisp6
-rw-r--r--src/property/disk.lisp5
-rw-r--r--src/property/fstab.lisp10
-rw-r--r--src/property/installer.lisp8
-rw-r--r--src/property/swap.lisp2
5 files changed, 16 insertions, 15 deletions
diff --git a/src/property/crypttab.lisp b/src/property/crypttab.lisp
index 28bcaf7..744361b 100644
--- a/src/property/crypttab.lisp
+++ b/src/property/crypttab.lisp
@@ -62,7 +62,7 @@
;;;; Properties
-(defprop entries :posix (&rest entries)
+(defprop has-entries :posix (&rest entries)
"Ensure that /etc/crypttab contains each of ENTRIES, using a simple merge
procedure: existing lines of the crypttab with the same mapped device name as
any of ENTRIES are updated to match the corresponding members of ENTRIES,
@@ -74,14 +74,14 @@ existing field value."
(format nil "crypttab entr~@P for ~{~A~^, ~}" (length it) it)))
(:apply (file:update-unix-table #P"/etc/crypttab" 1 0 entries)))
-(defprop entries-for-opened-volumes :posix ()
+(defprop has-entries-for-opened-volumes :posix ()
"Add or update entries in /etc/crypttab for currently open volumes.
This is used when building disk images and installing operating systems."
(:desc "crypttab entries for opened volumes")
(:hostattrs (os:required 'os:linux))
(:apply
- (apply #'entries
+ (apply #'has-entries
(mapcar #'volume->entry
(mapcan (curry #'subvolumes-of-type 'opened-luks-container)
(get-connattr :opened-volumes))))))
diff --git a/src/property/disk.lisp b/src/property/disk.lisp
index 167f1f2..5616bd9 100644
--- a/src/property/disk.lisp
+++ b/src/property/disk.lisp
@@ -532,8 +532,9 @@ We do not specify what logical volumes it contains."))
when (slot-boundp volume 'mount-point)
collect volume))))
(if to-create
- (prog2 (ignoring-hostattrs
- (consfigurator.property.fstab:entries-for-volumes to-create))
+ (prog2
+ (ignoring-hostattrs
+ (consfigurator.property.fstab:has-entries-for-volumes to-create))
(create-volumes-and-contents to-create)
(dolist (volume to-create)
(open-volume volume nil))
diff --git a/src/property/fstab.lisp b/src/property/fstab.lisp
index 5a8feef..f684316 100644
--- a/src/property/fstab.lisp
+++ b/src/property/fstab.lisp
@@ -76,7 +76,7 @@ Other properties might fill it in."
;;;; Properties
-(defprop entries :posix (&rest entries)
+(defprop has-entries :posix (&rest entries)
"Ensure that /etc/fstab contains each of ENTRIES, using a simple merge
procedure: existing lines of the fstab with the same mount point as any of
ENTRIES are updated to match the corresponding members of ENTRIES, except that
@@ -89,26 +89,26 @@ partition or filesystem UUID in your consfig."
(format nil "fstab entr~@P for ~{~A~^, ~}" (length it) it)))
(:apply (file:update-unix-table #P"/etc/fstab" 0 1 entries)))
-(defprop entries-for-volumes :posix (&optional volumes)
+(defprop has-entries-for-volumes :posix (&optional volumes)
"Add or update entries in /etc/fstab for VOLUMES, or the host's volumes, as
specified with DISK:HAS-VOLUMES."
(:desc (format nil "fstab entries for ~:[~;host's ~]volumes" volumes))
(:hostattrs (os:required 'os:linux))
- (:apply (apply #'entries
+ (:apply (apply #'has-entries
(apply #'mapcar #'volume->entry
(multiple-value-list
(multiple-value-mapcan
(curry #'subvolumes-of-type 'filesystem)
(or volumes (get-hostattrs :volumes))))))))
-(defprop entries-for-opened-volumes :posix ()
+(defprop has-entries-for-opened-volumes :posix ()
"Add or update entries in /etc/fstab for currently open volumes.
This is used when building disk images and installing operating systems."
(:desc "fstab entries for opened volumes")
(:hostattrs (os:required 'os:linux))
(:apply
- (apply #'entries
+ (apply #'has-entries
(apply #'mapcar #'volume->entry
(multiple-value-list
(multiple-value-mapcan
diff --git a/src/property/installer.lisp b/src/property/installer.lisp
index 64d76e1..7c0e306 100644
--- a/src/property/installer.lisp
+++ b/src/property/installer.lisp
@@ -111,8 +111,8 @@ Also update the fstab and crypttab, and try to install bootloader(s)."
;; from the volumes the user has declared for the host, it
;; is unlikely there are other properties setting mount
;; options etc. which are in conflict with VOLUMES.
- (fstab:entries-for-opened-volumes)
- (crypttab:entries-for-opened-volumes))))
+ (fstab:has-entries-for-opened-volumes)
+ (crypttab:has-entries-for-opened-volumes))))
(%install-bootloaders
,running-on-target
,@(get-propspecs (get-hostattrs :volumes) running-on-target))))))))
@@ -353,7 +353,7 @@ Here are some other propapps you might want to attach to the application of
this property with ON-CHANGE:
(bootloaders-installed)
- (fstab:entries-for-volumes
+ (fstab:has-entries-for-volumes
(disk:volumes
(mounted-ext4-filesystem :mount-point #P\"/\")
(partition (mounted-fat32-filesystem :mount-point #P\"/boot/efi/\"))))
@@ -377,7 +377,7 @@ of properties subsequent to this one. A more complete example:
(apt:installed \"linux-image-amd64\")
(installer:bootloaders-installed)
- (fstab:entries-for-volumes
+ (fstab:has-entries-for-volumes
(disk:volumes
(mounted-ext4-filesystem :mount-point #P\"/\")
(partition
diff --git a/src/property/swap.lisp b/src/property/swap.lisp
index b3ab9c9..4c89657 100644
--- a/src/property/swap.lisp
+++ b/src/property/swap.lisp
@@ -38,5 +38,5 @@ Current implementation assumes a non-CoW filesystem; see NOTES in swapon(8)."
(:hostattrs (os:required 'os:linux))
(on-apply-change (%swapfile-exists size location)
(cmd:single "swapon" location))
- (fstab:entries
+ (fstab:has-entries
(strcat (unix-namestring location) " swap swap defaults 0 0")))