Commit graph

36 commits

Author SHA1 Message Date
Tomas Hozza
6edf4aad49 osbuild2: add prefix parameter to the fix-bls stage
The `fix-bls` stage supports a `prefix` argument, which was not
supported in composer. Specifying this argument is necessary in case the
`/boot` mountpoint is on a separate partition.

Add the `prefix` argument to the `fix-bls` stage. Amend unit tests.

The RHEL-8.5 and RHEL-9.0 `aarch64` `ec2` and `ami` images use partitioning
with `/boot` on a separate partition. Due to this, the pipeline must specify
a non-default prefix to the `fix-bls` stage.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-08-13 08:24:37 +02:00
Tomas Hozza
7ac1d68fb6 rhel85/90: allow specifying the boot partition for the grub2 stage
Specifying the boot partition filesystem UUID in grub2 stage is required
in case the `/boot` mountpoint is on a separate partition. This is the
case of RHEL-8.5 and RHEL-9.0 `ami` and `ec2` images.

Extend `disk.PartitionTable` with a new `BootPartition` method, which
returns a pointer to partition with FS mountpoint `/boot` if there is
such partition, or `nil` otherwise.

Extend the RHEL-8.5 and RHEL-9.0 code creating options structure for
grub2 osbuild stage to include the boot partition in case it has been
provided.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-08-13 08:24:37 +02:00
Achilleas Koutsou
fe19d5a1d4 distro/rhel85: prepend kernel cmdline stage
For s390x, prepend a kernel cmdline stage to the start of the OS
pipeline. This is a noop for other architectures for now.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-08-06 07:30:05 +02:00
Achilleas Koutsou
844f77f7ca distro/rhel85: add zipl.inst stage for s390x
Installs the zipl bootloader on the disk image.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-08-06 07:30:05 +02:00
Achilleas Koutsou
22faa79880 distro/rhel85: bootloaderInstStage() function
Returns a single stage that installs the bootloader.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-08-06 07:30:05 +02:00
Achilleas Koutsou
67ae1acafd distro/rhel85: bootloaderConfigStage() function
Returns a single stage that configures the bootloader, either GRUB or
ZIPL based on architecture.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-08-06 07:30:05 +02:00
Achilleas Koutsou
1ab3223ef5 distro/rhel85: kernel version string util func
Utility function for finding the kernel package and returning it's
version string. Useful for configuring bootloaders.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-08-06 07:30:05 +02:00
Tomas Hozza
c97420e879 rhel85: add definitions of RHEL ec2 and ec2-ha images
Add new image type definitions `ec2` and `ec2-ha` representing the
official RHEL ec2 image types.

Add a `xzArchivePipeline()`, which returns a pipeline producing a XZ
archive from a file produced by a different pipeline.

Add rpmrepo snapshots for `rhui` and `ha` repositories used to generate
image test cases. `rhui` is used by the `ec2` image and it is available
on x86_64 and aarch64 architectures. `ha` is used by the `ec2-ha` image
and it is available only for x86_64.

The new image type definitions are currently not used by any
API test case.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-08-02 19:05:09 +02:00
Tomas Hozza
49ed70a565 rhel85: introduce BootType and use it for arch and image definitions
Previously, the support of UEFI has been captured only on the level or
architecture definition as a binary boolean value. In reality some of
the architectures are able to support legacy, UEFI or hybrid boot.

Introduce a new BootType value, defined on the architecture level, which
can be set to one of the three boot types mentioned above. The value set
on the architecture level can be overridden on the image type level in
the image type definition.

Add two unexported helper methods to the `imageType`, specifically
`getBootType()` which returns the boot type that  should be used for the
image type and architecture combination. The values set explicitly in
the image type or architecture definition should not be used directly.
Second added method is `supportsUEFI()`, which returns boolean value
representing the fact if the image type supports UEFI boot.

Split and define the boot package sets separately for the legacy and
UEFI boot. The `PackageSets()` method of the imageType structure is
modified to take the boot type into consideration and append appropriate
package sets to the "os" package set.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-08-02 19:05:09 +02:00
Tomas Hozza
02ff0fc606 rhel85: redefine the ami image based on RHEL ec2 images
Redefine the `ami` image type in RHEL-8.5 to be based on RHEL
ec2 images. The pipeline has different default settings, therefore the
common "os" pipeline is not used. The RHEL ec2 images have a different
default size than the original `ami` image definition. The RHEL ec2
images use a different default partitioning scheme. Their configuration
is slightly different for each architecture and the x86_64 version
of the image does not support UEFI.

Update rpmrepo snapshots used to generate RHEL-8.5 x86_64 and aarch64
image test cases.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-08-02 19:05:09 +02:00
Achilleas Koutsou
51cb4ae043 distro/rhel85: move selinux stage to last
In the main OS pipeline created by osPipeline(), there is often a set of
stages that are added after the common ones. The SELinux stage must
always be last in the pipeline, so it is added externally by the calling
function.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-07-29 16:45:20 +02:00
Achilleas Koutsou
daae2bbfca distro/rhel85: set build root for main os pipeline
OS image tree was being built on the host instead.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-07-29 16:45:20 +02:00
Achilleas Koutsou
9bb2ae09bd distro/rhel85: fix pkg set for grub2 stage
The package set is needed by the GRUB 2 stage options function to find
the Kernel package in order to add the saved entry option. The Kernel
package is defined in the blueprints package set, not the OS package
set.

Signed-off-by: Achilleas Koutsou <achilleas@koutsou.net>
2021-07-27 16:53:24 +01:00
Achilleas Koutsou
6313532c90 distro/rhel85: add blueprint pkgs to ostree pipeline
Blueprint packages are now defined and passed into Manifest()
separately. The main osPipelines() already has an argument for
explicitly passing the blueprint packages. Added the same for the ostree
pipelines.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
4048383e07 distro/rhel85: package set key consts in pipelines
Use the package set key constants defined in distro in the pipeline
definitions as well.
2021-07-24 15:54:00 +02:00
Ondřej Budai
985dbcfeec distro/rhel85: handle subscriptions only once in the pipeline
Previously, the first boot stage was added twice if the subscription
customization was enabled. This doesn't work because the first boot stage
cannot be specified twice in one pipeline. Also, it didn't make much sense
because it just duplicated the effort so I just removed one of the two stages.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
cba720e63f rhel85: depsolve blueprint packages separately
To avoid packages specified in a blueprint from conflicting with exclude
lists, we depsolve blueprint packages separately and pass them into the
Manifest generator under the new "blueprint" package set key.

This approach has the added benefit that dependencies of packages
specified in the blueprint are not subject to exclusion in addition to
the explicitly named packages.

The OS pipeline which installs the packages for the base system merges
the two package sets before running the RPM stage. The signature of the
function is changed to explicitly require blueprint packages be
specified (though `nil` or empty slice is valid).

The kernel selection test is adapted to merge the package sets before
counting kernel package.

Adaptation of changes in
https://github.com/osbuild/osbuild-composer/pull/1349
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
b8d34d7679 distro/rhel85: introduce the ami image type
This is a copy of the ami image type from RHEL 8.4.
Small modifications are necessary.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
1f005a55b9 distro/rhel85: don't always install bootloader
Don't install bootloader unless `platform` (imageType.arch.legacy) is
defined.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
78920efc36 distro/rhel85: partition table fixes
- Automatically find /boot partition (fallback to root)
- Partition sizes need a bit of a shrink
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
876a67ccb0 distro/rhel85: introduce the openstack image type 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
ceba83dcca distro/rhel85: introduce the vmdk image type 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
1ed9008785 distro/rhel85: introduce the vhd image type 2021-07-24 15:54:00 +02:00
Achilleas Koutsou
dec74dba32 distro/rhel85: add image and qcow pipelines
Live image pipeline: Creates the live image in a file through a loopback
device.

Stages:
- truncate: create the file to hold the image
- sfdisk: partition the device
- mkfs.fat, mkfs.xfs: create the filesystems
- copy: copy the tree from the previous pipeline (the OS pipeline) into
  the directories where the partitions are mounted
- grub2.inst: install the bootloader

QEMU pipeline: Convert the live image from the previous pipeline to a
qcow2 image.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
4cf26bb628 distro/rhel85: split coreStages() implementation
coreStages() was meant to produce the stages that are common between all
image types. Since there are too many exceptions and differences between
traditional and edge image types, keep the two pipelines separately
instead.

Moved SELinux stages to the end of each pipeline.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
39371b01ba distro/rhel85: document selinuxStageOptions arg
Renamed the argument to have clearer (and correct) meaning and added a
function docstring to describe the purpose.

The argument is set to 'true' in the build pipeline.
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
bf61ca422f distro/rhel85: introduce the qcow2 image type
- distro definition
- qcow2 package set
- pipeline generation function (unfinished)
2021-07-24 15:54:00 +02:00
Achilleas Koutsou
38f5b23e87 rhel85: tar image type
Traditional tar image type.
Pipelines generation function for tar image type uses the same pipelines
and stages as the tar installer, but exports the OS image directly.
2021-07-01 12:48:32 +02:00
Achilleas Koutsou
ec381fefb9 rhel85: generalise and simplify tar stage creation 2021-07-01 12:48:32 +02:00
Achilleas Koutsou
7e1ab365c8 rhel85: change kickstart file location
Global const for defining kickstart path for all installer types.
Kernel options added to point to path.

Kickstart file renamed to osbuild.ks for all types and placed in the
bootiso root.

Fixes #1363
2021-07-01 12:48:32 +02:00
Achilleas Koutsou
32c69b3cf9 rhel85: add subscription stage to core pipeline 2021-07-01 12:48:32 +02:00
Achilleas Koutsou
242f6d3c44 rhel85: tar installer main pipeline
Define a core set of packages and stages shared by images.
2021-07-01 12:48:32 +02:00
Achilleas Koutsou
19d15af788 rhel85: new image type tar-installer 2021-07-01 12:48:32 +02:00
Achilleas Koutsou
139c8eb3c4 Revert "rhel85: nolint package for unused private functions"
Pipeline generation functions are now used by the new image definitions.

This reverts commit cca084d5ce.
2021-06-29 17:26:43 +01:00
Achilleas Koutsou
cca084d5ce rhel85: nolint package for unused private functions
Package contains unexported helper functions for future implementations
of pipelines.
2021-05-11 12:10:09 +02:00
Achilleas Koutsou
9412477b3f rhel85: split distro into multiple files
Split pipelines, inputs, and options into separate files for easier
navigation.
2021-05-11 12:10:09 +02:00