Commit graph

2388 commits

Author SHA1 Message Date
schutzbot
722d023104 Post release version bump
[skip ci]
2023-07-19 08:13:33 +00:00
Gianluca Zuccarelli
74eed6a33b stages: add openscap autotailor stage
Add a new stage to generate an OpenSCAP tailoring file. The stage
overrides a base OpenSCAP profile by enabling and disabling user
selected rules and creates a new profile name which can be used for
OpenSCAP scanning and remediation.
2023-07-18 15:29:13 -07:00
Brian C. Lane
8f6535cacc org.osbuild.rpm: Add some context to rpmkeys failure
This will hopefully help debug problems when the signature check fails.
You need to manually take the hash and look it up in the manifest
sources list to figure out what package failed since this stage doesn't
have access to sources.
2023-07-18 18:42:47 +02:00
Brian C. Lane
3318ac95ab Schutzfile: Fix f38 snapshot references
Fedora 38 is no longer branched. Switch to the release names for the
snapshots.
2023-07-18 15:34:01 +02:00
Simon de Vlieger
f1b79c8a73 stage: anaconda, allow access to more config
Anaconda has deprecated the `kickstart_modules` directive and instead
now has `activatable_`, `forbidden_`, and `optional_modules`. This is
available starting in Fedora 35.

This change allows frontend code (`osbuild-composer`) to put version
checks in place to write the correct keys.
2023-07-18 13:41:05 +02:00
Ondřej Budai
4439297cc4 test/data: introduce UKI also for CentOS Stream
This is a straightforward port of the UKI from Fedora to CentOS Stream.
Changes:

- Packages that does not exist in CS9 were removed:
  - shim-ia32
  - grub2-efi-ia32-cdboot
  - btrfs-progs
- Squashfs compression was changed from lz4 to gzip, because lz4 for squashfs
  isn't enabled in RHEL 9 kernel
2023-07-18 11:30:09 +02:00
Ondřej Budai
c01caae3ac stages/squashfs: add support for zstd compression
Fedora and RHEL 9 kernels support it and since it's an interesting alternative
to other compression methods, we should support it in osbuild.

I also took the liberty of sorting the compression methods alphabetically.
2023-07-18 08:58:26 +02:00
Brian C. Lane
917f628bba Schutzfile: Add Fedora 39 rawhide repos 2023-07-17 12:18:10 +02:00
Brian C. Lane
43d776e55e terraform: Add f39 runners 2023-07-17 12:18:10 +02:00
Brian C. Lane
e9d795a279 .gitlab-ci.yml: Run rpmbuild for Fedora 39
The osbuild-composer libdnf5 PR needs osbuild artifacts for Fedora 39 in
order to run the tests.
2023-07-17 12:18:10 +02:00
Simon de Vlieger
82e72f1b64 test: update test for sysconfig 2023-07-17 12:15:12 +02:00
Simon de Vlieger
36ee0d3edc stages/sysconfig: add desktop support 2023-07-17 12:15:12 +02:00
Simon de Vlieger
829183a1f3 stages/sysconfig: add livesys support 2023-07-17 12:15:12 +02:00
Ondřej Budai
dc372bbdea stages/rpm: set machine-id to 444
According to the systemd spec file, /etc/machine-id should have the 444
permissions. Thus, we need to chmod the file to 444 after it's created.

See:
 - 9c05b44a4b/f/systemd.spec (_821)
 - https://bugzilla.redhat.com/show_bug.cgi?id=2221269
 - https://issues.redhat.com/browse/COMPOSER-1992
2023-07-12 10:53:31 +02:00
Eric Curtin
d2b6a2e570 runners: Asahi Fedora Remix to Fedora Asahi Remix
This name got changed in Fedora 38, basically the Fedora and Asahi were
flipped.
2023-07-07 16:13:09 +02:00
schutzbot
06072d5d89 Post release version bump
[skip ci]
2023-06-27 12:58:15 +00:00
Ondřej Budai
c90b587dcc inputs: Move arguments for InputService.map to a temporary file
Prior this commit, the arguments for the input service were passed inline.
However, jsoncomm uses the SOCK_SEQPACKET socket type underneath that has
a fixed maximum packet size. On my system, it's 212960 bytes. Unfortunately,
that's not enough for big inputs (e.g. when building packages with a lot
of rpms).

This commit moves all arguments to a temporary file. Then, just a file
descriptor is sent. Thus, we are now able to send arbitrarily sized args
for inputs, making osbuild work even for large image builds.
2023-06-27 10:56:10 +02:00
Alexander Todorov
8c29e8144d CI variable name has changed,
see
25d1a458a0
2023-06-26 19:51:42 +02:00
schutzbot
8a10dc7b5d Post release version bump
[skip ci]
2023-06-21 08:13:27 +00:00
Alexander Todorov
107ac2b18f Remove runners which are not used in manifest-db upstream 2023-06-21 09:57:34 +02:00
Alexander Todorov
9b026400bc Update manifest-db commit 2023-06-21 09:57:34 +02:00
Alexander Todorov
65dbd23432 Also test on RHEL 8.9 and 9.3 nightly 2023-06-21 09:57:34 +02:00
Michael Hofmann
840df1dc92 Restore LOOP_CONFIGURE fallback for kernel < 5.8
The fallback that was initially present in #1253 is needed for the
current GitLab runners which have a Container-Optimized OS [1] with
kernel 5.4 [2] without support for LOOP_CONFIGURE [3].

[1] https://docs.gitlab.com/ee/ci/runners/saas/linux_saas_runner.html
[2] https://gitlab.com/cki-project/containers/-/jobs/4381560305#L31
[3] https://gitlab.com/cki-project/containers/-/jobs/4381560305#L1166

Signed-off-by: Michael Hofmann <mhofmann@redhat.com>
2023-06-20 12:18:15 +02:00
Antonio Murdaca
4bfd646b0d stages: add new zstd stage
typo fix test/data/stages/README.md
add updated test-data after adding zstd to fedora-34-build-v2.mpp.json

Signed-off-by: Sarita Mahajan <sarmahaj@redhat.com>
2023-06-14 09:44:00 +02:00
schutzbot
a8bba69935 Post release version bump
[skip ci]
2023-06-07 08:14:17 +00:00
SchutzBot
2e3f5fc047 schutzfile: update manifest-db ref 2023-06-05 2023-06-05 11:11:54 +02:00
Simon de Vlieger
5062f4218a readme: remove IRC mention 2023-06-01 14:40:28 +02:00
Simon de Vlieger
f032a1f10f readme: mention matrix, redo headings
This redoes the headings to have the correct indent levels, it also
mentions the Matrix channel that we now have and the mailing list.
2023-06-01 14:40:28 +02:00
Simon de Vlieger
4bd169c20e stage: add a livesys stage
This stage is necessary for the live image work being done in
`osbuild-composer` at the moment.
2023-05-31 09:30:55 +02:00
Tomáš Hozza
15b7b6fab3 test/stages: add helper function for testing partitioning stages
Refactor unit test implementation for `parted`, `sfdisk` and `sgdisk`
stages by extracting the common parts into a helper function. Each stage
now implements only its own function for filtering `sfdisk --json`
output and calls the common helper function.

In addition, flip the oder when comparing the expected and actual output
from `sfdisk --json`, to make it more easier to comprehend.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-30 12:05:33 +02:00
Tomáš Hozza
17ebae23dc test: add unit test for sfdisk stage
Add a missing unit test for the `sfdisk` stage.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-30 12:05:33 +02:00
Tomáš Hozza
66301ae5c3 test/sgdisk: delete sectorsize from expected data if not in output
The `sfdisk` tool on RHEL-8 does not include the `sectorsize` in its
output when we are testing the `sgdisk` stage. As a result, the test
case fails, because the expected and actual output differs. Modify the
test to delete the `sectorsize` key from the expected output if it is
not present in the actual output.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-30 12:05:33 +02:00
Tomáš Hozza
560fcc099d test/parted: delete sectorsize from expected data if not in output
The `sfdisk` tool on RHEL-8 does not include the `sectorsize` in its
output when we are testing the `parted` stage. As a result, the test
case fails, because the expected and actual output differs. Modify the
test to delete the `sectorsize` key from the expected output if it is
not present in the actual output.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-30 12:05:33 +02:00
Tomáš Hozza
9a47a56639 mockbuild.sh: retry dnf install up to 5 times
We have been observing a race condition in our CI when installing
packages at the beginning of the SUT setup. This happens only on RHEL
and it is caused by the `rhc` tool, which executes some Ansible
playbooks on system startup, which install packages using dnf. This
interferes with dnf commands ran by the `mockbuild.sh` script, which
results in a job failure.

Since there seems to be no way to determine if `rhc` finished "its
thing", let's retry dnf install of packages up to 5 times with
exponential backoff in between retries.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-29 15:53:24 +02:00
Tomáš Hozza
8aba0d196e Spec: use %forgeautosetup macro in %prep phase
Use %forgeautosetup macro to prepare sources in the %prep phase to
auto-apply any potential downstream patches just by listing them in the
spec file using `PatchX`. Otherwise, the macro needs to be modified each
time a downstream patch needs to be applied in downstream.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-26 14:10:51 +02:00
Tomáš Hozza
3e780762cb stages/sgdisk: option to not quote partition names passed to sgdisk
The partition name in the sgdisk stage was previously quoted when
passed to sgdisk as an argument. I think that this was done because
the sgdisk man page states that:

```
If you want to set a name that includes a space, enclose it in
quotation marks, as in sgdisk -c 1:"Sample Name" /dev/sdb.
```

However, this should apply only when sgdisk is run in a shell, so that
the argument is not split by shell into multiple arguments and passes
as a single string.

The stage is executing sgdisk using Python `subprocess` module, which
does not need strings with spaces to be quoted, because they are passed
to the command as separate items which are not split in any way.

The previous behavior of the stage was that these quotes became part of
the actual partition name in the partition table.

After a discussion within the team, we determined that this is a bug.
However, fixing it would result in osbuild producing a different
artifact for the same manifest, compared to osbuild version without such
fix. This is undesired.

For backward compatibility, a new `quote_partition_name` property is
added to the stage options, which can be used to make the stage not
quote the partition name when passed to `sgdisk`. As a result, the
partition name won't be quoted in the partition table.

The default stage behavior us kept.

Modify unit tests to use this option by default.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-05-26 08:43:52 +02:00
Eric Chanudet
267f3909bd stages/sfdisk: support changing GPT partition attribute bits
util-linux 2.38.1, at least, does not accept raw bit indexes for the
reserved bits (Bit0-2). The undefined ones are out of reach as well and
will have sfdisk throw an error. Only the GUID specific ones can be
passed as raw indexes. This can be verified with the --part-attrs
option. It replicates the format of the --dump output:

$ dd if=/dev/zero of=disk.img bs=$((4<<10)) count=$((32<<10)
$ sgdisk disk.img -n 0:0:+64M -t 0:0FC63DAF-8483-4772-8E79-3D69D8477DE4 -c 0:root
$ sgdisk disk.img -A1:set:{0,1,2,3,48}
$ sfdisk --dump disk.img
label: gpt
label-id: 7484F730-3429-47BF-8A72-3A7AE1F2D86C
device: disk.img
unit: sectors
first-lba: 34
last-lba: 262110
sector-size: 512

disk.img1 : start=        2048, size=      131072, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=404694AC-247D-43B3-9907-A468E5C038A3, name="root", attrs="RequiredPartition NoBlockIOProtocol LegacyBIOSBootable GUID:48"

$ sfdisk --part-attrs disk.img 1 0
unsupported GPT attribute bit '0'
sfdisk: disk.img: partition 1: failed to set partition attributes

While the --dump output prefixes the GUID specific bits with "GUID:",
that is not necessary for setting them, which is consistent with the
man-page.

Signed-off-by: Eric Chanudet <echanude@redhat.com>
2023-05-25 14:57:28 +02:00
Eric Chanudet
9a42ce04ac tools/osbuild-mpp: mpp-define-image sfdisk attrs
Add the translation logic to handle the attrs field of sfdisk as
supported by org.osbuild.sfdisk and documented in its schema. With the
schema taking an int array, some translation is required to populate the
sfdisk command appropriately.

Amend the example schema to reflect the change.

Signed-off-by: Eric Chanudet <echanude@redhat.com>
2023-05-25 14:57:28 +02:00
schutzbot
a7b3ef3936 Post release version bump
[skip ci]
2023-05-24 08:13:14 +00:00
Thomas Lavocat
8669d0ad4c ci/parallelization: manifest tests run in parallel
To avoid hitting the 4h timeout.
2023-05-23 11:52:11 +02:00
SchutzBot
61f329a08c schutzfile: update manifest-db ref 2023-05-20 2023-05-23 11:52:11 +02:00
Simon de Vlieger
a348fe2d49 stages/isolinux: default list
Otherwise when `opts` (which isn't `required`) is left out we fail the
stage.
2023-05-23 10:13:15 +02:00
Michael Ho
621fa47563 runners: add fedora-38 specific logic
This fixes an issue where Fedora-38 hosts can not build CentOS-Stream-9
images due to an incompatible gpg key with the new default settings for
rpm.

On Fedora-38, rpm has changed to use a new backend for key verification
and by default does not support SHA1 anymore, although the support for
SHA1 can be re-enabled via a config file. The (current) CentOS-Stream-9
keys however still require SHA1 support in order to be importable. So
they are now unusable on Fedora-38 unless SHA1 support is re-enabled.

In OSBuild, the initial chroot does not contain the config files and so
SHA1 support is disabled when rpmkeys from the host is called. It does
not matter if the crypto-policies on the host machine is configured with
the exception to support SHA1 because the chroot filters that out. This
means it may not be possible to assemble CentOS-Stream-9 based images
without disabling the key check.

This patch adds an explicit conditional case for Fedora-38 to inject the
needed configuration file into /etc/crypto-policies/back-ends to enable
SHA1 support for rpm by default. It does this by copying the default
policies from /usr/share/crypto-policies. The result is OSBuild behaving
similar to the previous behaviour seen on Fedora-37 and earlier.
2023-05-16 13:19:44 +02:00
Alexander Larsson
3343696a7b org.osbuild.mkfs.ext4: Add verity option to
This allows enabling the ext4 "verity" feature (which is currently
default to off). This will be needed in the automotive work we're
doing.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2023-05-16 00:03:16 +02:00
schutzbot
4add41d50f Post release version bump
[skip ci]
2023-05-10 08:13:14 +00:00
Sanne Raymaekers
1fbd9d975f stages/org.osbuild.ovf: support older python3 versions
`str.removesuffix` was introduced in python3.9, yet el8 uses python3.6
by default.
2023-05-09 23:54:01 +02:00
Thomas Lavocat
dfcd847c8e osbuild/loop: fix typo 2023-05-05 15:42:47 +02:00
Thomas Lavocat
da11ef4eb0 loop: use LOOP_CONFIGURE instead of LOOP_SET_FD
LOOP_CONFIGURE allows to atomically configure the decive when opening
it. This avoid the possibility of a race condition where between set_fd
and set_status some operations are already accepted by the loopback
device. See https://lwn.net/Articles/820408/

This feature was included in the linux kernel 5.8 however it is safe to
not include any kind of fallback to the previous method as @obudai
points out that:

LOOP_CONFIGURE was backported into RHEL 8 kernel in RHEL 8.4 as a part
of https://bugzilla.redhat.com/show_bug.cgi?id=1881760 (block layer:
update to upstream v5.8).

Since RHEL 8.4 is currently the oldest supported release that we support
running osbuild on, it might be just fine implementing this without the
fallback.

From a centos stream 8 container:
kernel-4.18.0-448.el8.x86_64
- loop: Fix missing discard support when using LOOP_CONFIGURE (Ming Lei) [1997338]
- [block] loop: Set correct device size when using LOOP_CONFIGURE (Ming Lei) [1881760]
- [block] loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE (Ming Lei) [1881760]
- [block] loop: Add LOOP_CONFIGURE ioctl (Ming Lei) [1881760]
2023-05-05 15:42:47 +02:00
Alexander Todorov
04eab998b7 Start building osbuild on RHEL 8.9 and 9.3 nightly 2023-05-04 13:34:35 +03:00
Gianluca Zuccarelli
586d6bbe43 stages/yum.repo: add sslverify field
Add `sslverify` field to the yum.repo stage.
2023-05-03 20:53:52 +02:00