Commit graph

30 commits

Author SHA1 Message Date
Tomáš Hozza
8c54226793 Test manifests: update RH release key and regenerate manifests
Regenerate all manifests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2024-06-12 11:29:56 +02:00
Jakub Rusz
d68abf3bb5 Generate RHEL-94 and RHEL-810 manifests + update 2023-11-06 13:39:01 +04:00
Gianluca Zuccarelli
376199467c internal/distro: rhel9 repo customizations
Wire up the repository customizations for
rhel9 images.
2023-04-21 17:40:00 +02:00
Ondřej Budai
d8342862d5 customizations: create all groups unconditionally
We had this weird condition in code that prevented composer to create groups
with the same name as a user has. This unfortunately means that you are not
able to create a user with a primary group with a certain GID that has the
same name as the user. There's the gid field in the user customization,
but it requires that the group already exists.

In order to allow that, we need to remove the condition. From now on, it's
possible to create groups with the same name as a user has, which can be used
to create primary groups with a custom gid.

Note that the lorax compatibility behaviour was actually wrong. When lorax was
given a custom gid for a user, it didn't require the gid to exist. When it
didn't, the group was just created. Thus, we still don't have full backward
compatibility, but at least we now have support for this.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-04-19 11:50:49 +02:00
Tomáš Hozza
dc637d9a57 Manifest: always set kernel options in grub2 stage
It turned out that when we stopped setting the kernel options in grubenv
file, we also stopped setting them in /etc/default/grub under
`GRUB_CMDLINE_LINUX`. This file is used by grub2-mkconfig when
generating grub configuration.

10_linux script executed by grub2-mkconfig recently started to overwrite
the /etc/kernel/cmdline, if its timestamp is older than the timestamp of
/etc/default/grub [1]. As a result, all kernel options were wiped out from
/etc/kernel/cmdline.

Make sure that we always set the `KernelOptions` in the grub2 stage
options, even if the `WriteCmdLine` is set to `false`.

In addition, unify the way we concatenate kernel options set in the
grub2 stage options. Some pipeline implementations were previously using
space, other were using comma. Space is now used everywhere.

Regenerate all affected image manifests.

[1] https://src.fedoraproject.org/rpms/grub2/c/fc76aed5333f56dd05400521a35b944a5df52ebc

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-03-23 16:32:34 +01:00
Tomáš Hozza
f5580b1f3e Test: regenerate image manifest that use files customization
Regenerate image manifests which use the files customization and are
affected by the recent change to `osbuild/fsnode.go`, specifically to
always setting the `RemoveDestination` to `true`.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-02-22 12:17:36 +01:00
Tomáš Hozza
aa9373cb18 Test: use dir and file customizations in qcow2 image manifests
Add the new directories and files customization to the customized qcow2
image manifests used for testing.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-02-22 12:17:36 +01:00
Tomáš Hozza
b36c03f20c manifest/os: move the systemd services stage more to the end
Move the handling of the list of enabled and disabled systemd services
more to the end of the `os` pipeline, just before the SELinux stage.
This has no functional effect on produced images, but it will make it
nicer once the handling of the custom files and directories will be
added to the pipeline. Specifically it should be added right before the
services stage to allow enabling custom service files, but after all
other configurations that are applied to the image.

Regenerate all manifests.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-02-22 12:17:36 +01:00
Achilleas Koutsou
73882b7289 test: update customized test manifests to include bluez
Our 'customize' test manifests include an option to disable the
bluetooth.service.  Originally this option was added for image types
that included bluez in their default package set (Fedora IoT commit) but
it was later copied to the qcow2 image type as a way of testing
customizations.

Until recently, building these caused no issues.  On distros with more
recent versions of systemd, disabling a non-existent service causes an
error and these manifests fail to build.

Added the 'bluez' package to all manifests that include the 'disable
bluetooth.service' customization and updated the manifests.  These
should all be buildable now.
2023-01-23 19:54:39 +01:00
Achilleas Koutsou
7811505f3d test: regenerate manifests
Regenerate manifests for changes from recent repository snapshot update.
Not all were generated after the most recent change.
2023-01-18 11:50:35 +01:00
Achilleas Koutsou
fa1bc48840 test: update manifests
CS9 manifests updated with new package versions.
RHEL 7 repo change in package-sets array: was missed in the last
regeneration.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
a2a3ac8ffe test: regenerate manifests with chrony stages
Regenerate all manifests that used the old chrony stage options with the
'timeservers' field.  This is now replaced by the 'servers' field, which
is a slice of objects with a 'hostname' field instead of a slice of
strings.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
9d34362bbf test: update RHEL 9.x and CS9 qcow2, oci, and openstack manifests
Regenerated manifests for the QCOW2, OCI, and openstack image types with
the rewritten definitions.

The skopeo stage is not yet added by the live image pipeline.

The following changes in the manifests should affect the final image:
- Removed RPMs in the build root: packages are added to the build-root
  on-demand by the payload pipelines.  All removed packages were
  unnecessary for building the image.
- /usr/bin/tar removed form selinux stage: tar should be added on-demand
  if it's needed by any of the payload pipelines.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
93592dabc1 test: regenerate manifests 2022-07-27 18:29:59 +02:00
Achilleas Koutsou
2b6faea320 Remove image info from all test manifests
We never generated it for the newest distro versions and we don't test
it on any of the old ones.

It's better this way.
2022-07-27 10:01:16 +02:00
Juan Abia
99649ee142 generate-all-test-cases: generate all manifests
regenerate all manifests without image-info and add new ones
2022-05-13 21:01:37 +03:00
Achilleas Koutsou
d357f92f91 test: add fs customization to qcow2 test case
Added a filesystem customization to the qcow2 test case to test that the
filesystem is converted to an LVM layout.
Set overrides for distros that don't support fs customizations.
2022-04-29 08:55:36 +02:00
Tomas Hozza
81fc032a45 RHEL-90: don't pass blueprint package set separately to pipelines
Blueprint package set is now depsolved together with the OS package set
in a chain. The result is stored in the package specs sets under the OS
package set name.

In reality, the code was able to handle a `nil` package specs to be
passed to pipelines, however some parts were looking for the kernel
version in the blueprint package specs, which would be a bug.

Regenerated affected image test cases.
2022-04-28 14:42:49 +02:00
Achilleas Koutsou
2b2181867f osbuild2: use source-array-ref for rpm stage inputs
The (new) source-array-ref object is an array of objects, which allows
for input references to have options (metadata) but still maintain their
order when (de)serialised.

Fixes https://github.com/osbuild/osbuild-composer/issues/2577
Related to https://github.com/osbuild/osbuild/pull/1003
2022-04-27 11:51:25 +02:00
Tomas Hozza
bd81506831 image-info: read the firewall default zone
Modify affected image manifests.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-04-14 19:07:31 +01:00
Christian Kellner
45b1fc3cd1 osbuild2: honor GPG key setting for rpm inputs
We should honour `pkg.CheckGPG` when creating the file inputs for the
rpm stage. This was lost in the transition from v1 to v2 manifests.

Regenerate image test manifests.

Co-authored-by: Tomas Hozza <thozza@redhat.com>
Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-03-30 14:32:28 +02:00
Tomas Hozza
947acf74ab Regenerate affected image test cases 2022-03-29 11:43:54 +02:00
Achilleas Koutsou
2eef6e6e2d osbuild2: deduplicate groupStageOptions()
Use single NewGroupsStageOptions() from osbuild2 instead of implementing
in each distro.

The new function does not set the Group.Name field anymore.  The field
does not exist in the osbuild schema and was silently ignored.
The field in the stage has been marked 'omitempty' and the relevant
manifests have been updated.
2022-03-28 14:08:57 +02:00
Tomas Hozza
2ec55b4c53 RHEL-90: use XBOOTLDR partition GUID for /boot
Use the Extended Bootloader Partition GUID for `/boot`, instead of the
Linux filesystem data GUID. This is useful for autodetection of a
partition purpose based on its GUID without reading the `/etc/fstab`
first.

Ensure that when creating mountpoints, e.g. when converting the
partitions layout to LVM, the `/boot` partition get the proper GUID
assigned.

Regenerate RHEL-90 and centos-9 image test cases.

Related to https://bugzilla.redhat.com/show_bug.cgi?id=2057231
2022-03-24 15:40:10 +01:00
Christian Kellner
9e5b265a58 osbuild2: lock loopback devices during sfdisk, mkfs
Since udev will probe block devices it is advisable to hold a lock
on the device when modifying its partition table or the superblock
of the filesystem (see [1]). osbuild loopback devices do support
this via the `lock` option. Set this option for all operation that
involve changing block device "metadata" that could potentionally
race with udev, such as sfdisk, mkfs, creating a luks2 container
and creating LVM2 volume groups and logical volumes.
NB: osbuild also has its own device inhibition logic to prevent
udev/lvm2 from auto activating devices and in general to limit the
interaction between the host and devices used by osbuild. See [2]
for more information.
NB: this also locks the loopback device in situation where we the
it is strickly not the right thing to do, e.g. when creating a fs
on a logical voume that is located on a loopback device, since in
this case the device we would need to lock is the logical volume.
Sadly, LVM/DM devices are exempt from block device locking. But,
due to a bug in osbuild < 50, the udev inhibitor does *not* work
for loopback devices and therefore we have to use the actual lock
to preven LVM device auto-activation via `69-dm-lvm-metad.rules`.
The change was implemented by adding a new boolean to `getDevices`
indicating if the loopback device should be locked or not. Once
we depend on osbuild 50 we can change the logic in `getDevices`
to only lock the loopback device if the number of devices is one,
i.e. we are working directly on the loopback device.

[1] https://systemd.io/BLOCK_DEVICE_LOCKING/
[2] /usr/lib/udev/rules.d/10-osbuild-inhibitor.rules
2022-02-28 17:09:30 +01:00
Christian Kellner
19e7890f63 rhel90: automatically convert to LVM on fs customizations
Whenever we create a new mountpoint due to a user customization,
ensure the layout uses LVM, i.e. convert plain layouts to it, if
needed. This does not apply to rpm-ostree based systems, e.g. the
simplified installer since they will be using LUKS in 9.0.
Add "lvm2" to the build pipeline and thus generate new manifests
and image infos.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2022-02-28 17:09:30 +01:00
Achilleas Koutsou
91d9417f5a distro/rhel90: use new unified grub2 stage options
With the new grub2 stage options we have the following changes to the
grub2 stage:
- Set the WriteCmdLine flag to false to not write kernel command line
  options to grubenv.
- Don't set the kernel command line options in the stage options.

The kernel command line options are now only specified in the Kernel
command line stage (org.osbuild.kernel-cmdline) so we add all options
there:
- Image type options
- Blueprint options
- Partition-table-specific options

Updated manifests and image info.

Co-Authored-By: Christian Kellner <christian@kellner.me>
2022-02-23 22:42:59 +01:00
Achilleas Koutsou
602111dedd osbuild2: generalise copy stage option generation
Use entity based method `ForEachMountable` and `getDevices` to generate
all mounts and devices in a generic way, which then allows for mounts on
arbitrarily nested devices.

Update manifests and image info:
- New device names generated by `pathdot()` to avoid basename
  collisions.
- Some partitions are generated in a different order now which changes
  the order they appear in the manifest and their UUIDs.

Co-Authored-By: Christian Kellner <christian@kellner.me>
2022-02-22 19:23:41 +00:00
Christian Kellner
b7abef54e8 disk: calculate padding for secondary GPT header
Instead of hard coding a padding of 100 sectors for all layouts, i.e.
MBR and GTP, adjust the needed space depending on the layout: for MBR 
we don't need to reserve any space at all since it does not have a 
secondary header. For GTP we reserve 33 sectors, as indicated in the
UEFI specific, which allows for the header itself and up to 128 entries.
To not modify the layout of already released distributions, like RHEL
8.4 and 8.5, a new member called `ExtraPadding` is added to `Partition
Table` and then used in the corresponding layouts to preserve the
existing padding of 100.
2022-02-22 19:23:41 +00:00
Achilleas Koutsou
22f23ec38e test: update manifests and image info 2022-02-18 10:39:08 +00:00