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

cmd: run simple riscv64 cross build as part of the integration tests #136

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mvo5
Copy link
Collaborator

@mvo5 mvo5 commented Feb 18, 2025

This branch shows how to cross arch build traditional images. It also allows to skip
the cross-arch build restriction when IMAGE_BUILDER_EXPERIMENTAL=bootstrap=... is set.

The not-so-nice part of this work is that we need to pick the the right container via IMAGE_BUILDER_EXPERIMENTAL=bootstrap=... currently. Fortunately almost any upstream container will do as long as it has rpm and setfiles (policycoreutils).

We really should teach images to map containers to buildroots so that we don't need to do this.

Ideally this would be in "images" itself, I guess we will merge ibcli and images eventually anyway.

@mvo5 mvo5 force-pushed the riscv-cnt-buildroot branch 3 times, most recently from c56cca2 to 1528ffd Compare February 18, 2025 21:38
@mvo5 mvo5 force-pushed the riscv-cnt-buildroot branch 3 times, most recently from 77d0c11 to 66d519c Compare February 20, 2025 09:30
# XXX: we should encode this in images proper
# note that we need the "fedora-toolbox" container as the regular one
# does not contain python3
images_experimental_env = "IMAGES_EXPERIMENTAL=buildroot=fedora.riscv.rocks:3000/davidlt/fedora-toolbox:41"
Copy link
Collaborator Author

@mvo5 mvo5 Feb 20, 2025

Choose a reason for hiding this comment

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

This will need to use ghcr.io/mvo5/fedora-buildroot:41

which is just:

FROM fedora.riscv.rocks:3000/davidlt/fedora-toolbox:41
RUN dnf install -y selinux-policy-targeted policycoreutils dosfstools
# our hardcoded build.go:NewBuildrootFromContainer expects a /ostree
# in the selinux labeling. workaround here for now.
RUN mkdir -p /ostree

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note that this is an intermediate solution, once the upstream fedora-toolbox container installs policycoreutils this container is no longer needed and we can use the upstream one.

@mvo5 mvo5 force-pushed the riscv-cnt-buildroot branch 2 times, most recently from af169e1 to ba4e229 Compare February 24, 2025 16:18
@mvo5 mvo5 changed the title cmd: show hackish riscv64 cross build cmd: show (slighly) hackish riscv64 cross build Feb 24, 2025
mvo5 added 3 commits March 5, 2025 09:40
This commit skips the arch checks if the experimental "bootstrap"
option is used. The main use-case of this option is to bootstrap
a foreign architecture so just assume that and skip arch checks
when set.

This allows to write:
```
$ IMAGE_BUILDER_EXPERIMENTAL=buildroot=ghcr.io/mvo5/fedora-buildroot:41 \
   ./image-builder build --arch=riscv64 minimal-raw --distro=fedora-41
```
and do a riscv64 cross arch build.
This commit uses the new experimental `bootstrap` flag to perform
a cross arch build for riscv64.
@mvo5 mvo5 changed the title cmd: show (slighly) hackish riscv64 cross build cmd: run simple riscv64 cross build as part of the integration tests Mar 5, 2025
@mvo5 mvo5 force-pushed the riscv-cnt-buildroot branch from ba4e229 to 84e0dcd Compare March 5, 2025 08:57
@mvo5 mvo5 marked this pull request as ready for review March 5, 2025 10:09
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.

1 participant