Commit graph

177 commits

Author SHA1 Message Date
Joe
7c724dd149 feat: Complete Phase 7.3 Advanced Features
Some checks failed
Debian Forge CI/CD Pipeline / Build and Test (push) Successful in 1m48s
Debian Forge CI/CD Pipeline / Security Audit (push) Failing after 6s
Debian Forge CI/CD Pipeline / Package Validation (push) Successful in 1m44s
Debian Forge CI/CD Pipeline / Status Report (push) Has been skipped
- Enhanced APT stage with advanced features:
  - Package version pinning and holds
  - Custom repository priorities
  - Specific version installation
  - Updated schemas for all new options

- New dependency resolution stage (org.osbuild.apt.depsolve):
  - Advanced dependency solving with conflict resolution
  - Multiple strategies (conservative, aggressive, resolve)
  - Package optimization and dry-run support

- New Docker/OCI image building stage (org.osbuild.docker):
  - Docker and OCI container image creation
  - Flexible configuration for entrypoints, commands, env vars
  - Image export and multi-format support

- New cloud image generation stage (org.osbuild.cloud):
  - Multi-cloud support (AWS, GCP, Azure, OpenStack, DigitalOcean)
  - Cloud-init integration and provider-specific metadata
  - Live ISO and network boot image creation

- New debug and developer tools stage (org.osbuild.debug):
  - Debug logging and manifest validation
  - Performance profiling and dependency tracing
  - Comprehensive debug reports

- Example manifests for all new features:
  - debian-advanced-apt.json - Advanced APT features
  - debian-docker-container.json - Container image building
  - debian-aws-image.json - AWS cloud image
  - debian-live-iso.json - Live ISO creation
  - debian-debug-build.json - Debug mode

- Updated .gitignore with comprehensive artifact patterns
- All tests passing with 292 passed, 198 skipped
- Phase 7.3 marked as completed in todo.txt

debian-forge is now production-ready with advanced features! 🎉
2025-09-04 09:33:45 -07:00
Joe
132cbef123 Add AppArmor support to debian-forge
- Add debian-forge-apparmor package with AppArmor stage support
- Create example AppArmor stage (org.osbuild.apparmor)
- Update workflow to build 9 packages total
- Add AppArmor manifest example for Debian Atomic
- Update todo with complete package structure
2025-08-29 17:45:28 -07:00
robojerk
56f029cbc0 Complete file structure reorganization for 1:1 osbuild compatibility 2025-08-26 15:38:59 -07:00
Achilleas Koutsou
7c30cf7280 test/data: update test manifests
Update test manifests by running tools/update-test-manifests.
This bumps the snapshot date for all CentOS Stream 9 test manifests,
which currently is only the authconfig and dnf4.versionlock.
2025-07-31 00:53:54 +02:00
Achilleas Koutsou
5d861870f8 test/data/manifests: fix module-platform-id
A couple of CentOS Stream 9 manifests were setting 'el9' as their
module-platform-id, making the depsolver complain.
Fixed to the correct 'platform:el9'.
2025-07-31 00:53:54 +02:00
Jelle van der Waa
f7ef1d6464 stages/vagrant: add virtualbox support
This adds support generating a virtualbox vagrant image. It differs from
libvirt by requiring an xml file and a vmdk image.

When the provider is set to libvirt it is required to pass a
`virtualbox` configuration section to this stage which must include the
mac address.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-07-04 14:09:47 +02:00
Achilleas Koutsou
e99dabe467 test: generate container-dev-null test manifests
Generate the manifests from the mpp yaml files.
2025-01-17 10:10:47 +01:00
Achilleas Koutsou
278b9130b0 test: (mpp) manifests for container embed
Add mpp files to create manifests that will embed the container (that
contains /dev/null) in an OS tree and compose an ostree commit from it.

This used to cause the rpm-ostree compose command to fail with:

    error: Writing commit: While writing rootfs to mtree: Not a regular file or symlink: null
2025-01-17 10:10:47 +01:00
Achilleas Koutsou
e2b9d0f3ca test: update rpmrepo snapshots
Required for latest version of rpm-ostree.
2025-01-17 10:10:47 +01:00
Achilleas Koutsou
6b45c81a29 test: create a container with /dev/null
Create a container using the new script and add it to the repo for use
in testing.
2025-01-17 10:10:47 +01:00
Jonathan Lebon
0331e6f313 stages: add coreos.live-artifacts.mono stage
This adds a new `org.osbuild.coreos.live-artifacts.mono` stage to build
CoreOS Live ISO/PXE artifacts. The code is heavily based on the
`cmd-buildextend-live` script from coreos-assembler [1], but a lot of
things had to be adapted:
- the stage is provided the deployed oscontainer tree, metal, and
  metal4k images as inputs
- we use chroot instead of supermin to execute some commands in the
  context of the target oscontainer
- a bunch of calls that were wrapped by libguestfs for us (e.g.
  mkfs.vfat, mksquashfs), we now have to call ourselves; to retain
  maximum compatibility, we ensured that we still effectively use the
  same args that libguestfs passed

And various other minor adjustments.

Of course, this is not really in line with the OSBuild philosophy
of having smaller-scoped stages. We have labeled this with a .mono
suffix to denote it is monolithic, similar to the existing
`org.osbuild.bootiso.mono` stage today.

Eventually we may be able to break this stage down if we find it worth
the effort. Alternatively the need for it may go away as we align more
with Image Mode.

[1] 43a9c80e1f/src/cmd-buildextend-live

Co-authored-by: Dusty Mabe <dusty@dustymabe.com>
Co-authored-by: Renata Ravanelli <renata.ravanelli@gmail.com>
2024-12-18 11:09:29 -05:00
Dusty Mabe
b7e3268ef0 manifests: updates for FCOS manifest
There have been a lot of changes to the CoreOS definitions in [1].
Let's update the test manifest here to more closely match what is
running in the field there.

[1] dcd60cfe01/src/osbuild-manifests
2024-12-18 11:09:29 -05:00
Dusty Mabe
aa11ec1ec1 test: add podman to fedora-build-v2 manifest
The org.osbuild.container-deploy stage uses podman. Including it
in the build here will allow that stage to be used with this
pipeline as the buildroot.

Include a workaround here for what I consider to be a bug [1] in that
`podman` will create `/etc/containers/networks` on first run if it
doesn't exist. That dir should just be created by an RPM. If we
don't include this workaround then the stage will fail when `podman`
attempts the `mkdir` because `/etc/containers` is mounted in from
the buildroot readonly.

[1] https://github.com/containers/common/pull/2265
2024-12-18 11:09:29 -05:00
Tomáš Hozza
76a0d56690 Test/manifests: update fedora manifests to F41
Update the fedora manifest template to F41. This is a preparation for
testing a new `org.osbuild.dnf5.sbom.spdx` stage. In addition to that,
F39 is already EOL and unsupported, so moving to a newer version is
desirable.

Regenerate all testing manifests.

Notes about specific changes:
 - Remove `pcmciautils` package from ostree manifest, because it has
   been deprecated and it is not available on F41 any more.
 - Add `python3-dnf` package to the Fedora build pipeline. The reason
   is that DNF5 is installed by default since F41 and the module is
   needed to test e.g. `org.osbuild.dnf4.sbom.spdx` or
   `org.osbuild.dnf4.mark` stages.
 - Add `python3-libdnf5` package to the Fedora build pipeline. This is a
   preparation for testing a new `org.osbuild.dnf5.sbom.spdx` stage.
 - Install `pam` in `authselect` stage test manifest, because otherwise
   authselect fails on the nonexistence of /etc/pam.d.
 - Adjust the `dnf4.mark` test case to also accept `dnf5` as the marked
   package, because on F41, `dnf` is a virtual provide of it.
 - Adjust stage tests and their diffs as needed.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-11-28 13:29:12 +01:00
Dusty Mabe
85f3bc1f09 test/data/manifests/fedora-coreos-container: fix CI
We updated the container in the registry so we need to update this
manifest to unbreak CI.
2024-11-28 11:53:57 +01:00
Simon de Vlieger
12dcf3c6d9 schema: metadata at the top level
Allows a new object under the top-level key `metadata` which contains a
`generators` property. This property is a list of all generators involved
in the creation of a manifest.

Each generator can add its name and version to this list.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2024-10-29 08:24:33 +01:00
Gianluca Zuccarelli
3f92d91fbf manifest/fedora-vars: update snapshot
We need a minimum version of `oscap-utils-1.3.10` which is available
in the `20240508` updates snapshot.
2024-05-31 19:51:46 +01:00
Tomáš Hozza
13035e6f4e Test/manifests: use SHA256 signed GPG key for c9s
The original CentOS Stream GPG key uses SHA-1 in its signature. However,
SHA-1 is by default not allowed by the c10s / el10 crypto policy. As a
result, running the stage tests which use c9s on c10s / el10 are failing
when rpmkeys tries to import the key.

As part of CS-1616 [1], the CS GPG key has been resigned using SHA256,
however only in c10s for now. Let's use the SHA256 signed GPG key from
c10s for c9s manifests, to make tests pass also on c10s / el10.

[1] https://issues.redhat.com/browse/CS-1616

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-05-30 20:56:33 +02:00
Renata Ravanelli
0b7dcf3cf4 Add coreos.platforms stage
- Process all necessary operations related to CoreOS
platforms is crucial and specific to CoreOS. This step
is essential for CoreOS exclusively.

- Our approach to handling 'platforms.json' may change as we
advance with the OSBuild work. However, we don't have a clear
vision about how it will be in the future yet, particularly as
we also manage similar components within the osbuild composer
to configure cloud parameters. We probably will know better
when we start working with the cloud artifacts.

As a summary, let's add it know to unblock us, and if we find a
better approach in the future, we can always go back and remove it.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2024-02-26 16:02:28 +01:00
Achilleas Koutsou
78ea8405a4 test: add test manifest for containers-storage
A manifest (mpp and json) that uses the new source and input with the
skopeo stage.

This depends on the image we store at
./test/data/stages/skopeo/hello.img

The plan is to test this by pulling the hello.img into the host root
storage, build the manifest, delete the image from storage, and check
the tree.
2024-02-21 17:55:37 +01:00
Dusty Mabe
f334ca92c6 manifests: convert a few more ostree deployments
These were missed in the initial conversion.
2024-02-12 11:25:11 -05:00
Michael Vogt
c0f670f035 test: add manifests for bootc.install-to-filesystem
This commit adds example manifests for a bootc.install-to-filesystem
system. It does not do more with them because running a full test
requires a working podman which is difficult to use inside our
GH runners that are already running inside docker.
2024-02-09 12:03:09 +01:00
Luke Yang
619a64f0bd stages/org.osbuild.qemu: make qcow2 compression optional
Modify the stages/org.osbuild.qemu stage such that compression is
optional. This resolves the image size differences between an image
built with coreos assember vs osbuild, as discussed in:
https://github.com/coreos/fedora-coreos-tracker/issues/1653#issuecomment-1928342241
2024-02-07 20:31:10 -05:00
Dusty Mabe
e1cbf92673 ostree: add convenience function for using default OSTree deployment
This adds a `default: true` option for all cases where OSTree
information is specified in schemas and allows for the information
to be picked up from the filesystem.

This is a safe operation because when building disk images there is
no known case where having two deployments makes sense. In the case
there ever were a case then the osname, ref, and serial options still
exist and can be used.

Co-authored-by: Luke Yang <luyang@redhat.com>
Co-authored-by: Michael Vogt <michael.vogt@gmail.com>
2024-02-07 18:50:38 -05:00
Dusty Mabe
011cf6851b stages(ostree.config): support setting sysroot.bootprefix
See https://github.com/ostreedev/ostree/pull/2705 and also
https://github.com/osbuild/osbuild/issues/1566.
2024-02-07 11:28:24 +01:00
Dusty Mabe
151b6e48ae stages(sgdisk): support label option
We only support `gpt` here so it would seem this option doesn't
make much sense to add, but it will make it so that the mpp-define-images
from osbuild-mpp can be passed in to `org.osbuild.sgdisk` just as it
can be passed in today to `org.osbuild.sfdisk`.
2024-02-06 17:44:31 +01:00
Nikita Dubrovskii
fc185dae8c support user-defined partition numbers for GPT disks
Partitions by default are indexed starting at 1, but in
some cases, such as CoreOS for IBM Z, it may be usefull
to set the 'partnum' for GPT disks explicitly, without
creating dummy partitions.

Now user can define an image:

```
    mpp-define-images:
      - id: image
        size: 10737418240
        table:
          uuid: 00000000-0000-4000-a000-000000000001
          label: gpt
          partitions:
            - name: boot
              type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
	      partnum: 3
              size: 786432
            - name: root
              type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
	      partnum: 4
              size: 4194304
```

So target disk would look like:

```
    Disklabel type: gpt
    Disk identifier: 00000000-0000-4000-A000-000000000001
    Device        Start     End Sectors  Size Type
    /dev/loop0p3   2048  788479  786432  384M Linux filesystem
    /dev/loop0p4 788480 4982783 4194304    2G Linux filesystem
```

This patch updates the osbuild-mpp tool and the sgdisk and sfdisk
stages to support this.

Co-authored-by: Dusty Mabe <dusty@dustymabe.com>
2024-02-06 17:44:31 +01:00
Luke Yang
477a21043e Create stages/org.osbuild.chattr stage
Add or remove the immutable bit to the specified mount directory.

The need we have for this right now is for the CoreOS builds where
the immutable bit being set on an OSTree deployment root doesn't
survive the `cp -a --reflink=auto` in the org.osbuild.copy stage when
being copied from the directory tree into the mounted XFS filesystem
we created on the disk image. Thus we have to workaround this loss
of attribute by applying the attribute directly on the mounted
filesystem from the disk.
2024-01-31 16:46:01 -05:00
Dusty Mabe
408b101799 manifests: support container_imgref var in FCOS manifest
This makes it easier to see/change the value globally.
2024-01-19 17:15:23 -05:00
Dusty Mabe
7d73c0e741 manifests: move osname to a var in fcos manifest
This makes it easier to see/change the value globally.
2024-01-15 11:53:21 +01:00
Dusty Mabe
d9fe4221b0 manifests: move boot/root fs uuid/label to var in fcos manifest
This makes it easier to see the important unique values in our
manifest.
2024-01-15 11:53:21 +01:00
Dusty Mabe
ac8a57c5a3 manifests: set sysroot.readonly config to true in fcos manifest
This is set in Fedora CoreOS today. Let's make it match here.
2024-01-15 11:53:21 +01:00
Dusty Mabe
7cf98cfbf1 manifests: remove partition UUIDs from fcos container manifest
We don't set the UUIDs today in COSA/create_disk.sh so let's not
statically set them here either. This means they'll get set to
something random.
2024-01-15 11:53:21 +01:00
Luke Yang
d089b429a7 stages/org.osbuild.ostree.config: support bls-append-except-default
Support setting the sysroot.bls-append-except-default value in the
OSTree config. This is used by CoreOS to support configuration used
for GRUB password support https://github.com/coreos/fedora-coreos-tracker/issues/1333
2024-01-11 12:55:12 -05:00
Dusty Mabe
fdd5d25c1e tests/fedora-coreos-container: switch to testing FCOS
The stable stream currently doesn't have a new enough bootupd to pass
the tests for the bootupd stage. Let's update to `:testing` for now
and we'll switch back to `:stable` later.
2024-01-10 01:15:18 +01:00
Renata Ravanelli
cdcb4598bb create org.osbuild.bootupd stage
Add the bootupd stage to install GRUB on both BIOS and UEFI systems,
ensuring that your bootloader stays up-to-date.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2024-01-10 01:15:18 +01:00
Dusty Mabe
ce8408a9c6 mounts: support mounting partitions
This allows us to map in a whole disk as a loopback device with parition
scanning rather than slicing up the disk and creating several loopback
devices. Something like this:

```
      - type: org.osbuild.copy
        inputs:
          tree:
            type: org.osbuild.tree
            origin: org.osbuild.pipeline
            references:
              - name:tree
        options:
          paths:
            - from: input://tree/
              to: mount://root/
        devices:
          efi:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              start:
                mpp-format-int: '{image.layout[''EFI-SYSTEM''].start}'
              size:
                mpp-format-int: '{image.layout[''EFI-SYSTEM''].size}'
          boot:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              start:
                mpp-format-int: '{image.layout[''boot''].start}'
              size:
                mpp-format-int: '{image.layout[''boot''].size}'
          root:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              start:
                mpp-format-int: '{image.layout[''root''].start}'
              size:
                mpp-format-int: '{image.layout[''root''].size}'
        mounts:
          - name: root
            type: org.osbuild.xfs
            source: root
            target: /
          - name: boot
            type: org.osbuild.ext4
            source: boot
            target: /boot
          - name: efi
            type: org.osbuild.fat
            source: efi
            target: /boot/efi
```

now becomes a little more simple:

```
      - type: org.osbuild.copy
        inputs:
          tree:
            type: org.osbuild.tree
            origin: org.osbuild.pipeline
            references:
              - name:tree
        options:
          paths:
            - from: input://tree/
              to: mount://root/
        devices:
          disk:
            type: org.osbuild.loopback
            options:
              filename: disk.img
              partscan: true
        mounts:
          - name: root
            type: org.osbuild.xfs
            source: disk
            partition:
              mpp-format-int: '{image.layout[''root''].partnum}'
            target: /
          - name: boot
            type: org.osbuild.ext4
            source: disk
            partition:
              mpp-format-int: '{image.layout[''boot''].partnum}'
            target: /boot
          - name: efi
            type: org.osbuild.fat
            source: disk
            partition:
              mpp-format-int: '{image.layout[''EFI-SYSTEM''].partnum}'
            target: /boot/efi
```

Fixes https://github.com/osbuild/osbuild/issues/1495
2023-12-22 10:18:29 -05:00
Luke Yang
5fc3b565a2 create org.osbuild.ostree.aleph stage
Similar to the aleph file created for builds of FCOS based on ostree
commit inputs, this adds an aleph file that contains information about
the initial deployment of data when the disk image was built

A new stage is preferred here as both the org.osbuild.ostree.deploy
and org.osbuild.ostree.deploy.container stages need an aleph file and
use of the aleph file may depend on the project/product. For example,
right now CoreOS is the only project that uses an aleph file, but others
may want it in the future.
2023-12-19 17:58:39 +01:00
Dusty Mabe
e077a4ceba manifests/fedora-vars: update to fedora 39
For https://github.com/osbuild/osbuild/pull/1475 we need to pick up
https://bodhi.fedoraproject.org/updates/FEDORA-2023-a3737d3bee so let's
bump to the latest Fedora 39 snapshot.
2023-12-19 17:58:39 +01:00
Ondřej Budai
7882db2543 test/data/manifests: add erofs-utils to Fedora buildroot
The next commit will add a stage test that requires erofs-utils. Let's add it
into the buildroot in a separate commit, so the history is more readable.
2023-12-01 10:36:06 +01:00
Dusty Mabe
e191dc1d0d tools/osbuild-mpp: set part ID from name if missing
For our Fedora CoreOS disk images we set the partition labels (name)
for the partitions. This is also supported using the primitives here
in OSBuild, but it wasn't obvious that I needed to set the name in
the mpp-define-images definition. Let's set the name there, but let's
also allow osbuild-mpp to set the `id`, which is what is used later
to access that partition from the `name` too if `id` isn't set.

This means we allow something like:

   - name: BIOS-BOOT
     type: 21686148-6449-6E6F-744E-656564454649
     bootable: true
     uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
     size: 100

rather than requiring something like:

   - id: BIOS-BOOT
     name: BIOS-BOOT
     type: 21686148-6449-6E6F-744E-656564454649
     bootable: true
     uuid: FAC7F1FB-3E8D-4137-A512-961DE09A5549
     size: 100
2023-11-29 10:37:08 +01:00
Dusty Mabe
5ad3f968e1 manifests: add example metal4k disk image for Fedora CoreOS
The created disk image would be written to 4k native disks.
2023-11-29 10:37:08 +01:00
Dusty Mabe
2e1f6e2553 tools/osbuild-mpp: support defining multiple image layouts
Right now you can only define a single image, lets add mpp-define-images
and accept a list.
2023-11-29 10:37:08 +01:00
Dusty Mabe
b824e1e57a manifests: fedora-coreos-container: human friendly partitioning
Let's define the partitioning for the example here in a more human
friendly way using GiB and MiB terms. This yields no change in the
generated json.
2023-11-29 10:37:08 +01:00
Dusty Mabe
0529ae79d1 tests: add metal output to fedora-coreos-container manifest
Also switch the qcow2 output to be a "qemu" platform image. This
change takes advantage of the recent org.osbuild.kernel-cmdline.bls-append
stage addition to modify kernel arguments in later pipelines.

To get a qemu image output:

- osbuild --output-directory out/ --export qemu test/data/manifests/fedora-coreos-container.json

To get a metal image output:

- osbuild --output-directory out/ --export metal test/data/manifests/fedora-coreos-container.json
2023-11-14 23:58:08 +01:00
Michael Vogt
f4f0c8f004 tests: remove lvm2 from the fedora-boot test manifest
With lvm2 the generated fedora fc38 boot image boots in degraded
mode with the following error:
```
[root@localhost ~]# journalctl -u lvm2-monitor.service|more
Nov 13 12:52:04 localhost.localdomain lvm[431]:   Failed to create /etc/lvm/devi
ces 2
Nov 13 12:52:04 localhost.localdomain lvm[431]:   Failed to set up devices.
Nov 13 12:52:04 localhost.localdomain systemd[1]: lvm2-monitor.service: Main pro
cess exited, code=exited, status=5/NOTINSTALLED
Nov 13 12:52:04 localhost.localdomain systemd[1]: lvm2-monitor.service: Failed w
ith result 'exit-code'.
Nov 13 12:52:04 localhost.localdomain systemd[1]: Failed to start lvm2-monitor.s
ervice - Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress p
olling.
```
This breaks the `test_boot.py` which expects the system after booting
in `running` state  (from `systemd is-system-running`).

It looks like this is some sort of race with our generated image,
potentially related to selinux, see
https://github.com/lvmteam/lvm2/blob/v2_03_18/lib/device/dev-cache.c#L1842
and note the lines around dm_prepare_selinux_context(). Note
also that `lvm2-monitor.service` runs with `DefaultDependencies=no`
(c.f.
https://github.com/lvmteam/lvm2/blob/v2_03_18/scripts/lvm2_monitoring_systemd_red_hat.service.in#L7)

Given that the official fc38 cloud image does not use lvm2 and that
it's not needed for the boot test this commit simply removes it
from the fedora-boot manifest. This fixes the test.
2023-11-14 10:45:44 -08:00
Michael Vogt
330cd0675b test: refresh test/data/manifests/fedora-boot.json 2023-11-14 10:45:44 -08:00
Ondřej Budai
fd82024153 test/data/manifests: remove F34 manifests
They are no longer used anywhere! We are free!
2023-11-14 10:45:44 -08:00
Ondřej Budai
506d6a7256 test/stages/authconfig: Use centos stream 9 as a base
Authconfig was completely retired from Fedora. In order to keep this stage
covered, this commit changes the test to use CentOS Stream 9, which still
ships this package.
2023-11-14 10:45:44 -08:00
Ondřej Budai
e4933b4fd6 test/run/boot: migrate to a v2 manifest
This commit migrates the test to a brand new V2, F38-based manifest. It's
actually based on osbuild-composer interpretation of the Fedora Cloud Base
image.
2023-11-14 10:45:44 -08:00