diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2024-04-06 16:31:54 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-04-08 00:05:48 +0200 |
| commit | a7f15c9ecffc1762f5886fb5a2a14490e2994c8c (patch) | |
| tree | 01cd44d6b4790b1acbb90f130b6ddb9171d9dd2f | |
| parent | 682d13bf39be314140e23ff8a875ea7ccdc11331 (diff) | |
reconfigure: /run/current-system points to generation.
* guix/scripts/system/reconfigure.scm (switch-system-program): Set
‘GUIX_NEW_SYSTEM’ to GENERATION rather than OS, for consistency with
what ‘boot-system’ does.
* gnu/tests/reconfigure.scm (run-switch-to-system-test)
["script activated the new generation"]: Adjust accordingly.
Change-Id: I57b693606a41b8c952df32bbdc2b9120c6dbfd6a
| -rw-r--r-- | gnu/tests/reconfigure.scm | 15 | ||||
| -rw-r--r-- | guix/scripts/system/reconfigure.scm | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm index 00514e70204..bcc7645fa35 100644 --- a/gnu/tests/reconfigure.scm +++ b/gnu/tests/reconfigure.scm | |||
| @@ -92,15 +92,12 @@ generation of the system profile." | |||
| 92 | (length (system-generations marionette)) | 92 | (length (system-generations marionette)) |
| 93 | (1+ (length generations-prior))) | 93 | (1+ (length generations-prior))) |
| 94 | 94 | ||
| 95 | (test-assert "script activated the new generation" | 95 | (test-equal "script activated the new generation" |
| 96 | (and (eqv? 'symlink | 96 | (string-append "/var/guix/profiles/system-" |
| 97 | (marionette-eval | 97 | (number->string (+ 1 (length generations-prior))) |
| 98 | '(stat:type (lstat "/run/current-system")) | 98 | "-link") |
| 99 | marionette)) | 99 | (marionette-eval '(readlink "/run/current-system") |
| 100 | (string= #$os | 100 | marionette)) |
| 101 | (marionette-eval | ||
| 102 | '(readlink "/run/current-system") | ||
| 103 | marionette)))) | ||
| 104 | 101 | ||
| 105 | (test-assert "script activated user accounts" | 102 | (test-assert "script activated user accounts" |
| 106 | (marionette-eval | 103 | (marionette-eval |
diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 9418060158a..604ba08feee 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2014-2022, 2024 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2016 Alex Kost <alezost@gmail.com> | 3 | ;;; Copyright © 2016 Alex Kost <alezost@gmail.com> |
| 4 | ;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com> | 4 | ;;; Copyright © 2016, 2017, 2018 Chris Marusich <cmmarusich@gmail.com> |
| 5 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> | 5 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> |
| @@ -106,7 +106,7 @@ atomically, and run OS's activation script." | |||
| 106 | (generation (generation-file-name profile number))) | 106 | (generation (generation-file-name profile number))) |
| 107 | (switch-symlinks generation #$os) | 107 | (switch-symlinks generation #$os) |
| 108 | (switch-symlinks profile generation) | 108 | (switch-symlinks profile generation) |
| 109 | (setenv "GUIX_NEW_SYSTEM" #$os) | 109 | (setenv "GUIX_NEW_SYSTEM" generation) |
| 110 | (primitive-load #$(operating-system-activation-script os)))))))) | 110 | (primitive-load #$(operating-system-activation-script os)))))))) |
| 111 | 111 | ||
| 112 | (define* (switch-to-system eval os #:optional profile) | 112 | (define* (switch-to-system eval os #:optional profile) |
