mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02: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:
@@ -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)))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user