diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-04-30 17:22:31 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-04-30 17:56:41 -0700 |
commit | ad1ad2a2e3200a2de050a5a7560c7c806122e880 (patch) | |
tree | 40bfdc4c360c2e76145a5405f7d7daf5c27438db /src/property | |
parent | 09c0a2a57629e8e348fa2a620fc16a98d65220ed (diff) | |
download | consfigurator-ad1ad2a2e3200a2de050a5a7560c7c806122e880.tar.gz |
implement updating the newly installed system's fstab
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property')
-rw-r--r-- | src/property/fstab.lisp | 12 | ||||
-rw-r--r-- | src/property/installer.lisp | 17 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/property/fstab.lisp b/src/property/fstab.lisp index fb23767..68bce6a 100644 --- a/src/property/fstab.lisp +++ b/src/property/fstab.lisp @@ -111,3 +111,15 @@ DISK:HAS-VOLUMES." (mapcar #'volume->entry (mapcan (curry #'subvolumes-of-type 'filesystem) (get-hostattrs :volumes)))))) + +(defprop 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 + (mapcar #'volume->entry + (mapcan (curry #'subvolumes-of-type 'mounted-filesystem) + (get-connattr :opened-volumes)))))) diff --git a/src/property/installer.lisp b/src/property/installer.lisp index 11d7062..95f0fb5 100644 --- a/src/property/installer.lisp +++ b/src/property/installer.lisp @@ -31,22 +31,27 @@ (strcat (unix-namestring chroot) "/") (strcat (unix-namestring target) "/")))) -(defpropspec chroot-installed-to-volumes :posix (host chroot volumes) +(defpropspec chroot-installed-to-volumes :lisp (host chroot volumes) "Where CHROOT contains the root filesystem of HOST and VOLUMES is a list of volumes, recursively open the volumes and rsync in the contents of CHROOT. Also update the fstab and crypttab, and try to install a bootloader." (:desc #?"${chroot} installed to volumes") - (let ((target (ensure-directory-pathname - (strcat (unix-namestring chroot) ".target")))) + (let ((target + (ensure-directory-pathname + (strcat + (drop-trailing-slash + (unix-namestring (ensure-directory-pathname chroot))) + ".target")))) `(with-these-open-volumes (,volumes :mount-below ,target) + (%update-target-from-chroot ,chroot ,target) (chroot:deploys-these - ,chroot ,host + ,target ,host ,(make-propspec :systems nil :propspec '(eseqprops - ;; TODO (fstab:entries-for-opened-volumes) + (fstab:entries-for-opened-volumes) (file:lacks-lines "/etc/fstab" "# UNCONFIGURED FSTAB FOR BASE SYSTEM")))) ;; TODO Update /etc/crypttab ;; TODO Install bootloader - (%update-target-from-chroot ,chroot ,target)))) + ))) |