aboutsummaryrefslogtreecommitdiff
path: root/src/property/installer.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-07-09 20:42:26 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-07-10 21:42:22 -0700
commitefc93e2f7763f3c906e44122d0b5643b9d8da3df (patch)
tree6c507c87a875e69d965eba877233cc70a3185dee /src/property/installer.lisp
parent939517b23d9f65183cfe3d24c9c2c09108add50f (diff)
downloadconsfigurator-efc93e2f7763f3c906e44122d0b5643b9d8da3df.tar.gz
add INSTALLER:BOOTLOADERS-INSTALLED & example usage
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/installer.lisp')
-rw-r--r--src/property/installer.lisp37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/property/installer.lisp b/src/property/installer.lisp
index b0bfc1d..fd2fce3 100644
--- a/src/property/installer.lisp
+++ b/src/property/installer.lisp
@@ -133,6 +133,15 @@ install a package providing /usr/sbin/grub-install, but it won't execute it."
(return
(if (cdr propspecs) (cons 'eseqprops propspecs) (car propspecs)))))
+(defpropspec bootloaders-installed :lisp (&key (running-on-target t))
+ "Install the host's bootloaders to its volumes.
+Intended to be attached to properties like INSTALLER:CLEANLY-INSTALLED-ONCE
+using a combinator like ON-CHANGE, or applied manually with DEPLOY-THESE."
+ (:desc "Bootloaders installed")
+ `(eseqprops
+ (bootloader-binaries-installed)
+ ,@(get-propspecs (get-hostattrs :volumes) running-on-target)))
+
;;;; Live replacement of GNU/Linux distributions
@@ -314,6 +323,7 @@ whereas if you don't have that information, you would want something like
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
(disk:volumes
(mounted-ext4-filesystem :mount-point #P\"/\")
@@ -323,7 +333,32 @@ this property with ON-CHANGE:
(mount:unmounted-below-and-removed \"/old-os\")
You will probably need to install a kernel, bootloader, sshd etc. in the list
-of properties subsequent to this one.
+of properties subsequent to this one. A more complete example:
+
+ (os:debian-stable \"bullseye\" :amd64)
+ (disk:has-volumes
+ (physical-disk
+ :device-file #P\"/dev/sda\"
+ :boots-with '(grub:grub :target \"x86_64-efi\")))
+ (on-change (installer:cleanly-installed-once
+ nil '(os:debian-stable \"buster\" :amd64))
+ ;; Clear out the old OS's EFI system partition contents.
+ (file:directory-does-not-exist \"/boot/efi/EFI\")
+
+ (apt:installed \"linux-image-amd64\")
+ (installer:bootloaders-installed)
+
+ (fstab:entries-for-volumes
+ (disk:volumes
+ (mounted-ext4-filesystem :mount-point #P\"/\")
+ (partition
+ (mounted-fat32-filesystem :mount-point #P\"/boot/efi/\"))))
+
+ (file:is-copy-of \"/etc/resolv.conf\" \"/old-os/etc/resolv.conf\")
+ (mount:unmounted-below-and-removed \"/old-os\"))
+ (network:static ...)
+ (sshd:installed)
+ (swap:has-swap-file \"2G\")
If the system is not freshly provisioned, you couldn't easily recover from the
system becoming unbootable, or you have physical access to the machine, it is