diff options
author | Ludovic Courtès <ludo@gnu.org> | 2024-12-19 16:24:49 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-12-28 22:47:34 +0100 |
commit | 1305f78d05f4e0027162c1b7e783fc127a49fb8e (patch) | |
tree | dd7ca5b4af5043ecee099755ca7ee4c5ab02b39e /guix/scripts/system.scm | |
parent | ebe706a1e820c52b9b067055cef1bc72abe1bc40 (diff) |
reconfigure: Support loading the system for kexec reboot.
This allows rebooting straight into the new system with ‘reboot -k’.
* guix/scripts/system/reconfigure.scm (kexec-loading-program)
(load-system-for-kexec): New procedures.
* gnu/tests/reconfigure.scm (run-kexec-test): New procedure.
(%test-upgrade-kexec): New variable.
* guix/scripts/system.scm (perform-action): Add #:load-for-kexec?.
Call ‘load-system-for-kexec’.
(show-help, %options): Add ‘--no-kexec’.
(%default-options): Add ‘load-for-kexec?’.
(process-action): Honor it and pass it to ‘perform-action’.
* gnu/machine/ssh.scm (deploy-managed-host): Add call to
‘load-system-for-kexec’.
* doc/guix.texi (Invoking guix system): Document it.
Change-Id: I86d11f1c348e4359bc9e73c86e5aebff60fe875c
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r-- | guix/scripts/system.scm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index dd34f6cd15..a6de6f0fd9 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -798,6 +798,7 @@ and TARGET arguments." save-provenance? skip-safety-checks? install-bootloader? + load-for-kexec? dry-run? derivations-only? use-substitutes? target full-boot? @@ -900,7 +901,13 @@ static checks." To complete the upgrade, run 'herd restart SERVICE' to stop, upgrade, and restart each service that was not automatically restarted.\n"))) (return (format #t (G_ "\ -Run 'herd status' to view the list of services on your system.\n")))))) +Run 'herd status' to view the list of services on your system.\n")))) + (mwhen load-for-kexec? + (mlet %store-monad ((kexec? (load-system-for-kexec local-eval + os))) + (mwhen kexec? + (return (info (G_ "system loaded for fast reboot \ +with 'reboot --kexec'~%")))))))) ((init) (newline) (format #t (G_ "initializing operating system under '~a'...~%") @@ -1026,6 +1033,8 @@ Some ACTIONS support additional ARGS.\n")) (display (G_ " --no-bootloader for 'init', do not install a bootloader")) (display (G_ " + --no-kexec for 'reconfigure', do not load system for kexec reboot")) + (display (G_ " --volatile for 'image', make the root file system volatile")) (display (G_ " --persistent for 'vm', make the root file system persistent")) @@ -1127,6 +1136,9 @@ Some ACTIONS support additional ARGS.\n")) (option '("no-bootloader" "no-grub") #f #f (lambda (opt name arg result) (alist-cons 'install-bootloader? #f result))) + (option '("no-kexec") #f #f + (lambda (opt name arg result) + (alist-cons 'load-for-kexec? #f result))) (option '("volatile") #f #f (lambda (opt name arg result) (alist-cons 'volatile-image-root? #t result))) @@ -1198,6 +1210,7 @@ Some ACTIONS support additional ARGS.\n")) (image-type . mbr-hybrid-raw) (image-size . guess) (install-bootloader? . #t) + (load-for-kexec? . #t) (label . #f) (volatile-image-root? . #f) (volatile-vm-root? . #t) @@ -1275,6 +1288,7 @@ resulting from command-line parsing." (leave (G_ "no configuration specified~%"))))))) (dry? (assoc-ref opts 'dry-run?)) (bootloader? (assoc-ref opts 'install-bootloader?)) + (kexec? (assoc-ref opts 'load-for-kexec?)) (label (assoc-ref opts 'label)) (image-type (lookup-image-type-by-name (assoc-ref opts 'image-type))) @@ -1360,6 +1374,7 @@ resulting from command-line parsing." (_ #f)) opts) #:install-bootloader? bootloader? + #:load-for-kexec? kexec? #:target target-file #:gc-root (assoc-ref opts 'gc-root))))) #:target target |