From 1db6f137d93b59409fedb3deb24c876649e1b8f2 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 31 Jul 2019 14:13:01 -0400 Subject: reconfigure: Reload all shepherd files when upgrading services. Fixes . Reported by Robert Vollmert . * guix/scripts/system/reconfigure.scm (upgrade-shepherd-services): Load all service files, rather than just those of services to be started. Signed-off-by: Danny Milosavljevic --- guix/scripts/system/reconfigure.scm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 8c7d461585..dee0c24bd2 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 -- cgit v1.2.3 From 5f04e9f9620aeb45940855e4f655f22db55ba6eb Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Tue, 6 Aug 2019 13:37:32 -0400 Subject: reconfigure: Fix GC root installation. Fixes . Reported by ison . guix/scripts/system/reconfigure.scm (install-bootloader-program): Switch new symlink to the canonical bootloader configuration file. Signed-off-by: Danny Milosavljevic --- guix/scripts/system/reconfigure.scm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index dee0c24bd2..579b7fffbe 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -195,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 -- cgit v1.2.3 From 55e238f2ab24ce347047ebc7fd7c5eba62dac69d Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Wed, 7 Aug 2019 08:43:27 -0400 Subject: deploy: Use all machine modules when loading deployment * guix/scripts/deploy.scm (load-source-file): Enumerate and include all submodules of (gnu machine) when loading the provided deployment specification. --- guix/scripts/deploy.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guix/scripts') 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) -- cgit v1.2.3