etc-overlay: mount the metadata image read-only

On recent kernels (> 6.12 ?) we get the following warning otherwise:
`mount: /tmp/nixos-etc-metadata.aHpRhO5sC4: WARNING: source write-protected, mounted read-only.`
This commit is contained in:
r-vdp
2024-12-01 13:44:55 +01:00
parent f4a5f018f7
commit 7d6602e7de
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
where = "/run/etc-metadata";
what = "/etc-metadata-image";
type = "erofs";
options = "loop";
options = "loop,ro";
unitConfig = {
# Since this unit depends on the nix store being mounted, it cannot
# be a dependency of local-fs.target, because if it did, we'd have
+1 -1
View File
@@ -232,7 +232,7 @@ in
echo "remounting /etc..."
tmpMetadataMount=$(mktemp --directory -t nixos-etc-metadata.XXXXXXXXXX)
mount --type erofs ${config.system.build.etcMetadataImage} $tmpMetadataMount
mount --type erofs -o ro ${config.system.build.etcMetadataImage} $tmpMetadataMount
# Mount the new /etc overlay to a temporary private mount.
# This needs the indirection via a private bind mount because you