aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2020-05-14 23:30:09 -0700
committerMatt Turner <mattst88@gentoo.org>2020-05-14 23:31:34 -0700
commitf7b7b9f3e0df2c62e4724a7f44ce8ddd9c3e1084 (patch)
treee21f83fbcb5a9da21dac2dff702113b2d67ae2fe
parentcatalyst: Factor out mount/source/target in bind() (diff)
downloadcatalyst-f7b7b9f3e0df2c62e4724a7f44ce8ddd9c3e1084.tar.gz
catalyst-f7b7b9f3e0df2c62e4724a7f44ce8ddd9c3e1084.tar.bz2
catalyst-f7b7b9f3e0df2c62e4724a7f44ce8ddd9c3e1084.zip
catalyst: Mount squashfs with -o ro
Even though squashfs is not writeable, it must be mounted with -o ro in order to be mounted multiple times. This allows, for example, the same snapshot to be mounted simultaneously in multiple catalyst chroots. Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rw-r--r--catalyst/base/stagebase.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 55d1032d..651bf4e4 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -868,7 +868,9 @@ class StageBase(TargetBase, ClearBase, GenBase):
mount += ['-t', 'tmpfs', '-o', 'noexec,nosuid,nodev']
else:
source_path = Path(self.mount[x]['source'])
- if source_path.suffix != '.sqfs':
+ if source_path.suffix == '.sqfs':
+ mount += ['-o', 'ro']
+ else:
mount.append('--bind')
# We may need to create the source of the bind mount. E.g., in the