From 1ef441bdb3886a813fbb6ffb6338ded94a0d3279 Mon Sep 17 00:00:00 2001 From: Paul Whalen Date: Mar 24 2025 14:53:27 +0000 Subject: 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 --- diff --git a/fedora-iot-base.yaml b/fedora-iot-base.yaml index 7894f08..37cf175 100644 --- a/fedora-iot-base.yaml +++ b/fedora-iot-base.yaml @@ -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 diff --git a/sysroot-ro.yaml b/sysroot-ro.yaml new file mode 100644 index 0000000..46bc791 --- /dev/null +++ b/sysroot-ro.yaml @@ -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