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.
This commit is contained in:
parent
ecd06ca9fa
commit
ee248b6a70
|
@ -26,6 +26,7 @@
|
||||||
#:export (activate-users+groups
|
#:export (activate-users+groups
|
||||||
activate-etc
|
activate-etc
|
||||||
activate-setuid-programs
|
activate-setuid-programs
|
||||||
|
activate-/bin/sh
|
||||||
activate-current-system))
|
activate-current-system))
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
@ -214,6 +215,11 @@ copy SOURCE to TARGET."
|
||||||
|
|
||||||
(for-each make-setuid-program programs))
|
(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
|
(define %current-system
|
||||||
;; The system that is current (a symlink.) This is not necessarily the same
|
;; 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
|
;; as the system we booted (aka. /run/booted-system) because we can re-build
|
||||||
|
|
|
@ -113,7 +113,6 @@ STORE."
|
||||||
("/var/guix/gcroots/current-system" -> "/run/current-system")
|
("/var/guix/gcroots/current-system" -> "/run/current-system")
|
||||||
|
|
||||||
(directory "/bin")
|
(directory "/bin")
|
||||||
("/bin/sh" -> "/run/current-system/profile/bin/bash")
|
|
||||||
(directory "/tmp" 0 0 #o1777) ; sticky bit
|
(directory "/tmp" 0 0 #o1777) ; sticky bit
|
||||||
|
|
||||||
(directory "/root" 0 0) ; an exception
|
(directory "/root" 0 0) ; an exception
|
||||||
|
|
|
@ -417,6 +417,11 @@ etc."
|
||||||
|
|
||||||
(use-modules (gnu build activation))
|
(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.
|
;; Populate /etc.
|
||||||
(activate-etc #$etc)
|
(activate-etc #$etc)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue