From b7d4adaf9d2d508c949ca14d109b10ddbc725ce6 Mon Sep 17 00:00:00 2001 From: brian cully Date: Wed, 24 Jun 2026 10:19:15 -0400 Subject: system: Delete current-system.new before attempting symlink. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gnu/build/activation.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu') 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." (mkdir-p "/run") ;; Atomically make SYSTEM current. (let ((new (string-append %current-system ".new"))) + (when (file-exists? new) + (delete-file new)) (symlink system new) (rename-file new %current-system))) -- cgit v1.2.3