summaryrefslogtreecommitdiff
path: root/gnu/build
diff options
context:
space:
mode:
authorbrian cully <bjc@spork.org>2026-06-24 10:19:15 -0400
committerNguyễn Gia Phong <cnx@loang.net>2026-06-25 11:07:57 +0900
commitb7d4adaf9d2d508c949ca14d109b10ddbc725ce6 (patch)
treeb048f82be58f46aed16601ada0ab3ebe618b1361 /gnu/build
parent5c6c1eb419e70810dec3615b254219f9d32e215d (diff)
system: Delete current-system.new before attempting symlink.
If the system crashes after `current-system.new' is created, but before it is renamed, then the system becomes unbootable, as `symlink' will throw an error during activation. This patch removes the .new symlink, if it exists, before trying to create it anew. * gnu/build/activation.scm (activate-current-system): Delete `.new' symlink if it exists, before trying to recreate it. Merges: https://codeberg.org/guix/guix/pulls/9501 Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/activation.scm2
1 files changed, 2 insertions, 0 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index 53844c0990e..dbe35f41b88 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -497,6 +497,8 @@ improvement."
497 (mkdir-p "/run") 497 (mkdir-p "/run")
498 ;; Atomically make SYSTEM current. 498 ;; Atomically make SYSTEM current.
499 (let ((new (string-append %current-system ".new"))) 499 (let ((new (string-append %current-system ".new")))
500 (when (file-exists? new)
501 (delete-file new))
500 (symlink system new) 502 (symlink system new)
501 (rename-file new %current-system))) 503 (rename-file new %current-system)))
502 504