diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-02-08 15:32:28 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-02-08 16:17:05 +0100 |
| commit | 387e175492f960d7d86f34f3b2e43938fa72dbf3 (patch) | |
| tree | a12082201befe64989049c1c417752195f0381be /gnu/build/activation.scm | |
| parent | 618739b063dd0f8f33d0618cf64567aaaf86f4d7 (diff) | |
services: Add 'special-files-service-type'.
* gnu/build/activation.scm (activate-/bin/sh): Remove.
(activate-special-files): New procedure.
* gnu/services.scm (activation-script): Remove call to
'activate-/bin/sh'.
(special-files-service-type): New variable.
(extra-special-file): New procedure.
* gnu/services/base.scm (%base-services): Add SPECIAL-FILES-SERVICE-TYPE
instance.
* gnu/tests/base.scm (run-basic-test)[special-files]: New variables.
["special files"]: New test.
Diffstat (limited to 'gnu/build/activation.scm')
| -rw-r--r-- | gnu/build/activation.scm | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm index e58304e83b1..c4ed40e0deb 100644 --- a/gnu/build/activation.scm +++ b/gnu/build/activation.scm | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | activate-user-home | 28 | activate-user-home |
| 29 | activate-etc | 29 | activate-etc |
| 30 | activate-setuid-programs | 30 | activate-setuid-programs |
| 31 | activate-/bin/sh | 31 | activate-special-files |
| 32 | activate-modprobe | 32 | activate-modprobe |
| 33 | activate-firmware | 33 | activate-firmware |
| 34 | activate-ptrace-attach | 34 | activate-ptrace-attach |
| @@ -383,10 +383,23 @@ copy SOURCE to TARGET." | |||
| 383 | 383 | ||
| 384 | (for-each make-setuid-program programs)) | 384 | (for-each make-setuid-program programs)) |
| 385 | 385 | ||
| 386 | (define (activate-/bin/sh shell) | 386 | (define (activate-special-files special-files) |
| 387 | "Change /bin/sh to point to SHELL." | 387 | "Install the files listed in SPECIAL-FILES. Each element of SPECIAL-FILES |
| 388 | (symlink shell "/bin/sh.new") | 388 | is a pair where the first element is the name of the special file and the |
| 389 | (rename-file "/bin/sh.new" "/bin/sh")) | 389 | second element is the name it should appear at, such as: |
| 390 | |||
| 391 | ((\"/bin/sh\" \"/gnu/store/…-bash/bin/sh\") | ||
| 392 | (\"/usr/bin/env\" \"/gnu/store/…-coreutils/bin/env\")) | ||
| 393 | " | ||
| 394 | (define install-special-file | ||
| 395 | (match-lambda | ||
| 396 | ((target file) | ||
| 397 | (let ((pivot (string-append target ".new"))) | ||
| 398 | (mkdir-p (dirname target)) | ||
| 399 | (symlink file pivot) | ||
| 400 | (rename-file pivot target))))) | ||
| 401 | |||
| 402 | (for-each install-special-file special-files)) | ||
| 390 | 403 | ||
| 391 | (define (activate-modprobe modprobe) | 404 | (define (activate-modprobe modprobe) |
| 392 | "Tell the kernel to use MODPROBE to load modules." | 405 | "Tell the kernel to use MODPROBE to load modules." |
