Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: image: Enable read-only /boot and /sysroot #39

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions image.ks
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,35 @@ rm -f /var/lib/random-seed

echo "Removing /root/anaconda-ks.cfg"
rm -f /root/anaconda-ks.cfg

# Replace /etc/fstab with mount units; mostly so we can easily enable the "ro"
# flag for /boot without having to parse/rewrite /etc/fstab. But we also
# use the labels rather than anaconda's UUID defaults.
cat > /etc/systemd/system/-.mount << EOF
[Unit]
Before=local-fs.target
[Mount]
Where=/
What=/dev/disk/by-label/root
Type=xfs
EOF

cat > /etc/systemd/system/boot.mount << EOF
[Unit]
Before=local-fs.target
[Mount]
Where=/boot
What=/dev/disk/by-label/boot
Type=xfs
Options=ro
EOF

rm /etc/fstab

# Enable readonly /sysroot,/boot: https://github.com/ostreedev/ostree/issues/1265
cat >> /ostree/repo/config << EOF
[sysroot]
readonly=true
EOF

%end