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: Re-implement hostns to work around supermin #203

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

cgwalters
Copy link
Collaborator

I'm experimenting with doing bootc install in a supermin VM like we do in coreos-assembler, but hit upon the fact that supermin's /sbin/init implementation incorrectly does chroot() instead of a pivot_root:

https://github.com/libguestfs/supermin/blob/5230e2c3cd07e82bd6431e871e239f7056bf25ad/init/init.c#L288

The problem here then is doing nsenter just takes us into the original rootfs, and all the real content is in /root.

Re-implement this by re-executing our own binary and doing the setns() and chroot() dance internally, because we can't really do it with external binaries.

I'm experimenting with doing `bootc install` in a supermin VM
like we do in coreos-assembler, but hit upon the fact that supermin's
`/sbin/init` implementation incorrectly does `chroot()` instead of
a `pivot_root`:

https://github.com/libguestfs/supermin/blob/5230e2c3cd07e82bd6431e871e239f7056bf25ad/init/init.c#L288

The problem here then is doing `nsenter` just takes us into the
original rootfs, and all the real content is in `/root`.

Re-implement this by re-executing our own binary and doing the `setns()`
and `chroot()` dance internally, because we can't really do it
with external binaries.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters
Copy link
Collaborator Author

Filed libguestfs/supermin#19

@cgwalters cgwalters merged commit a5d3a78 into containers:main Nov 11, 2023
9 checks passed
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

1 participant