diff options
author | Marius Bakke <mbakke@fastmail.com> | 2019-08-13 20:42:06 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2019-08-13 20:42:06 +0200 |
commit | 462ad9f56b9665b8d22960acee73ad91f1052c9c (patch) | |
tree | 814be463d6d0517e7db9b9e6f15dbc7516955674 /guix/scripts | |
parent | 7f5f61ae99321a7a6e08b0100cd428e11ce6a837 (diff) | |
parent | 1b1b006afd31c5526f34d157baef492c7dde2e9c (diff) | |
download | gnu-guix-462ad9f56b9665b8d22960acee73ad91f1052c9c.tar gnu-guix-462ad9f56b9665b8d22960acee73ad91f1052c9c.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/deploy.scm | 6 | ||||
-rw-r--r-- | guix/scripts/system/reconfigure.scm | 27 |
2 files changed, 21 insertions, 12 deletions
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index 52bba3f3bf..ebc99e52cc 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -19,6 +19,7 @@ (define-module (guix scripts deploy) #:use-module (gnu machine) + #:use-module (guix discovery) #:use-module (guix scripts) #:use-module (guix scripts build) #:use-module (guix store) @@ -74,7 +75,10 @@ Perform the deployment specified by FILE.\n")) (define (load-source-file file) "Load FILE as a user module." - (let ((module (make-user-module '((gnu) (gnu machine) (gnu machine ssh))))) + (let* ((guix-path (dirname (search-path %load-path "guix.scm"))) + (environment-modules (scheme-modules* guix-path "gnu/machine")) + (module (make-user-module (append '((gnu) (gnu machine)) + environment-modules)))) (load* file module))) (define (guix-deploy . args) diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 8c7d461585..579b7fffbe 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -161,12 +161,7 @@ services as defined by OS." target-services) (map live-service-canonical-name live-services))) - (service-files - (map shepherd-service-file - (filter (lambda (service) - (memq (shepherd-service-canonical-name service) - to-start)) - target-services)))) + (service-files (map shepherd-service-file target-services))) (eval #~(primitive-load #$(upgrade-services-program service-files to-start to-unload @@ -200,21 +195,31 @@ BOOTLOADER-PACKAGE." (srfi srfi-34) (srfi srfi-35)) (let* ((gc-root (string-append #$target %gc-roots-directory "/bootcfg")) - (temp-gc-root (string-append gc-root ".new"))) - (switch-symlinks temp-gc-root gc-root) - (install-boot-config #$bootcfg #$bootcfg-file #$target) + (new-gc-root (string-append gc-root ".new"))) + ;; #$bootcfg has dependencies. + ;; The bootloader magically loads the configuration from + ;; (string-append #$target #$bootcfg-file) (for example + ;; "/boot/grub/grub.cfg"). + ;; If we didn't do something special, the garbage collector + ;; would remove the dependencies of #$bootcfg. + ;; Register #$bootcfg as a GC root. ;; Preserve the previous activation's garbage collector root ;; until the bootloader installer has run, so that a failure in ;; the bootloader's installer script doesn't leave the user with ;; a broken installation. + (switch-symlinks new-gc-root #$bootcfg) + (install-boot-config #$bootcfg #$bootcfg-file #$target) (when #$installer (catch #t (lambda () (#$installer #$bootloader-package #$device #$target)) (lambda args - (delete-file temp-gc-root) + (delete-file new-gc-root) (apply throw args)))) - (rename-file temp-gc-root gc-root))))))) + ;; We are sure that the installation of the bootloader + ;; succeeded, so we can replace the old GC root by the new + ;; GC root now. + (rename-file new-gc-root gc-root))))))) (define* (install-bootloader eval configuration bootcfg #:key |