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

image: bring back the pre-PR#462 BootcDiskImage #604

Merged

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Apr 16, 2024

This commit brings back the pre-PR#462 version of BootcDiskImage as BootcLegacyDiskImage. The rational is that right now we cannot use bootc install to-filesystem for cross arch building the FITRIM ioctl is not supported by qemu-user

To fix this is requires any of the following:

  1. ensure install: Add --skip-finalize containers/bootc#462 is available everywhere we care about
  2. ensure https://www.mail-archive.com/qemu-devel@nongnu.org/msg1034508.html is available everywhere we care about
  3. bind mount /usr/bin/true over /usr/bin/fsfreeze inside the buildroot. This bind mount can be done via org.osbuild.bind but it leaks into the manifest and that does not feel great.

So the alternative is to keep using the "old" pipeline that does not yet use bootc install to-filesystem to for cross-arch builds and the new pipeline for everything else. The selection will happen on the level of bib.

This is all not nice and fragile and needs to be removed/reverted again but short term might be the only thing we can do.

With that we can do in bib:

index 1692a03..eb3b1cb 100644
--- a/bib/cmd/bootc-image-builder/image.go
+++ b/bib/cmd/bootc-image-builder/image.go
@@ -126,7 +126,13 @@ func manifestForDiskImage(c *ManifestConfig, rng *rand.Rand) (*manifest.Manifest
        mf := manifest.New()
        mf.Distro = manifest.DISTRO_FEDORA
        runner := &runner.Linux{}
-       err = img.InstantiateManifestFromContainers(&mf, []container.SourceSpec{containerSource}, runner, rng)
+
+       if c.Architecture != arch.Current() {
+               legacyImg := image.NewBootcLegacyDiskImage(img)
+               err = legacyImg.InstantiateManifestFromContainers(&mf, []container.SourceSpec{containerSource}, runner, rng)
+       } else {
+               err = img.InstantiateManifestFromContainers(&mf, []container.SourceSpec{containerSource}, runner, rng)
+       }
 
        return &mf, err
 }

This commit brings back the pre-PR#462 version of BootcDiskImage as
BootcLegacyDiskImage. The rational is that right now we cannot
use `bootc install to-filesystem` for cross arch building the
FITRIM ioctl is not supported by qemu-user

To fix this is requires any of the following:
1. ensure containers/bootc#462 is available
   everywhere we care about
2. ensure https://www.mail-archive.com/qemu-devel@nongnu.org/msg1034508.html
   is available everywhere we care about
3. bind mount /usr/bin/true over /usr/bin/fsfreeze inside the buildroot.
   This bind mount can be done via `org.osbuild.bind` but it leaks into
   the manifest and that does not feel great.

So the alternative is to keep using the "old" pipeline that does not
yet use `bootc install to-filesystem` to for cross-arch builds and
the new pipeline for everything else. The selection will happen
on the level of `bib`.

This is all not nice and fragile and needs to be removed/reverted
again but short term might be the only thing we can do.
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

Thanks! :)

@ondrejbudai ondrejbudai added this pull request to the merge queue Apr 17, 2024
Merged via the queue into osbuild:main with commit faefd58 Apr 17, 2024
14 of 16 checks passed
@mvo5 mvo5 deleted the bring-back-bootc-disk-legacy-pipeline branch April 17, 2024 09:34
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

2 participants