From ee248b6a7043f308eaaa2b1deb708b52d4923659 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 11 Sep 2014 22:18:52 +0200 Subject: activation: Make the /bin/sh symlink at activation time. * gnu/build/install.scm (directives): Remove "/bin/sh". * gnu/build/activation.scm (activate-/bin/sh): New procedure. * gnu/system.scm (operating-system-activation-script): Use it. --- gnu/build/activation.scm | 6 ++++++ gnu/build/install.scm | 1 - gnu/system.scm | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index 009c1fff0a..ee82a078b9 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm @@ -26,6 +26,7 @@ (define-module (gnu build activation) #:export (activate-users+groups activate-etc activate-setuid-programs + activate-/bin/sh activate-current-system)) ;;; Commentary: @@ -214,6 +215,11 @@ (define (make-setuid-program prog) (for-each make-setuid-program programs)) +(define (activate-/bin/sh shell) + "Change /bin/sh to point to SHELL." + (symlink shell "/bin/sh.new") + (rename-file "/bin/sh.new" "/bin/sh")) + (define %current-system ;; The system that is current (a symlink.) This is not necessarily the same ;; as the system we booted (aka. /run/booted-system) because we can re-build diff --git a/gnu/build/install.scm b/gnu/build/install.scm index 7c4a7b7753..a472259a4a 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -113,7 +113,6 @@ (define (directives store) ("/var/guix/gcroots/current-system" -> "/run/current-system") (directory "/bin") - ("/bin/sh" -> "/run/current-system/profile/bin/bash") (directory "/tmp" 0 0 #o1777) ; sticky bit (directory "/root" 0 0) ; an exception diff --git a/gnu/system.scm b/gnu/system.scm index 20fe1d0a8f..abdd80bd6d 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -417,6 +417,11 @@ (define group-specs (use-modules (gnu build activation)) + ;; Make sure /bin/sh is valid and current. + (activate-/bin/sh + (string-append #$(canonical-package bash) + "/bin/sh")) + ;; Populate /etc. (activate-etc #$etc) -- cgit v1.2.3