Commit graph

67 commits

Author SHA1 Message Date
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
94d8fb1ff7 test/data: add RHEL 7 manifests
Add RHEL 7.9 example manifests. Add them to a `rhel` sub-directory in
the test/data/manifests directory since we cannot re-generate them
in the normal github actions, because they require access to RHEL
content.
2021-10-30 00:54:09 +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
dbfc04cbb0 test/data: use generic build for fedora-boot
Instead of using the version specific, pre-depsolved f34 build manifest,
use the new version agnostic build manifest (fedora-build.mpp). NB: this
is included directly as mpp so that its variables get defined by the
including manifest. This should make it even easier to update manifests
to new fedora releases.
2021-08-17 10:42:03 +02:00
Christian Kellner
bab3639731 test/data: add version agnostic build manifest
Include a build manifest that is itself not have tied to a specified
version and thus is meant to be included with the following vars
pre-defined as .mpp file:
  - arch          architecture (x86_64)
  - releasever    release version (f34)
  - snapshot      rpmrepo snapshot (20210326)
2021-08-17 10:42:03 +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
2789080d79 test/data: label build root for f34-build-v2
Properly label the build root for the f34 build root manifest v2.
Also label the cp and tar binaries with `install_exec_t` so they
can read and copy labels unknown to the host.
2021-08-13 12:20:54 +02:00
Christian Kellner
363fb88518 device: add org.osbuild.lvm2.lv 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
Christian Kellner
bd8cd7443a test/data: split up the bootiso stage
Use the new `squashfs`, `grub2.iso` and `isolinux` stage to re-
plicate what the `bootiso.mono` stage was doing, which is now
considered deprecated.
2021-07-16 15:19:58 +01:00
Christian Kellner
e8bf211e0c test/data: move ostree repo to the iso root
Instead of having the OSTree repo in the anaconda root squashfs,
put the it to the root of the iso. This has several advantages:
first and foremost, we don't have to make a huge squahfs file-
system. We don't have to compress the repo. Additionally, the
repo is now easily accessible by mounting the iso.
2021-07-15 23:08:51 +01:00
Christian Kellner
a19e261dbe test/data: move kickstart to the iso root
Intead of overwriting the standard ananconda kickstart file, we
move it to the root of the iso. To have anaconda pick it up an
additional kernel command line parameter is required.
2021-07-15 23:08:51 +01:00
Christian Kellner
c77170a924 test/data: create core user via kickstart
Create the users via the new users support that was added to the
kickstart stage, instead of having them in the OSTree commit.
2021-07-15 23:08:51 +01:00
Christian Kellner
9d3c420a38 test/data: update x11 pkgs for ostree-bootiso
F34+ has the xorg-x11-server-utils package split up. Install the
individual new packages we need for anaconda.

See Anaconda commit 55371c996861a47da9504b31118858dd3257a8b0
2021-07-15 23:08:51 +01:00
Christian Kellner
cc39d5a8b4 test/data: use more variables in ostree-bootiso
Use variables for various often occuring contants, like the
release, ref and isolabel. Additionally, use variables for
the snapshot so it can be changed easily.
2021-07-14 23:51:34 +02:00
Christian Kellner
a9b3fbd92b test/data: auto-format ostree-bootiso
Re-indent and format the bootiso mpp. No actual content changes.
2021-07-14 23:51:34 +02:00
Christian Kellner
c4db24c481 tools/mpp: substitute vars in mpp blocks
Allow the manifest variables, defined via mpp-vars, to be used from
within the mpp blocks. For this template strings are used, where
variables are marked via `$`. We cannot use the `mpp-format` logic
easily there, since that is processed after other mpp directives
have been processed.
As a result remove the built-in substitution from support from dnf
dep-solving, since we had to post-process the resulting urls with
variable substitution afterwards. Now that is covered with this
more generic mechanism.
2021-07-14 23:51:34 +02:00
Christian Kellner
c774e76079 test/data: remove duplicated baseurl entries
We don't need to define them twice, remove them everwhere where
that was the case.
2021-07-14 23:51:34 +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
368d0a5c18 tools/mpp: support multiple image definitions
Support more than one image definition by introducing a `id` attribute
which can be used to specify how the variable for the definition is
called.
2021-07-09 19:50:38 +01:00
Christian Kellner
d2c4888843 test/data: use mpp-define-image in ostree-image
Use the new partiton layout support in MPP. NB: start data as
well as the size of the last partition have been omitted now,
since `sfdisk` will figure those out for us.
2021-07-08 22:47:45 +02:00
Christian Kellner
1dc845f331 tools/mpp: properly support substitutions
Previous versions of mpp would already set the arch and basearch
substitution, which would work for dep-solving itself, but not
properly re-write the resulting URLs which means that the manifest
was broken. Fix this by properly replacing the substitutions in
the URL. Also support official 'releasever' substitution.
2021-07-07 15:10:00 +02:00
Christian Kellner
d47f735112 tools/mpp: create PkgInfo class for package info
Instead of passing dictionaries around that are inconvenient to
use in code and even more in the `mpp-format-*` directives, use
a simple class to represent package information. Use that in
the `pkginfo` dict that can be accessed via `mpp-format-*`. Use
the `evra` property instead of string manipulation in the
`fedora-boot.mpp.json` and `-ostree-bootiso.mpp.json` manifest.
2021-07-02 11:28:43 +02:00
Christian Kellner
d5c5947271 test/data: generate the fff... uuid
Instead of writing 32 `f` chars, we can now generate it. The
future is here.
2021-07-02 11:28:43 +02:00
Christian Kellner
8a27de0d10 tools/osbuild-mpp: include nevra in package list
Include the nevra in the list of dep-solved packages. Use that for the
package info. Adapt the boot manifest accordingly.
2021-07-02 11:28:43 +02:00
Alexander Larsson
e4eb3e0fd0 Use the new formating features to simplify the test manifests
This uses size computations to simplify the partition size/offsets
and the depsolv results to get the kernel version.

This makes no changes to the resulting json files.
2021-07-01 15:06:57 +02:00
Tomas Hozza
e96366fb10 stages/cloud-init: add new stage for configuring cloud-init
Add new `org.osbuild.cloud-init` stage, which currently allows to create
configuration files for cloud-init under `/etc/cloud/cloud.cfg.d`. The
stage supports only a very limited subset of cloud-init configuration
options, which is covering needs of RHEL AMI images.

The schema mandates that if the 'configuration_files' option is
specified, then at least one configuration file must be defined. In
addition each section of the configuration must contain at least one
property (section or configuration option).

Add `python3-pyyaml` package to the `F34-build` testing manifest,
because it is required for running and testing the new stage.
Regenerate all affected manifests.

Add test for the new stage.

Update the `osbuild-ci` container image used for testing to a new tag,
which includes python3-pyyaml, the dependency of the new stage.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-24 16:55:18 +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
29146e0a01 test/data: label the build root in f34-build
For `setfiles` in the `org.osbuild.selinux` to work properly it
needs itself have the correct labels. This is true for setfiles
on the host, but also needs to be true for the `setfiles` that
is located in the build root. Therefore we need to label the
build root via `org.osbuild.selinux`. Additionally re-label
the `cp` and `tar` binary to have the `install_exec_t` which is
needed to read and write unknown labels (to the host). Since
`cp` and `tar` are used to read (and write) files inside stages
and assemblers they need to have the special label.
2021-06-22 15:27:49 +02:00
Christian Kellner
61b3eb7e6a test/data: fix url sorting for ostree tarball
The commit that added the ostree tarball to manifest version 2
went in after the PR to sort the urls and thus the source urls
for that manifest were not sorted. This of course no breaks ci
which makes sure that the test data up to date. I blame the
ci model used by github but I am also sorry.
2021-06-22 15:27:49 +02:00
Christian Kellner
5614520fcb test/data: add version 2 ostree commit tarball
Port the "fedora-ostree-commit.mpp.json" manifest, which builds an
ostree commit and tars that up, to the new osbuild format version.
2021-06-21 18:56:38 +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
Tomas Hozza
8d43a78918 test: update test manifests to use Fedora 34
Move from using 'zram' to 'zram-generator-defaults' in the ostree bootiso
testing manifest. More information is available in Fedora 33 Change
document [1].

Add org.osbuild.kernel-cmdline stage to fedora-boot.json manifest
because of change in how grub handles the kernel command line arguments
[2].

GRUB2 Stage 2 checksums in assemblers test are updated. The change have
been verified by building the fedora-boot.json manifest with each checked
filesystem and booting the image in QEMU with legacy mode.

[1] https://fedoraproject.org/wiki/Changes/SwapOnZRAM
[2] https://github.com/osbuild/osbuild-composer/pull/982#issuecomment-697356929

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-06-07 12:15:26 +02:00
Christian Kellner
ec4d7c0c1c test/manifests: annotations for ostree container
Include the new OSTree specific annotations in the ostree container
manifest.
2021-05-26 13:17:01 +02:00
Christian Kellner
283f8d0de8 test/data: add ostree based boot iso manifest
This new manifests creates an boot iso which contains an ostree
commit that is build in the same manifest. The boot iso can then
be installed via the ISO.
2021-02-19 14:42:32 +00:00
Christian Kellner
e1f1f64cf1 test/data: add iso tools to v2 build root
Add the necessary tools to build boot isos to the build root.
Most notably the lorax templates, bootloader as well as iso
creation tools.
2021-02-19 14:42:32 +00:00
Christian Kellner
7a503100c8 test/data: set saved_entry in boot manifest
This is to test the functionality of the new `saved_entry` grub2
config file. Ideally an integration test would install a new non-
default kernel and check that it does not get selected. Something
for the future.
2021-02-19 14:41:26 +00:00
Christian Kellner
d4ebbb821a stages/oci-archive: support additional layers
In addition to the required base layer, provided via the the input
of the same name, the oci-archive stage now accepts up to nine
additional layers that get added on top of each other, sorted in
ascending order, i.e. `layer.1` to `layer.9`.

Adapt the `fedora-ostree-container` example manifest so that the
ostree commit is now in a separate layer, which makes it possible
to share the base layer between different commits container.
2021-02-16 22:58:15 +00:00
Christian Kellner
965b4e94ee test/data: don't install docs in containers
Change the test manifests that use containers to not include
docs when installing. Also don't install docs in the build root
for those manifests. Since the fedora-ostree-container.mpp is
being built in CI, this also tests that the new option.
2021-02-12 19:27:25 +01:00