mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 13:10:33 +02:00
environment: Add ‘--writable-root’ and default to read-only root.
This is an incompatible change where the root file system in ‘guix shell -C’ is now read-only by default. * guix/scripts/environment.scm (show-environment-options-help) (%options): Add ‘--writable-root’. * guix/scripts/environment.scm (setup-fhs): Invoke /sbin/ldconfig; moved from… (launch-environment): … here. (launch-environment/container): Add #:writable-root? and pass it to ‘call-with-container’. Move root file system setup to #:populate-file-system. (guix-environment*): Honor ‘--writable-root’. * tests/guix-environment-container.sh: Test it. * doc/guix.texi (Invoking guix shell): Document ‘--writable-root’. (Debugging Build Failures): Mention it before “rm /bin/sh”. Change-Id: I2e8517d6f01eb8093160bffc0f9f56071ad6fee6 Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# GNU Guix --- Functional package management for GNU
|
||||
# Copyright © 2015 David Thompson <davet@gnu.org>
|
||||
# Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
|
||||
# Copyright © 2023 Ludovic Courtès <ludo@gnu.org>
|
||||
# Copyright © 2023, 2025 Ludovic Courtès <ludo@gnu.org>
|
||||
#
|
||||
# This file is part of GNU Guix.
|
||||
#
|
||||
@@ -186,6 +186,15 @@ HOME="$tmpdir" guix environment --bootstrap --container --user=foognu \
|
||||
-- /bin/sh -c 'test $(pwd) == "/home/foo" -a ! -d '"$tmpdir"
|
||||
)
|
||||
|
||||
# Check that the root file system is read-only by default...
|
||||
guix environment --bootstrap --container --ad-hoc guile-bootstrap \
|
||||
-- guile -c '(mkdir "/whatever")' && false
|
||||
|
||||
# ... and can be made writable.
|
||||
guix environment --bootstrap --container --ad-hoc guile-bootstrap \
|
||||
--writable-root \
|
||||
-- guile -c '(mkdir "/whatever")'
|
||||
|
||||
# Check the exit code.
|
||||
|
||||
abnormal_exit_code="
|
||||
|
||||
Reference in New Issue
Block a user