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

Broke warn_on_host_root #907

Open
omertuc opened this issue Nov 19, 2024 · 2 comments
Open

Broke warn_on_host_root #907

omertuc opened this issue Nov 19, 2024 · 2 comments
Labels
area/install Issues related to `bootc install`

Comments

@omertuc
Copy link
Contributor

omertuc commented Nov 19, 2024

With #137 warn_on_host_root is broken

Running command

sudo podman run -it --rm --privileged -v /dev:/dev -v /var/lib/containers:/var/lib/containers -v /:/target --pid=host --security-opt label=type:unconfined_t -e RUST_LOG=trace quay.io/otuchfel/bootc:latest bash -c 'diff <(stat -f -c %i /target/sysroot) <(stat -f -c %i /proc/1/root/) --side-by-side`

On a bootc booted system

fc0400000000						      |	70000000000

On a normal system

(slightly modified to look at /target rather than /target/sysroot which is what bootc will do)

4a902cc3058b9cd6						4a902cc3058b9cd6

On FCOS

fc0400000000						      |	0
@omertuc
Copy link
Contributor Author

omertuc commented Nov 19, 2024

The solution would be 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)

@omertuc
Copy link
Contributor Author

omertuc commented Nov 19, 2024

I will wait for #905 to merge before pushing a fix, as they're surely going to conflict.

@cgwalters cgwalters added the area/install Issues related to `bootc install` label Nov 19, 2024
omertuc added a commit to omertuc/bootc that referenced this issue Nov 19, 2024
The `warn_on_host_root` check was broken when we added support for
installing on 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]>
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

No branches or pull requests

2 participants