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

xvoidstrap: allow bootstrapping cross archs #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CameronNemo
Copy link
Contributor

This adds the necessary logic to support bootstrapping architectures
that are different from the host architecture.

/proc needs to be mounted because a base-files invocation of install
uses it to chmod tmp and var/tmp...

@CameronNemo CameronNemo force-pushed the xvoidstrap-cross branch 2 times, most recently from 376342c to b236a7d Compare September 15, 2020 02:03
@CameronNemo CameronNemo changed the title feat(xvoidstrap): allow bootstrapping cross archs xvoidstrap: allow bootstrapping cross archs Sep 15, 2020
@leahneukirchen
Copy link
Owner

Where is the part that uses qemu-static? oO

@CameronNemo
Copy link
Contributor Author

It is assumed that binfmt is installed (perhaps a bad assumption, should maybe add a test in there), so pretty much everything in the chroot is running with qemu-user-static if necessary.

@leahneukirchen
Copy link
Owner

Ah yes. I think you can set up a binfmt_misc with flag F and it will work inside the chroot without issues, perhaps that is an easier way?

This adds the necessary logic to support bootstrapping architectures
that are different from the host architecture.

/proc needs to be mounted because GNU coreutils needs it:

https://lists.gnu.org/archive/html/bug-coreutils/2020-09/msg00010.html
@CameronNemo
Copy link
Contributor Author

It is assumed that binfmt is installed (perhaps a bad assumption, should maybe add a test in there)

Added a little test.

I think you can set up a binfmt_misc with flag F and it will work inside the chroot without issues, perhaps that is an easier way?

It would easier for this script if that was already set up, however setting it up requires knowing the magic values for the relevant qemu architecture. mklive hardcodes them (https://github.com/void-linux/void-mklive/blob/master/lib.sh.in#L168), but another option is to parse the binfmt files that are installed into /var/lib/binfmts. Both options are more involved than just copying the relevant binary in.

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.

2 participants