Skip to content

Commit 346724f

Browse files
committed
manifests/tier-x: use readonly in repo config only
Currently, when building the squashfs, we drop the `sysroot.readonly` flag from the ostree config because `ostree-prepare-root` doesn't know how to handle it in the setup we have in our live environments. But now inheriting from tier-x, we also inherited the move of that knob to `/usr/lib/ostree/prepare-root.conf`, which is then included in the initramfs. That's much harder to override during the build process because we don't want to rebuild the initramfs. We could probably instead just append a CPIO to the live initramfs that shadows it but the real fix anyway is to adapt libostree to work in live environments.[^1] So for now, just undo this bit to go back to how it was set up before inheriting from tier-x, where the only sysroot.readonly knob lives in the ostree repo config. [^1]: ostreedev/ostree#1921
1 parent 6fd4cce commit 346724f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

manifests/tier-x.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,21 @@ machineid-compat: false
1212
# This is the historical default and what FCOS currently ships. fedora-bootc
1313
# uses the new `root` value, but migrating FCOS is not that simple...
1414
opt-usrlocal: var
15+
16+
postprocess:
17+
- |
18+
#!/usr/bin/env bash
19+
set -euo pipefail
20+
# For now, rely on the `sysroot.readonly` knob in /ostree/config only.
21+
# Having it in prepare-root.conf too throws off ostree-prepare-root in
22+
# live PXE/ISO and we have no easy way to override it when building those.
23+
# Really, we need to fix libostree + live ISOs to work well together:
24+
# https://github.com/ostreedev/ostree/issues/1921
25+
# It's awkward to edit arbitrary keyfile configs. Just rewrite it.
26+
if grep -q readonly /usr/lib/ostree/prepare-root.conf; then
27+
grep -q '^4 ' <(wc -l /usr/lib/ostree/prepare-root.conf)
28+
cat > /usr/lib/ostree/prepare-root.conf <<EOF
29+
[composefs]
30+
enabled = true
31+
EOF
32+
fi

0 commit comments

Comments
 (0)