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

buildroot: support OSTree trees as buildroots #1790

Closed
wants to merge 1 commit into from

Conversation

dustymabe
Copy link
Contributor

In a filesystem layout in OSTree the software is in a deployment under /ostree/deploy/<name>/deploy/*/. If the specified buildroot is an OSTree tree then let's just use the deployment root as the rootdir here.

An example where this will help us is in RHCOS, where we'd like to not maintain a separate buildroot definition since our OSTree we already build has all the exact versions of the software we want to use already.

In a filesystem layout in OSTree the software is in a deployment
under `/ostree/deploy/<name>/deploy/*/`. If the specified buildroot
is an OSTree tree then let's just use the deployment root as the
rootdir here.

An example where this will help us is in RHCOS, where we'd like to
not maintain a separate buildroot definition since our OSTree we
already build has all the exact versions of the software we want
to use already.
@mvo5
Copy link
Contributor

mvo5 commented May 17, 2024

I like the idea - I wonder if this is already possible via the org.osbuild.ostree.deployment mount stage and the new "org.osbuild.bind" stage? Here is what we do in bib to get a deployment mount:

          "devices": {
            "disk": {
              "type": "org.osbuild.loopback",
              "options": {
                "filename": "disk.raw",
                "partscan": true
              }
            }
          },
          "mounts": [
            {
              "name": "part4",
              "type": "org.osbuild.xfs",
              "source": "disk",
              "target": "/",
              "partition": 4
            },
            {
              "name": "part3",
              "type": "org.osbuild.ext4",
              "source": "disk",
              "target": "/boot",
              "partition": 3
            },
            {
              "name": "part2",
              "type": "org.osbuild.fat",
              "source": "disk",
              "target": "/boot/efi",
              "partition": 2
            },
            {
              "name": "ostree.deployment",
              "type": "org.osbuild.ostree.deployment",
              "options": {
                "source": "mount",
                "deployment": {
                  "default": true
                }
              }
            },
            {
              "name": "bind-ostree-deployment-to-tree",
              "type": "org.osbuild.bind",
              "target": "tree://",
              "options": {
                "source": "mount://"
              }
            }
          ]

now of course this does not directly apply (as you would not use the loopback etc) but maybe a similar idea would work? Do you have a link to an example manifest that you use today so that we could experiment ?

@dustymabe
Copy link
Contributor Author

I like the idea - I wonder if this is already possible via the org.osbuild.ostree.deployment mount stage and the new "org.osbuild.bind" stage?

Not really. Using mounts here requires there to already be a disk image. What I'd like to do is use an OSTree buildroot to create the disk image, partitioning, and filesystems (that would then later be mountable).

@dustymabe
Copy link
Contributor Author

Also, the bind mount stuff only affects the tree:/// right, not the buildroot?

@dustymabe
Copy link
Contributor Author

it looks like org.osbuild.container-deploy is what is being used to create the buildroot for bib. I guess that doesn't have this problem because it copies the filesystem directly from the container which has been normalized (i.e. software is available in /usr/bin/ from the start).

@dustymabe
Copy link
Contributor Author

Closing this out since we used an alternative implementation in coreos/coreos-assembler#3808

@dustymabe dustymabe closed this May 24, 2024
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