aboutsummaryrefslogtreecommitdiff
path: root/src/property/fstab.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-06-24 17:13:57 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-06-24 17:36:34 -0700
commit7a67c9e3fab93f6552106d5907ef6f07e57f277b (patch)
tree2a681ce2bdcbc16491087219b18caad5301b1a0f /src/property/fstab.lisp
parentcff531a1810a6213fdc117e0853c2b8622715157 (diff)
downloadconsfigurator-7a67c9e3fab93f6552106d5907ef6f07e57f277b.tar.gz
fix FSTAB:HAS-ENTRIES-FOR-OPENED-VOLUMES for FAT32 filesystems
The property should never have been calling SUBVOLUMES-OF-TYPE because opening volumes does not ever update the VOLUME-CONTENTS slot to contain OPENED-VOLUME values. The structure of the OPENED-VOLUMES connattr is that of a flat list. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/fstab.lisp')
-rw-r--r--src/property/fstab.lisp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/property/fstab.lisp b/src/property/fstab.lisp
index 836cc1c..0c88d8e 100644
--- a/src/property/fstab.lisp
+++ b/src/property/fstab.lisp
@@ -101,22 +101,14 @@ specified with DISK:HAS-VOLUMES."
(curry #'subvolumes-of-type 'filesystem)
(or volumes (get-hostattrs :volumes))))))))
-;; TODO This is broken for fat32 partitions. MOUNTED-FAT32-FILESYSTEM objects
-;; are pushed directly to the connattr by DISK:WITH-OPENED-VOLUMES, rather
-;; than appearing within OPENED-PARTITION objects. Then the call to
-;; SUBVOLUMES-OF-TYPE here never finds any parents, returning as a second
-;; value a list containing only NIL. Thus the specialisers in the
-;; implementation of FS-SPEC for MOUNTED-FAT32-FILESYSTEM are never satisfied.
(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 #'has-entries
- (apply #'mapcar #'volume-to-entry
- (multiple-value-list
- (multiple-value-mapcan
- (curry #'subvolumes-of-type 'mounted-filesystem)
- (get-connattr 'disk:opened-volumes)))))))
+ (:apply (loop for volume in (get-connattr 'disk:opened-volumes)
+ and parent in (get-connattr 'disk:opened-volume-parents)
+ when (subtypep (type-of volume) 'disk:filesystem)
+ collect (volume-to-entry volume parent) into entries
+ finally (apply #'has-entries entries))))