aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/parted.scm
diff options
context:
space:
mode:
authorJanneke Nieuwenhuizen <janneke@gnu.org>2024-10-15 23:27:17 +0200
committerJan (janneke) Nieuwenhuizen <janneke@gnu.org>2024-11-11 07:28:35 +0100
commit9aeb8e3dee32254a19a68971f26e214c7b717e5b (patch)
treecb8481b13c3b9a1a3ffd4692709c46371dcf631c /gnu/installer/parted.scm
parentcca544513b7c01e1cff33ac0c690031406dceac6 (diff)
downloadguix-9aeb8e3dee32254a19a68971f26e214c7b717e5b.tar
guix-9aeb8e3dee32254a19a68971f26e214c7b717e5b.tar.gz
installer: Add dry-run?
This allows running the installer without root privileges. Do something like ./pre-inst-env guix repl ,use (guix) ,use (gnu installer) (installer-program #:dry-run? #t) ,build $1 => "/gnu/store/...-installer-program" and run /gnu/store/...-installer-program * gnu/installer/newt.scm (locale-page): Add #:dry-run? parameter. (keymap-page): Likewise. * gnu/installer/newt/keymap.scm (run-keymap-page): Likewise. * gnu/installer/steps.scm (run-installer-steps): Likewise. Use it to skip writing to socket. * gnu/installer/newt/final.scm (run-final-page): Rename to... (run-final-page-install): ...this. (dry-run-final-page, run-final-page): New procedures. * gnu/installer/parted.scm (bootloader-configuration): Cater for empty user partitions. * gnu/installer/utils.scm (dry-run-command): New procedure. * gnu/installer.scm (compute-locale-step): Add #:dry-run? parameter. Use it to avoid actually applying locale. (compute-keymap-step): Add dry-run? parameter. Pass it to keymap-page. (installer-program): Add #:dry-run? parameter. If #:true avoid writing to /proc, use dry-run-command, skip sync and reboot, and pass dry-run? to... (installer-steps): ...here. Add #:dry-run? parameter. Use it to disable skip network, substitutes, partitioning pages, and pass it to... compute-locale-step, compute-keymap-step, and final-page. Change-Id: I0ff4c3b0a0c69539af617c27ba37654beed44619
Diffstat (limited to 'gnu/installer/parted.scm')
-rw-r--r--gnu/installer/parted.scm29
1 files changed, 16 insertions, 13 deletions
diff --git a/gnu/installer/parted.scm b/gnu/installer/parted.scm
index e59df3d8e6..b36b238d8b 100644
--- a/gnu/installer/parted.scm
+++ b/gnu/installer/parted.scm
@@ -1461,19 +1461,22 @@ from (gnu system mapped-devices) and return it."
(define (bootloader-configuration user-partitions)
"Return the bootloader configuration field for USER-PARTITIONS."
- (let* ((root-partition (find root-user-partition?
- user-partitions))
- (root-partition-disk (user-partition-disk-file-name root-partition)))
- `((bootloader-configuration
- ,@(if (efi-installation?)
- `((bootloader grub-efi-bootloader)
- (targets (list ,(default-esp-mount-point))))
- `((bootloader grub-bootloader)
- (targets (list ,root-partition-disk))))
-
- ;; XXX: Assume we defined the 'keyboard-layout' field of
- ;; <operating-system> right above.
- (keyboard-layout keyboard-layout)))))
+ (let ((root-partition (find root-user-partition? user-partitions)))
+ (match user-partitions
+ (() '())
+ (_
+ (let ((root-partition-disk (user-partition-disk-file-name
+ root-partition)))
+ `((bootloader-configuration
+ ,@(if (efi-installation?)
+ `((bootloader grub-efi-bootloader)
+ (targets (list ,(default-esp-mount-point))))
+ `((bootloader grub-bootloader)
+ (targets (list ,root-partition-disk))))
+
+ ;; XXX: Assume we defined the 'keyboard-layout' field of
+ ;; <operating-system> right above.
+ (keyboard-layout keyboard-layout))))))))
(define (user-partition-missing-modules user-partitions)
"Return the list of kernel modules missing from the default set of kernel