Commit graph

48 commits

Author SHA1 Message Date
Ondřej Budai
83746c5f13 osbuild/rpm: add sigpgp and siggpg keys to the metadata
This was introduced in osbuild 23, so we also need to bump the dependency
in the spec file and also the submodule.

The test is also modified and a typo in its name is fixed.
2020-10-27 19:01:30 +00:00
Tom Gundersen
25abccf66d tree-wide: drop f31 support
We no longer release into F31, and the right specfile was anyway not
being tested.

This allows us to remove a workaround that updates the VMs during
deploy, and other fedora-31 specific hacks.
2020-10-21 09:04:13 +02:00
sanne raymaekers
96c1de9f98 osbuild: add support for the first-boot stage 2020-09-22 11:38:28 +02:00
Tom Gundersen
5803abfeee osbuild/result: parse the metadata from the rpm stage
osbuild support returning metadata about each of the stages/assembler
runs. Parse the results from the rpm stage, which contains the header
fields from the installed RPMs, in particular the MD5 sum of the RPMs in
question. This information is needed to be passed as metadata to koji
when uploading images.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-26 12:12:37 +02:00
Tom Gundersen
ac5f69e757 osbuild: move result serialization from common
In the same way `osbuild.Manifest` is the input to the osbuild API,
`osbuild.Result` is the output. Move it to the `osbuild` package where
it belongs.

This is not a functional change.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-08-26 12:12:37 +02:00
Martin Sehnoutka
f8f35016d6 osbuild: Add "labels" field into the SELinux stage
The SELinux stage supports labeling specific files with specific labels
like this:
7b0db90c76/stages/org.osbuild.selinux (L37)

This can be useful for preventing some SELinux issues during the image
build. You can find example usage here:
7b0db90c76/test/data/stages/selinux/test_basic.json (L5)

And more reasoning here:
e80130a830
2020-07-22 10:47:46 +01:00
Tom Gundersen
8c7d8a442b osbuild: pass UID/GID as int
These were passed as strings, which is not what osbuild expects.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-29 16:04:38 +02:00
Martin Sehnoutka
1e5c31a7ad distro/rhel8: introduce s390x support
This patch introduces support for s390x architecture. It has some
specific requirements like using kernel-cmdline stage before the RPM
stage because RPM scriptlets require these values to be present in the
system already. It also uses zipl stage and bootloader as opposed to all
the other architectures.
2020-06-11 21:50:09 +02:00
Martin Sehnoutka
d20682fcae osbuild: introduce kernel-cmdline stage
This stage can be used to set kernel boot parameters.
2020-06-11 21:50:09 +02:00
Tom Gundersen
5c3f4193e5 osbuild/rpm: set check_gpg per-package
Rather than passing an array of checksums, pass an array of objects
with package properties. One is the `checksum`, which is required, and
in addition to that we now pass the boolean check_gpg, which indicates
that that RPM should have its GPG signature verified.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-06-10 19:25:54 +02:00
Martin Sehnoutka
7979a705b6 osbuild: filesystem is not required member of qemu assembler
The input options of qemu assembler do not require filesystem for every
partition. This patch makes it optional and omits the object in case it
is empty.

osbuild schema definition:
162797f206/assemblers/org.osbuild.qemu (L63)
2020-06-05 20:09:20 +02:00
Martin Sehnoutka
673e967b2d osbuild: Change QEMUPartition "Type" to match osbuild
Partition type, as defined in osbuild qemu assembler, is of type string
because it is either UUID or identifier. See here for details:
162797f206/assemblers/org.osbuild.qemu (L88)

Change type of the "Type" struct member to match the definition in
osbuild. This patch is needed for ppc64le support.
2020-06-05 20:09:20 +02:00
Martin Sehnoutka
d74fc4e3fa osbuild: introduce zipl stage
zipl is a z initial program loader used with IBM Z systems. This stage
is required to get support for the s390x architecture.
2020-06-05 19:29:16 +02:00
Martin Sehnoutka
604f7c2a55 osbuild: introduce bootloader struct into qemu assembler
osbuild takes a "bootloader" object as an option to the qemu assembler:
3f14ace5c1/assemblers/org.osbuild.qemu (L43)
we don't use it because for x86_64 with enabled legacy support it
defaults to the right value:
3f14ace5c1/assemblers/org.osbuild.qemu (L482)
but in order to gain support for ppc64le we need to introduce this.
Example usage can be found in samples directory:
3f14ace5c1/samples/f30-ppc64le.json (L819)

This change itself does not alter osbuild-composer output.
2020-06-05 10:01:24 +02:00
Martin Sehnoutka
65bc635c30 osbuild: change legacy type from bool to string
This work is based on previous PRs, namely:
https://github.com/osbuild/osbuild-composer/pull/501
and
https://github.com/osbuild/osbuild/pull/327

The problem here is that we used to treat legacy as a boolean before we
started introducing support for alternative architectures, but now we
need to specify exact strings for the grub2 stage, for example for
ppc64le the legacy parameter looks like this:

```
"legacy": "powerpc-ieee1275"
```

This patch will allow us to introduce support for ppc64le and fix
associated issues:
https://github.com/osbuild/osbuild-composer/issues/693
2020-06-03 12:29:47 +02:00
Jacob Kozol
5938276d3b osbuild: update files source for rhsm
osbuild manifest's urls should now contain a url and any secrets. The
secrets should contain a name.
2020-05-28 00:23:54 +02:00
Tom Gundersen
a544fa7eb6 osbuild: add rpm-ostree stage
This adds the wrapper object and a simple test for the rpm-ostree stage.

See the osbuild documentation for details.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-05-25 22:37:29 +02:00
Tom Gundersen
1c9cb20b77 osbuild: add ostree.commit assembler
This adds the wrapper object and a simple test for the ostree.commit
assembler.

See the osbuild documentation for details.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-05-25 22:37:29 +02:00
Tom Gundersen
fd7320aaa1 osbuild/fstab: add filesystem label support
Exactly one of the UUID or the label must be set. The helpers are kept
the same and only supports the UUID for now, but these should likely be
dropped in favor of open-coding the structs anyway.

We do not enforce that the UUID or label is set, but osbuild will.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-05-25 22:37:29 +02:00
Jacob Kozol
51c610e1ae osbuild: remove tar image size
Image size should not be specified for a tar image. When the tar
assembler was being created image size was not passed to it. However,
the TarAssemblerOptions contained a Size field which would default to 0.
This field is removed so that the tar assembler options no longer
specify a size. The assembler tests are also updated to reflect this
change.
2020-04-29 12:36:43 +02:00
Martin Sehnoutka
439b005514 distro: harcode partuuids
We need to make partition uuids stable to be able to run image-info
tests on images using gpt. For example all aarch64 images use gpt.

Also change the type of the (part) UUID to string because that's what
the other UUIDs use and it is easier to work with.
2020-04-15 15:22:57 +02:00
Martin Sehnoutka
cdb4b72cf0 osbuild: add partuuid into the partition struct
The partuuid is a uuid of a specific GPT partition as opposed to the ptuuid
which is associated with the partition table and filesystem uuid which
is associated with a filesystem on a partition.

The support for partuuid was introduced in osbuild 11, see this PR for
reference: https://github.com/osbuild/osbuild/pull/306
2020-04-14 07:55:48 +02:00
Jiri Kortus
b0e28689fb Add unit test for systemd stage
Refs: #406
2020-04-01 09:52:10 +02:00
Jiri Kortus
e516180640 Add unit tests for SELinux stage
Refs: #406
2020-04-01 00:26:22 +02:00
Jiri Kortus
44b501d401 Add unit test for timezone stage
Refs: #406
2020-04-01 00:25:59 +02:00
Jiri Kortus
8dafb64f1b Add unit tests for script stage
Refs: #406
2020-04-01 00:25:34 +02:00
Jiri Kortus
8c808831d3 Add unit test for users stage
Refs: #406
2020-04-01 00:24:39 +02:00
Jiri Kortus
ea02b33d2b Add unit test for RPM stage
Refs: #406
2020-04-01 00:19:43 +02:00
Jiri Kortus
600a0f50a9 Add unit test for locale stage
Refs: #406
2020-03-31 09:35:20 +02:00
Jiri Kortus
c4d5edaf0d Add unit tests for Pipeline struct
Refs: #406
2020-03-31 09:35:11 +02:00
Jiri Kortus
f5ad337c62 Add unit test for keymap stage
Refs: #406
2020-03-30 20:45:33 +02:00
Jiri Kortus
c2ed6da92e Add unit test for hostname stage
Refs: #405
2020-03-30 20:44:16 +02:00
Jiri Kortus
5fc1f10ecb Add unit test for GRUB2 stage
Refs: #405
2020-03-27 19:18:14 +01:00
Jiri Kortus
3306a3b20e Add unit test for groups stage
Refs: #405
2020-03-27 19:11:13 +01:00
Jiri Kortus
bc52b93ece Add unit tests for fstab stage
Refs: #405
2020-03-27 19:10:42 +01:00
Jiri Kortus
ea3fccd643 Add unit tests for chrony stage
Refs: #405
2020-03-27 19:09:30 +01:00
Jiri Kortus
dd3fc6bd7c Add coverage for *assembler.go
Resolves: #363
2020-03-27 16:37:12 +02:00
Jiri Kortus
2d8b9c3178 Add unit test for firewall stage
Refs: #405
2020-03-27 15:22:08 +01:00
Jiri Kortus
dae77de5ac Add unit test for Fix BLS stage
Refs: #405
2020-03-27 15:21:47 +01:00
Tom Gundersen
895a4769e3 osbuild: remove dead code
The helper functions were never used, we should aim to use the
osbuild types just as regular structs for serialization purposes.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-26 00:31:37 +01:00
Jiri Kortus
f5cf649511 Fix typo in RootFilesystemUUID
RootFilesystemUUDI -> RootFilesystemUUID
2020-03-24 11:01:20 +01:00
Ondřej Budai
54e27e607c stage: make the unmarshalling error more verbose
Prior this commit there was no information in the log about the unrecognized
stage. This commit adds the stage name to the unmarshalling error.
2020-03-17 12:21:01 +01:00
Tom Gundersen
8d3be9e2c0 osbuild/stages: drop the dnf stage
This is no longer used, and will be deprecated in osbuild eventually.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-15 19:38:59 +01:00
Tom Gundersen
4da1ab03b3 osbuild: introduce manifest concept
A manifest is simply a struct containing a sources and a pipeline
object. We want to store and transfer pielines always with their
sources, and will use the manifest for this.

When serialized, a manifest can be the input to `osbuild`, just
like a bare pipeline can be. This means there will be no need
to pass in sources separately on the commandline.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-03 22:25:49 +01:00
Ondřej Budai
1676cf58da lint: fix gosimple/S1004 errors 2020-03-02 14:28:55 +01:00
Tom Gundersen
7f97401ef8 osbuild: add RPM stage type
This is the replacement for the DNF stage, containing only GPG
keys and package checksums. It is meant to be used together with
the files source to actually fetch the packages. Depsolving must
be done in composer and the full package list inserted into
the pipeline.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-02-14 14:43:27 +01:00
Tom Gundersen
3b774e0e6d osbuild: add source type
This represents the sources objects, for now only org.osbuild.files
is supported.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-02-14 14:43:27 +01:00
Tom Gundersen
d133454d91 pipeline: rename package to osbuild
Rename the package from `pipeline` to `osbuild` to reflect that it
will no longer be specific to pipelines, but rather covers all
osbuild datatypes.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-02-14 14:43:27 +01:00