Default root config to mount sysroot as read only

See: https://github.com/fedora-iot/iot-distro/issues/81
     https://gitlab.com/fedora/bootc/base-images/-/blob/main/tier-0/ostree.yaml

Signed-off-by: Paul Whalen <pwhalen@fedoraproject.org>
This commit is contained in:
Paul Whalen 2025-03-17 13:19:32 -04:00
commit c7f2ffe7cb
2 changed files with 17 additions and 0 deletions

View file

@ -2,6 +2,8 @@ include:
- bootupd.yaml
# Enable composefs
- composefs.yaml
# Read only sysroot
- sysroot-ro.yaml
ref: fedora/rawhide/${basearch}/iot
repos: []
selinux: true

15
sysroot-ro.yaml Normal file
View file

@ -0,0 +1,15 @@
# Set up default root config to mount sysroot as read only
# https://fedoraproject.org/wiki/Changes/Silverblue_Kinoite_readonly_sysroot
# See: https://gitlab.com/fedora/bootc/base-images/-/blob/main/tier-0/ostree.yaml
# See: https://github.com/fedora-iot/iot-distro/issues/81
postprocess:
- |
#!/usr/bin/env bash
set -xeuo pipefail
install -dm 0755 -o 0 -g 0 /usr/lib/ostree
cat >> /usr/lib/ostree/prepare-root.conf << 'EOF'
[sysroot]
readonly = true
EOF