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

coreos-ignition-setup-user: remount /usr rw if needed #3031

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Jun 18, 2024

systemd v256 now runs the initrd with ProtectSystem=yes, which makes /usr read-only:

https://github.com/systemd/systemd/blob/07748c53df5a72111d8b3eef49d275210d6018cd/NEWS#L168-L175

This breaks coreos-ignition-setup-user which wants to copy the Ignition config to /usr/lib/ignition.

I think the right fix for this is to have Ignition learn to also source from /etc and /run, which is the standard nowadays:

coreos/ignition#1891

But for now at least, we can safely remount /usr read-write ourselves without affecting the rest of the system since we're already running with MountFlags=slave.

systemd v256 now runs the initrd with `ProtectSystem=yes`, which makes
`/usr` read-only:

https://github.com/systemd/systemd/blob/07748c53df5a72111d8b3eef49d275210d6018cd/NEWS#L168-L175

This breaks coreos-ignition-setup-user which wants to copy the Ignition
config to `/usr/lib/ignition`.

I think the right fix for this is to have Ignition learn to also source
from `/etc` and `/run`, which is the standard nowadays:

coreos/ignition#1891

But for now at least, we can safely remount `/usr` read-write ourselves
without affecting the rest of the system since we're already running
with `MountFlags=slave`.
Copy link
Contributor

@jbtrystram jbtrystram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jbtrystram jbtrystram merged commit 44d0ff8 into coreos:testing-devel Jun 19, 2024
3 checks passed
Comment on lines 15 to +23
mkdir -p $destination

# systemd v256 now runs the initrd with ProtectSystem=yes, which makes /usr
# read-only. Just remount it rw until we have:
# https://github.com/coreos/ignition/issues/1891
if [ ! -w /usr ]; then
mount -o rw,remount /usr
fi

Copy link

@laenion laenion Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the remount occur before calling mkdir -p $destination?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, that's a good point

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks! OOC, did you actually hit an issue from this? I think this still worked because the directory already exists and mkdir -p no-ops before even trying to create the directory.

travier added a commit to travier/fedora-coreos-config that referenced this pull request Jul 29, 2024
Thanks to Ignaz Forster <ignaz.forster@gmx.de>
Fixes: coreos#3031
travier added a commit that referenced this pull request Jul 29, 2024
Thanks to Ignaz Forster <ignaz.forster@gmx.de>
Fixes: #3031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants