Commit graph

3341 commits

Author SHA1 Message Date
schutzbot
51116309ad schutzfile: Update snapshots to 20250101 2025-01-03 11:56:01 +01:00
Tomáš Hozza
8924392db3 Schutzbot: update terraform ref
This should fix the F39 runner bootstrapping issues.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2025-01-03 11:15:25 +01:00
Achilleas Koutsou
63358b131d schutzbot: update Achilleas' ssh keys 2025-01-02 18:36:05 +01:00
Colin Walters
fcb93bde01 kickstart: Drop ostree signature verification flag
It's a no-op nowadays, we dropped support for the custom
ostree-container signature verification status.

Signed-off-by: Colin Walters <walters@verbum.org>
2024-12-18 16:34:30 -08:00
schutzbot
08d0b657ee Post release version bump
[skip ci]
2024-12-18 20:00:01 +00:00
Dusty Mabe
cd19587464 stages/coreos.live-artifacts: move rename of vendor dir
Seems more appropriate in copy_configs_and_init_kargs_json() since this
is where files were originally copied in.
2024-12-18 11:09:29 -05:00
Dusty Mabe
d5aff7b1af stages/coreos.live-artifacts: drop usage of dir fd
Rework rename of vendor directory to not use dfd APIs.

This was requested in code review.

Also added comments since I now understand it better.
2024-12-18 11:09:29 -05:00
Dusty Mabe
45583720af stages/coreos.live-artifacts: stop chmod initrd.img
The initramfs.img in Fedora and RHEL CoreOS images is already 644
so this isn't needed.
2024-12-18 11:09:29 -05:00
Dusty Mabe
b8d986b51c stages/coreos.live-artifacts: drop kernel rename for s390x
The rename to get file names + suffix with < 8 characters
was done in [1] when our initramfs was named initramfs.img.
It was subsequently renamed to initrd.img in [2] and the
rename of the initramfs was dropped but the rename of the
kernel was never dropped. Since vmlinuz is already < 8
characters let's just drop the rename here too.

[1] 60400910bb
[2] 6f533ef55e
2024-12-18 11:09:29 -05:00
Michael Vogt
af710ee740 stage: add test for core live-artifacts stage
This commit adds some unit tests around the coreos live-artifcats
mono stage.

- test/coreos_live_artifacts: add test for align_initrd()
- test/coreos_live_artifacts: add test for extend_initramfs()
    - This actually tests the mkinitrd_pipe() function, which
      extend_initramfs() calls after opening the file.
- test/coreos_live_artifacts: add test for make_stream_hash()
- test/coreos_live_artifacts: add test for make_efi_bootfile()

Co-authored-by: Achilleas Koutsou <achilleas@koutsou.net>
2024-12-18 11:09:29 -05:00
Achilleas Koutsou
4e93a66311 stages/coreos.live-artifacts: refactor into more functions
This improves the readability and maintainability of the code to
have it split into smaller pieces.

Co-Authored-by: Dusty Mabe <dusty@dustymabe.com>
2024-12-18 11:09:29 -05: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
139837f628 manifest_tests.py: use osbuild-image-info from osbuild package
Modify the test case to not use the image-info copy from manifest-db.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
503cfb0936 CI: move the manifest_tests.sh from schutzbot/ to test/cases/
The test script should have been in the test/cases/ directory in the
first place.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
e90a74f088 SELinux: apply osbuild_exec_t to /usr/bin/osbuild-image-info
This is needed, for the tool to be able to read SELinux labels from the
inspected image, which are not known to the host on which it is running.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
6738679f2e SPEC: include osbuild-image-info in the -tools subpackage
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
dde7da1528 setup.py: install tools/osbuild-image-info
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
bced04b57d tools/osbuild-image-info: fix issues reported by autopep8
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
0f99200ba1 tools: add image-info tool as osbuild-image-info
Add the image-info tool as osbuild-image-info from the manifest-db
repository [0]. This is an exact copy without any changes.

[0] 8e05a898d4/tools/image-info

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 12:50:32 +01:00
Tomáš Hozza
7699f8134f Add org.osbuild.dnf5.sbom.spdx stage
Add DNF5 version of the `sbom.spdx` stage, which generates an SPDX SBOM
document from a given FS tree using libdnf5 API.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-18 05:46:45 +01:00
Simon Steinbeiss
cdf8856f19 github/actions: Enable /jira-epic slash commands
This change allows for using the command to create Jira Tasks under a
given Epic both in a pull request comment or in the pull request
description.
2024-12-16 11:02:34 +01:00
schutzbot
a875ba7906 schutzfile: Update snapshots to 20241210 2024-12-12 19:29:31 +01:00
Brian C. Lane
41658da9cf org.osbuild.grub2.iso.legacy: Add grub2 setup for booting BIOS ISO
This is the BIOS version of the grub2 iso stage. It installs the config
file and copies over the grub2 modules to /boot/grub2/
2024-12-12 09:29:25 +01:00
Brian C. Lane
5a8b2edaa0 typo: Fix incorrect 'tar archive' descriptions in stage metadata
SSIA
2024-12-10 15:16:33 +01:00
Renata Ravanelli
ca25b07c5c CODEOWNERS: Assign ownership for CoreOS-related files
- Introduce a CODEOWNERS file to designate the CoreOS team as responsible for maintaining files related to CoreOS.
- This change ensures collaborative support, alleviating the burden solely on the osbuild team.
- By assigning ownership, we aim to enhance code quality and responsiveness to issues affecting CoreOS.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2024-12-05 09:28:59 +01:00
Michael Vogt
25d3656068 util,test: add test for new shlex based os-release parsing
This commit adds a tiny unit test for the new `shlex` based
os-release parsing and tweaks the error message in a small
and non-functional way (just because it's slightly nicer
for a user). The test checks for three keys NAME which is
quoted with `"`, ID which is not quoted and OSTREE_VERSION
which is quoted with `'`.
2024-12-04 14:54:00 -05:00
Renata Ravanelli
07d4f6955d util/osrelease.py: Replaced string stripping with shlex.split()
- Replaced string stripping with `shlex.split()` to properly
handle values in the os-release file;
- This ensures cleaner and more accurate key-value assignments,
follwing a broader set of shell-like parsing rules;
- Add os-release file for Fedora CoreOS 40 for testing.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2024-12-04 14:54:00 -05:00
Dusty Mabe
f4b899873b osbuild/remoteloop: add more loop device options
This adds lock, partscan, read_only, sector_size to _create_device()
similar to make_loop() from devices/org.osbuild.loopback.
2024-12-04 16:30:55 +01:00
schutzbot
b1f16e9ab4 Post release version bump
[skip ci]
2024-12-04 08:32:12 +00:00
Ondřej Budai
b3123a1c19 github: prevent script injections via PR branch names
Prior this commit, ${{ github.event.workflow_run.head_branch }} got
expanded in the bash script. A malicious actor could inject
an arbitrary shell script. Since this action has access to a token
with write rights the malicious actor can easily steal this token.

This commit moves the expansion into an env block where such an
injection cannot happen. This is the preferred way according to the
github docs:
https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
2024-12-03 18:40:04 +01:00
Renata Ravanelli
458df8695f util/chroot: Add support for custom directory bind mounts
- Add optional bind_mounts parameter to __init__ method;
 - Enhanced methods to accept an optional `bind_mounts`.
This allows for more flexible for configurations when setting
up bind mounts.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2024-12-03 15:22:40 +01:00
Tomáš Hozza
f1c43ae5bd util/sbom/spdx: rename {,s}bom_pkgset_to_spdx2_doc()
Rename the function for consistency reason. The parent package is named
SBOM (originally BOM).

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-02 23:24:39 +01:00
Tomáš Hozza
562a30ce93 osbuild-depsolve-dnf: add SBOM support for DNF5
Enable generating SBOM documents for depsolved transactions when using
DNF5. Enable SBOM testing with DNF5 in unit tests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-02 23:24:39 +01:00
Tomáš Hozza
def6a9fabd util/sbom: add support for DNF5
Add functions for transforming package sets depsolved using libdnf5 to
the SBOM standard-agnostic model. Cover the function with unit tests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-02 23:24:39 +01:00
Tomáš Hozza
c3f3588419 test_util_sbom_spdx: fix imported module name
There was a typo in the imported module name, which caused the test to
be always skipped.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-02 23:24:39 +01:00
Tomáš Hozza
0a64f08f08 test_util_sbom_dnf: fix imported module name
There was a typo in the imported module name, which caused the test to
be always skipped.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-02 23:24:39 +01:00
Tomáš Hozza
7993b78e7c Testutil: add DNF5 helper function for depsolving
This will be used for testing the SBOM implementation with DNF5.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-12-02 23:24:39 +01:00
Achilleas Koutsou
3bf6ca399f test: add new containers.unit.create options in test 2024-12-02 12:55:30 +01:00
Pierre-Yves Chibon
17fda9e318 Expand the options available in containers.unit.create
Add the option to specify the SELinux type label and file type label for
the process.
Add the option to specify a tmpfs mount to create into the container.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2024-12-02 12:55:30 +01:00
Tom Koscielniak
9b66ad8123 Bump RHEL 10 from beta to nightly
Bumping Rhel 10 runners from beta to nightly, running manifests on 9.6 nightly and also removing the Rhel 9.5 nightly runners altogether.
2024-11-29 14:47:45 +01:00
Michael Vogt
add78e7f47 sources: skip ostree tests if no ostree binary if found
This commit skips the ostree tests if no ostree binary is available.
2024-11-28 20:06:51 +01:00
Michael Vogt
bca7fb1418 workflow: install python3-pytest too to workaround test_host.py
The test_host.py:test_signals_on_separate_fd (and more)  runs
itself but that run will happen without the tox env so a pip/tox
installed pytest will not be found, install the pytest package
as a workaround.
2024-11-28 20:06:51 +01:00
Michael Vogt
b3b639517a workflow: add smoke test that runs unit tests as user
This commit adds a tiny smoke test that runs the unit tests as
a normal user on a regular github runner. This should ensure that
we catch issues like in osbuild#1936.
2024-11-28 20:06:51 +01:00
Tomáš Hozza
a6c7b56d98 Tests/tox: latest Fedora uses Python 3.13, so use it
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-11-28 13:29:12 +01:00
Tomáš Hozza
81cc279074 GH actions: use the latest build of osbuild-ci* containers
This will bring the latest image builds with new dependencies for unit
tests.

In addition, pin down the osbuild-ci-c*s container to a specific tag, to
ensure stability of the CI.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-11-28 13:29:12 +01: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
Tomáš Hozza
03f16e9a4c Schutzfile: use released repositories for F41
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