Commit graph

91 commits

Author SHA1 Message Date
Antonio Murdaca
cca0e773f6 support ignition in edge simplified-installer and raw-image
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
Signed-off-by: Irene Diez <idiez@redhat.com>
Co-authored-by: Irene Diez <idiez@redhat.com>
Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2023-01-17 14:02:02 +01:00
Ondřej Budai
b997142db0 common: merge all *ToPtr methods to one generic ToPtr
After introducing Go 1.18 to a project, it's required by law to convert at
least one method to a generic one.

Everyone hates IntToPtr, StringToPtr, BoolToPtr and Uint64ToPtr, so let's
convert them to the ultimate generic ToPtr one.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-09 14:03:18 +01:00
Irene Diez
76728818c9 internal/distro/rhel9: handle ignition.embedded for edge
Signed-off-by: Irene Diez <idiez@redhat.com>
2022-12-15 11:34:17 +00:00
Achilleas Koutsou
a0528d2e53 osbuild: remove 'users' boolean argument from NewAnacondaStageOptions()
Drop the argument altogether.
2022-12-13 20:33:27 +00:00
Irene Diez
6cb8216f09 internal: update firewall stage to allow zones
Updates firewall stage customizations to allow zones
as per the changes made on osbuild/osbuild#1157

Relevant tests and pipelines for rhel8+9 updated.

Signed-off-by: Irene Diez <idiez@redhat.com>
2022-12-06 16:39:00 +01:00
Antonio Murdaca
80a6b1bd23 Extend firewall customizations to add sources
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Co-authored-by: Irene Diez <idiez@redhat.com>
2022-12-06 16:39:00 +01:00
Sayan Paul
5ce3de214d build:create systemd_journald stage
Creates new stage to configure
journald to persist the journal.
Instead of creating the `/var/log/journal`
directory we explicitly configure journald
via the new stage.This is done in
according to the FCOS norms.
Unit tests also added for functionality
check.

Co-authored-by: Irene Diez <idiez@redhat.com>
Signed-off-by: Sayan Paul <saypaul@redhat.com>
2022-12-06 12:15:09 +01:00
Achilleas Koutsou
8c75975917 osbuild: add masked services to systemd stage 2022-12-02 19:04:26 +00:00
Achilleas Koutsou
5d760c48ad osbuild: remove Timeservers slice from chrony stage
The org.osbuild.chrony stage was extended to allow additional directives
alongside time servers [1].  The old Timeservers string slice was kept
for backwards compatibility.  Removing support for it in
osbuild-composer makes working with the stage's options simpler.  Using
the new struct slice Servers field and only specifying a Hostname for
each element is equivalent to the old behaviour, so no functionality is
lost.

This simplifies the chrony stage since no validation is required
anymore.
It also simplifies the propagation of configuration options through the
pipeline generation code which doesn't need to check for both types of
stage options.

[1] https://github.com/osbuild/osbuild/pull/692
2022-11-28 17:20:49 +01:00
Simon de Vlieger
d4d100383e image: create installer image types for fedora
This adds the `fedora-image-installer` and
`fedora-image-installer-preview` images.

The image installer type installs anaconda-webui on Fedora >= 38 to use
the new UI. It also writes its setting to
`/usr/share/anaconda/interactive-defaults.ks` as the current
anaconda-webui has not yet been tested in kickstart mode.

To do so manifest.Anaconda was expanded to take a (subset) of options
for a KickstartStage which is will write into interactive-defaults.ks.
And to take a list of additional modules to enable, so we can set up
Anaconda with all default modules.
2022-11-21 09:45:26 +01:00
Sanne Raymaekers
500341a25f internal/osbuild: contenturl and rhsm secrets for ostree sources 2022-10-28 16:14:30 +02:00
Achilleas Koutsou
abdddc6e55 osbuild: fix gpgkeys json key in ostree source 2022-10-12 03:07:40 +02:00
Achilleas Koutsou
1324f7fb8c osbuild: simplify copy stage test 2022-10-11 10:00:22 +02:00
Achilleas Koutsou
c6b999f178 ostree: rename CommitSource to CommitSpec and add Ref
The CommitSource was used to specify the source URL and checksum of a
commit for use in manifest sources.  Renaming to CommitSpec and adding a
Ref parameter generalises the type so that we can use it to specify
commits in various situations.  This is building towards separating when
ostree parameters are used for fetching a commit, fetching a parent
commit, and building one.

The CommitSpec is (very roughly) analogous to the rpmmd.PackageSpec.
2022-10-11 10:00:22 +02:00
Achilleas Koutsou
14f608de0a osbuild: use internal users package structs in stages
Don't pass blueprint Users and Groups options all the way down to the
osbuild stage bindings.  Instead, convert them to the internal
users.User and users.Group structs.
Ideally we would do this even higher up in the code path, before
reaching the distro, but this is the first step towards that.
2022-09-29 18:09:38 +02:00
Achilleas Koutsou
c0fcbfc5c2 osbuild: add isolinux stage
Add support for the org.osbuild.isolinux stage.
2022-09-29 18:09:38 +02:00
Achilleas Koutsou
204b4177ec osbuild: add squashfs stage
Add support for the org.osbuild.squashfs stage.
2022-09-29 18:09:38 +02:00
Achilleas Koutsou
3d772b6846 osbuild: simplify and unify tree stage inputs
- Remove stage-specific input types when they are org.osbuild.tree input
  types.
- Use PipelineTreeInputs when stage requires a single tree input
  reference with an arbitrary key.
- For Stages that require a specific key with a tree input, make the key
  part of the NewXStage() function and only allow specifying the name of
  the pipeline from which to copy the tree as part of the function
  arguments.
2022-09-29 18:09:38 +02:00
Achilleas Koutsou
ca0175c82b osbuild: function for creating named pipeline tree inputs
Convenience function for creating a map with a single input pointing to
a pipeline's tree with a given key.
Different stages use different keys in the map (often "tree").
Functions will be added for each stage to create a map with the
appropriate key when necessary.
2022-09-29 18:09:38 +02:00
Achilleas Koutsou
58966e4b13 osbuild: fix tree input schema
The references field in org.osbuild.tree inputs currently supports one
of three forms, all of which are functionally equivalent:
- Array of one string
- Array of one object with key "id" and string value
- Single object with no properties (only key/name)

We use the first form which is the simplest.

The string should refer to a pipeline by name (as name:<pipelinename>),
which means the input refer to the final tree of the named pipeline.
2022-09-29 18:09:38 +02:00
Irene Diez
0f8ed4e04b distro/rhel90: edge images default to LVM
Change partition tables on edgeBase images to use
'LVM partitioning'. We need to ensure that LVM
stages are done before LUKS stages (e.g. remove-key)
or the pipelines will break (we cannot open a device
when its password has changed).

Add relevant tests on device_test.go plus a new
test partition table on common_test.go
2022-09-22 10:20:27 +02:00
Achilleas Koutsou
86d9611f98 osbuild: generator functions for UsersStage and GroupsStage
Generators for creating UsersStage and GroupsStage from the new internal
types.
These are almost identical to the existing stage option creation
functions.  Those will be removed once every use is replaced with the
new generators.
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
0b3bfd0d02 osbuild: update rpm stage with new options
- db path: set alternative rpm database path [1]
- ostree-booted: create the /run/ostree-booted marker which marks an
  install as ostree.  Install-time scripts in packages use this marker
  to treat ostree installations differently.

[1] https://github.com/osbuild/osbuild/pull/666
[2] https://github.com/osbuild/osbuild/pull/1085
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
0750049739 osbuild: update org.osbuild.ostree.remotes stage
New options added to stage in osbuild [0].

[0] https://github.com/osbuild/osbuild/pull/1097
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
0ff1c3241c osbuild: add mount ostree helper method to Stage
A convenience method that adds an ostree deployment mount to any Stage.
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
4a68df45c7 osbuild: add ostree.deployment mount type
New mount type added: org.osbuild.ostree.deployment.

Adding this to a stage will setup all needed bind mounts so that a given
`tree` will look like an active OSTree deployment, very much as OSTree
does during early boot.

This is often necessary when making changes to files in /etc for an
ostree image.
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
7246f8fdd5 osbuild: fix base Mount struct properties
Source and Target are not required -> omitempty
Options is of type MountOptions which is an interface, so we don't need
to make it a pointer.
2022-09-13 16:06:19 +01:00
fkolwa
1fbdb21f6b internal/osbuild: Add GCP guest-agent conf stage
Add GCP guest-agent conf stage test
2022-08-30 22:21:29 +02:00
Simon de Vlieger
c5f335bceb Add the rhsm.facts stage.
We initially provide a Facts file that stores the `ApiType`. This is the
API that was used to request the compose.
2022-08-25 18:56:35 +02:00
Gianluca Zuccarelli
512cbd6089 osbuild: new stage oscap remediation 2022-08-04 18:19:06 +02:00
Achilleas Koutsou
c20e1e53c4 osbuild: use path as secondary sort key for fstab
Most filesystems entries in fstab don't have a PassNo, which makes the
order of those entries dependent on the sorting algorithm.  Changes in
the algorithm can introduce changes in the sort order, which we don't
like.

Add a secondary sorting key, the Path, which is guaranteed unique, to
guarantee stable ordering.
2022-07-27 18:29:59 +02:00
Christian Kellner
8a06b9ddf3 osbuild: add bindings for org.osbuild.containers.storage.conf stage
Add support for the `containers.storage.conf` stage with helper
constructors that should make it easy to use.
Add a small test for it.
2022-07-26 17:07:31 +02:00
Christian Kellner
2c0594629f osbuild: add extraEnv argument to RunOSBuild
This adds the ability to supply extra environment variables to
the osbuild process.
2022-07-25 21:21:44 +02:00
Christian Kellner
49b37d672b osbuild: support generating container sources
Modify the existing `GenSources` helper to also support generating
`org.osbuild.skopeo` source for fetching container images.
2022-07-21 13:32:07 +02:00
Christian Kellner
f8804358a4 osbuild: add new org.osbuild.skopeo stage
Add bindings for the `org.osbuild.skopeo` that can be used to copy
container images, accessed via the `org.osbuild.containers` input,
into images.
The constructor is designed with ease of use in mind and takes
the needed container inputs and the storage path option, i.e.
where to store the container in the images.
2022-07-21 13:32:07 +02:00
Christian Kellner
718b0c0c32 osbuild: add support for org.osbuild.container inputs
Add bindings for `org.osbuild.conainer` inputs which can be used to
supply containers to stages. Currently only fetching containers via
sources is supported.
2022-07-21 13:32:07 +02:00
Christian Kellner
513ae6d3d0 osbuild: add support for the org.osbuild.skopeo source
Add bindings for the `org.osbuild.skopeo` source that can be used
to fetch container images from container registires.
2022-07-21 13:32:07 +02:00
Brian C. Lane
d3af314e58 users_stage: Don't allow empty passwords
Make sure empty passwords are set to nil so they result in a locked
account.

Also add a test for the password hashing in NewUserStageOptions()
2022-07-16 22:54:26 +01:00
Achilleas Koutsou
9d4a351ca6 Rename osbuild2 package to osbuild 2022-07-14 16:54:00 +02:00
Achilleas Koutsou
8090621300 osbuild: rename package to osbuild1
Preparing for version 2 of the manifest schema, which will be
implemented in a separate package (osbuild2) alongside the original.
2021-03-17 18:12:17 +00:00
Tom Gundersen
0efc345b2d rhel84/grub2: set saved_entry
Explicitly set the kernel to boot into.

Also change the blueprint/kernenl handling:

Rather than only falling back to the default kernel name for
getting the package list, let GetKernel() always return the
correct result so we can rely on this being consistent.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-02-20 20:01:15 +01:00
Tomas Hozza
1d48c92953 Add support for org.osbuild.rhsm stage
Add support to configure `org.osbuild.rhsm` osbuild stage. This stage
allows the configuration of Red Hat Subscription Manager (RHSM) related
components. Currently it is possible to configure only the enablement
status of RHSM DNF plugins.

Add `/docs/news/unreleased/osbuild-rhsm-stage.md` with information about
the added support for `org.osbuild.rhsm` osbuild stage.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-11 11:10:47 +01:00
Jacob Kozol
eea18fc897 distro/rhel84: add sysconfig stage
The org.osbuild.sysconfig stage is now supported. Config updates can be
made to the kernel and network files. Currently, the same values are
used for all image types in rhel84. The image-info script is updated to
allow testing the sysconfig info.
2021-02-09 14:13:25 +01:00
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