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
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ copy_file_if_exists() {
destination=/usr/lib/ignition
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

Comment on lines 15 to +23
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.

if is-live-image; then
# Live image. If the user has supplied a config.ign via an appended
# initrd, put it in the right place.
Expand Down
Loading