Default root config to mount sysroot as read only

See: https://github.com/fedora-iot/iot-distro/issues/81
     https://fedoraproject.org/wiki/Changes/Silverblue_Kinoite_readonly_sysroot

Signed-off-by: Paul Whalen <pwhalen@fedoraproject.org>
This commit is contained in:
Paul Whalen 2025-03-24 10:53:27 -04:00
commit 1ef441bdb3
2 changed files with 16 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/devel/${basearch}/iot
repos: []
selinux: true

14
sysroot-ro.yaml Normal file
View file

@ -0,0 +1,14 @@
# Set up default root config to mount sysroot as read only
# See: https://github.com/fedora-iot/iot-distro/issues/81
# https://fedoraproject.org/wiki/Changes/Silverblue_Kinoite_readonly_sysroot
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