-
Notifications
You must be signed in to change notification settings - Fork 159
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
coreos-ignition-setup-user: remount /usr
rw if needed
#3031
Conversation
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`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
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 | ||
|
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
Thanks to Ignaz Forster <[email protected]> Fixes: coreos#3031
Thanks to Ignaz Forster <[email protected]> Fixes: #3031
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 withMountFlags=slave
.