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

install: Fix broken warn_on_host_root check #910

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

omertuc
Copy link
Contributor

@omertuc omertuc commented Nov 19, 2024

The warn_on_host_root check was broken when we added support for installing on already-ostree systems.

See #907

The solution is to use the original user provided root_path for the fd passed to warn_on_host_root, rather than the modified one, as that will always match /proc/0/root's fsid (in ostree systems systemd is running with the deployment root as its root, and this is what we have mounted as /:/target)

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Nov 19, 2024
Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Thanks for spotting this regression...clearly we should have some CI coverage that verifies we print the warning.

This code is quite complex and entangled now. I am wondering if we couldn't fix this by just moving the warning up above where we re-compute and fsopts.root_path.

Actually also staring at this code, I did #912

@omertuc
Copy link
Contributor Author

omertuc commented Nov 19, 2024

Thanks for spotting this regression...clearly we should have some CI coverage that verifies we print the warning.

Arguably this was not a true regression but more like an inconsistency in a new feature - just a new installation target option (ostree) we added didn't have the warning we usually have for normal systems, so can't blame the CI for not covering something that never existed

This code is quite complex and entangled now. I am wondering if we couldn't fix this by just moving the warning up above where we re-compute and fsopts.root_path.

Yeah I wanted to do that, but that would mean the check would run before prepare_install which would change the behavior and I wasn't confident this is desired. I'll gladly change the implementation if you think this is not a problem

@cgwalters
Copy link
Collaborator

cgwalters commented Nov 19, 2024

Yeah I wanted to do that, but that would mean the check would run before prepare_install which would change the behavior and I wasn't confident this is desired. I'll gladly change the implementation if you think this is not a problem

#912 would address that right?

@omertuc
Copy link
Contributor Author

omertuc commented Nov 19, 2024

Yeah I wanted to do that, but that would mean the check would run before prepare_install which would change the behavior and I wasn't confident this is desired. I'll gladly change the implementation if you think this is not a problem

#912 would address that right?

Ah yes, not directly, I'll wait for #912 to merge then I'll adjust this PR to fully address this

The `warn_on_host_root` check was broken when we added support for
installing on already-ostree systems (but only for already-ostree
systems).

See containers#907

The solution is to use the original user provided root_path for the fd
passed to warn_on_host_root, rather than the modified one, as that will
always match /proc/0/root's fsid (in ostree systems systemd is running
with the deployment root as its root, and this is what we have mounted
as /:/target)

Signed-off-by: Omer Tuchfeld <[email protected]>
@cgwalters cgwalters merged commit d42710e into containers:main Nov 26, 2024
29 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Issues related to `bootc install`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants