mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
services/base: Only remount read-write if needed in run-with-writable-store.
* gnu/services/base.scm (run-with-writable-store): Make it a no-op when the store is already writable (useful for testing). Change-Id: If598638e9d3eeac242c265cba77f27e4a15f8d9b
This commit is contained in:
parent
8cdc7108c1
commit
1d77413c56
1 changed files with 2 additions and 3 deletions
|
|
@ -1939,10 +1939,9 @@ read-only via %IMMUTABLE-STORE (this wrapper must run as root)."
|
|||
(define (ensure-writable-store store)
|
||||
;; Create a new mount namespace and remount STORE with
|
||||
;; write permissions if it's read-only.
|
||||
(unshare CLONE_NEWNS)
|
||||
(let ((fs (statfs store)))
|
||||
(unless (zero? (logand (file-system-mount-flags fs)
|
||||
ST_RDONLY))
|
||||
(when (logand (file-system-mount-flags fs) ST_RDONLY)
|
||||
(unshare CLONE_NEWNS)
|
||||
(mount store store "none"
|
||||
(logior MS_BIND MS_REMOUNT)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue