Commit graph

47 commits

Author SHA1 Message Date
Achilleas Koutsou
e2b9d0f3ca test: update rpmrepo snapshots
Required for latest version of rpm-ostree.
2025-01-17 10:10:47 +01: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
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
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
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
da07300f38 stages/ostree.deploy: create ostree_commit_deploy function
This drains some of the logic out of `main()` into a
`ostree_commit_deploy()` function. Doing this will make it easier
to diff this stage with the recently added `ostree.deploy.container`
stage.

This commit also changes the `ref` in the schema to be optional,
which is a fixup for 3cc733d. We need to make the ref optional because
the ref could come from the user in the toplevel schema or it could
come from input commit in the schema.
2023-10-24 13:46:10 -04:00
Dusty Mabe
ca3b831c29 manifests/fedora-vars: bump snapshot date
This should correspond to the snapshots from 6b85149.
2023-10-21 07:34:32 +02:00
Dusty Mabe
3cc733d7cd stages/ostree.deploy: support an ostree input
This will allow a user to specify an input directly to the deploy
stage rather than requiring a ostree.pull stage to be called first.

Adding inputs will also be useful when we soon add support for
deploying from a container rather than just deploying from an existing
ostree commit in a repo.
2023-10-06 15:55:26 +02:00
Ondřej Budai
6e254c95af stages/ostree.encapsulate: use new entrypoint on rpm-ostree >=2023.2
rpm-ostree 2023.2 dropped the `rpm-ostree container-encapsulate` entrypoint.
Instead, we have to use `rpm-ostree compose container-encapsulate`.

Adjust the code that it selects the correct entrypoint based on the rpm-ostree
version.

Since the new stage now requires python-yaml, add it to the buildroot and
regenerate all manifests.
2023-08-08 12:41:17 +02:00
Ondřej Budai
59edb5ea6c test/data/stages: update to the new structure
This commit changes these manifests to use the new fedora-vars.ipp and
fedora-build-v2.ipp infrastructure to remove all hardcoded Fedora versions.

Note that this is currently limited only to stage tests that already use v2
manifests. v1 manifests will come later.

Notes:
The buildroot needs additional packages: zstd and openscap-utils. Thus,
all manifests had to be regenerated.

GPG keys were added where missing.

The oscap.remediation stage now creates a bunch of files with timestamps in
their names under /var/lib/authselect/backups. Thus, the newly introduced
`added_directories` directive is used to handle them.

I reviewed all changes in `diff.json` files, and they all seem sane given
that we jumped 4 releases forward.
2023-08-08 12:41:17 +02:00
Ondřej Budai
82b7053983 manifests/fedora-vars: update to fedora 38
What? I can just edit variables in one files and all(*) manifests get updated
content? That's impressive.

(*) We will be able to do all once we migrate all to the new format. For now,
    the usual disclaimer applies:

    This change is applied only to manifests based on fedora-build-v2 for now.
2023-08-08 12:41:17 +02:00
Christian Kellner
1d193008d4 test/data: set source epoch for certain pipelines
For selected pipelines, set the source epoch. The date is set to
the current updates snapshot date (in epoch).
2022-12-15 13:10:35 +00:00
Christian Kellner
48a4419705 test/data: persist the journal for ostree images
Include the new journald config stage to configure journald to
persist the journal. This is needed since we don't create the
`/var/log/journal` directory that journald uses to switch the
default to persistent storage. But instead of creating that
directory, we explicitly configure journald via the new stage.
This is also what Fedora CoreOS does.
2022-11-16 17:51:56 +01:00
Christian Kellner
638d5b834d test/data: add 'rw' kernel flag to ostree image
A recent commit (8a7b6d3) fixed the ostree config stage and thus
we actually properly set the readonly flag for the deployment.
This broke the image since we did not specify the `rw` kernel flag
and as a consequence the ostree mounting code in the initrd broke.
2022-11-16 17:51:56 +01:00
Christian Kellner
bca3fe62d5 test/data: add binutils to fedora-build-v2
Add binutils for `objcopy` needed to build UKIs.
2022-11-14 20:10:59 +01:00
David Rheinsberg
1bdf038d36 ci: update container and actions
Update the osbuild-ci container and privdocker action to the most recent
builds.

This changes the ostree-image-tests since the Fedora update pulled in
util-linux/fdisk changes that align partition sizes. Hence, the ostree
tests need to be changed to have aligned partition sizes as well. For
more information, see:

    commit 921c7da55ec78350e4067b3fd6b7de6f299106ee
    Author: Karel Zak <kzak@redhat.com>
    Date:   Thu Jan 27 10:50:45 2022 +0100

        libfdisk: (gpt) align size of partition by default

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
2022-09-23 12:08:10 +02:00
Christian Kellner
07d3605385 manifests: set db path in ostree commit
rpm-ostree is setting the database path to /usr/share/rpm during
the build. Do so as well.
2022-08-15 18:22:59 +02:00
Christian Kellner
c28269f8d9 manifests: enable cloud-init services in commit
It is instabled, but not a enabled via presets so we have to
explicitly enable it.
2022-08-13 19:21:52 +01:00
Christian Kellner
5570e2a92e manifests: upgrade ostree commit, image to F36
Fedora 34 is end of life and we ought to be testing with newer
releases so that we catch issues like the authselect one, that
is detailed in "stages/rpm: support marking install as ostree".
2022-08-13 19:21:52 +01:00
Christian Kellner
899fdcd5d9 manifests: set rpm/ostree_booted for commit
See "stages/rpm: support marking install as ostree" for more
information why this is needed on Fedora 36 and newer.
2022-08-13 19:21:52 +01:00
Christian Kellner
10255dbdcc test/manifests: base ostree image on commit
Instead of re-defining the ostree-commit in the ostree-image.mpp
file, import the needed pipelines to build the commit and use
that.
2022-08-13 19:21:52 +01:00
Christian Kellner
07a45ba34c test/data: include python3-toml in v2 build root
Prepares for testing stages that use python3-toml to edit config
files.
2022-07-11 16:25:56 +02:00
Christian Kellner
5edb54bc2d test/data: add gdisk to fedora 34 v2 build root
Will be use in later test. Separated as its own commit for clarity.
2022-05-23 13:00:44 +02:00
Alexander Larsson
b6629de7b2 Add skopeo to f34-build-v2 manifest
This will be needed to test the container support.
Also update the test data
2022-02-10 14:43:17 +01:00
Christian Kellner
e62133a334 manifests/ostree-image: convert to LUKS
Wrap the LVM volume group in a LUKS container with the passphrase
`osbuild` (yes, really, super secure). NB: the kernel command line
is changed to include `luks.uuid` which is needed so that dracut
will attempt to open the luks container. This corresponds to an
crypttab entry `luks-uuid UUID`. We cannot use the /etc/crypttab
for ostree based images because the initrd is created at commit
time but they luks volume is created at deployment time, we have
to use the kernel command line instead. See the man page for the
systemd-cryptsetup-generator(8) for more information.

The `cryptsetup` package is included in the build root since it is
needed by the `org.osbuild.luks2.format` stage. All manifests that
are using the `f34-build-v2` build root change as a result.
2021-12-09 00:44:21 +00:00
Christian Kellner
bd4ab1d36f stages/lvm2.create: fix 'size' and add 'extents'
The `size` option was using `-l`, which in fact was `--extents`.
Fix that to use `--size` and add a new option `extents` that
will in fact call translate to `--extents` and this replace the
current use of the `size` option.
Adapt the `fedora-ostree-image` test manifest to use `extents`.
2021-11-03 15:09:35 +00:00
Christian Kellner
5828da8d62 test/data: use ostree.deployment in fedora image 2021-10-30 15:32:44 +01:00
Christian Kellner
7ec305a343 ostree.config: add bootloader config option
Ability to set the bootloader backend that OSTree should use. NB:
normally this should be set to `none` since in modern distros and
bootloaders the BLS is used and the BLS snippets are generated on
`none` but none of the of the specific bootloader tools are run,
like `grub2-mkconfig` for grub.

Update the fedora image manifest to use that config setting.
2021-09-09 12:29:54 +02:00
Christian Kellner
82cc2aeb4e test/data: use cloud-init in ostree image
Although zezere is the official tool, cloud init is easier to use
for local testing so switch to that.
2021-08-28 16:34:37 +02:00
Christian Kellner
c788a74fb5 stages/ostree.deploy: add remote option
Add an optional `remote` to the deployment of the ostree so that
the it is tied to the specified remote. This is needed later for
updating the commit from that remote.
2021-08-28 16:34:37 +02:00
Christian Kellner
7ea9796d9b stages/ostree.pull: add remote parameter
Add an optional `remote` parameter that can be used to specify the
the remote to track for the pulled commits.
2021-08-28 16:34:37 +02:00
Christian Kellner
877f2ba3c3 stages/grub2: greenboot support
Greenboot is the idea of automatically rolling back bad updates,
i.e. updates that do not boot successfully. The implementation
is split between the boot loader and a user space component.
The latter sets two variables `boot_counter`, which indicates
the maximum number of boot attempts and `boot_success` which
tells the boot laoder if a previous boot was successful. The
bootloader on the other hand will decrement the counter variable
and reset the success indicator one.
An implementation of the user space component for rpm-ostree is
called `greenboot`.
2021-08-25 20:53:12 +02:00
Christian Kellner
8014ab5f1c test/data: use LVM in fedora-ostree-image
Now that we have support for LVM convert the ostree image manifest
to use it for the root partition.
2021-08-13 12:20:54 +02:00
Christian Kellner
c1c9c550d8 test/data: include lvm2 package in v2 build root
Needed to create lvm2 volume groups and logical volumes.
2021-08-13 12:20:54 +02:00
Christian Kellner
ae1296e33a formats/v2: mounts are arrays
The order of entries in a dictionary is not specified by the JSON
standard and hard to control when marshalling dictionaries in Go.
Since the order of mounts is important and the wrong order leads
to wrong mount trees change the `mounts` field to an array. This
breaks existing manifests but after careful deliberation it was
concluded that the original schema with mounts as dictionaries
is not something we want to support. Apologies to everyone.

Adjust the schema of the copy and zipl stage accordingly.
2021-07-21 13:28:22 +02:00
Javier Martinez Canillas
6901c4dfc5 test/data: use UTF-8 locale on all manifests
The manifests set a "en_US" locale but this causes gnome-terminal to not
run due a non UTF-8 locale being used, which is an unsupported config:

gnome-terminal-server[1899]: Non UTF-8 locale (ISO-8859-1) is not supported!

Reported-by: Stephen Smoogen <ssmoogen@redhat.com>
2021-07-14 23:50:24 +02:00
Christian Kellner
d09f07a24c test/data: remove users from ostree-image
Let's not have users in the ostree commit itself since we have
zezere ignition enabled for user provisioning.
2021-07-12 18:21:05 +02:00
Christian Kellner
284e73a018 test/data: enable greenboot and zezere ignition
Enable greenboot for health checks and zezere ignition so we get
user provisioning like Fedora IoT. Also explicitly opt into rngd
and sshd.
2021-07-12 18:21:05 +02:00
Christian Kellner
75e3856967 test/data: use new ostree stages
Use the new ostree stages instead of the old monolithic one.
2021-07-12 18:21:05 +02:00
Christian Kellner
a350602a77 tools/mpp: sort urls for v2 manifests
The logic to sort urls was added globally in `mpp-import-pipeline`
but only the in the v1 code path was the `state.manifest_urls`
variable set and thus for v2 the actual sorting did not happen.
Fix this and set the `manifest_urls` to the `org.osbuild.curl`
items, which makes sense because we only know how to sort those.
2021-06-22 21:10:49 +02:00
Christian Kellner
aa00e62fed tools/mpp: sort source urls
In both mpp-depsolve and mpp-import-pipeline, sort the packages to
url dictionary before writing the JSON. This makes it easier to
look for packages but more importantly ensures that the resulting
set of packages has the same ordering in the sources section
independently of how it was assembled.
2021-06-21 18:04:13 +02:00
Christian Kellner
98133add11 stages/sfdisk: use device instead of file
Instead of operating directly on a file, which was previously specified
by `filename`, operate on a device. This is more flexible since a file
can be accessed via a loop back device; but the inverse is obviously
not true, like other devices can not be accessed via a plain file.
Therefore, re-factor the stage to use a device and adapt the existing
test (`fedora-ostree-image`).
2021-06-14 14:15:20 +01:00
Christian Kellner
8a7596c691 test/data: add fedora ostree image manifest
Add a new manifest that creates an ostree commit, deploys that,
creates a raw image and copies the deployment into it. The
resulting artefact is a bootlabel qcow2 image.
2021-06-09 18:37:47 +01:00