Commit graph

37 commits

Author SHA1 Message Date
Achilleas Koutsou
eaf3dc2ecc manifest: always add inst.stage2 kernel option for Anaconda
The bootiso.mono stage in osbuild that we used until recently adds the
inst.stage2 option unconditionally [1] whereas the current grub2.iso
stage that we use now doesn't.

[1] 8511add169/stages/org.osbuild.bootiso.mono (L369)
2022-12-13 07:49:32 +00:00
Achilleas Koutsou
f68ac1d163 image: new image kind: OSTreeSimplifiedInstaller
Define the OSTreeSimplifiedInstaller ImageKind.
This is the top-level image definition.
It uses the raw image pipelines, iso pipelines, and the new coreos
installer pipelines.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
8d36e048bc image: separate raw image pipeline from InstantiateManifest
Make the pipeline code a reusable function so we can use it in multiple
images (edge-raw-image and edge-simplified-installer).
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
bd448edad0 manifest: support adding per-distro dracut modules to installers
Different distros and image types have different dracut modules
available and enabled.  Set these at the distro level and push them down
through the appropriate manifests, pipelines, and stages.

Added to both anaconda and coreos installers.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
edce65eabd manifest: move kernel option handling outside EFIBootTree
The kernel arguments for the EFIBootTree depend on the type of ISO we're
building, the payload, and the location of the kickstart file if any.
Instead of setting multiple fields on the object, most of which would be
mutually exclusive, set the kernel arguments from the image manifest
generator function which has all the information.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
fae824d574 manifest: rename ISOTree to AnacondaISOTree
The ISOTree struct and pipeline generator is specific to Anaconda.
Rename it for clarity and to differentiate from any other ISO tree
pipeline.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
3d1f283dab manifest: add any pipeline to ISO pipeline
Support adding any pipeline as the tree for the ISO.

The existing ISOTree (bootiso-tree) pipeline is specific to Anaconda.
This change will allow the ISO (bootiso) pipeline to be created with any
pipeline, so we can add an ISO tree that is specific to the CoreOS
Installer.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
115c0717c4 manifest: remove Anaconda pipeline from EFIBootTree
Remove dependence of EFIBootTree pipeline (efiboot-tree) on an Anaconda
pipeline.  The Anaconda pipeline was used to get the product and version
strings, so we pass those in instead.
This way, we an use the pipeline without needing an Anaconda pipeline.
The EFI tree shouldn't depend on an installer (or any) pipeline.
2022-12-11 12:37:37 +00:00
Achilleas Koutsou
9e66ee13e7 image: enable ISOLinux only for x86_64
ISOLinux was unconditionally enabled for all ISOs, which is incorrect
and breaks builds on aarch64.
Enable it only for x86_64.
2022-12-08 10:30:09 +01:00
Achilleas Koutsou
b3f4d75699 image: panic if unknown compression option is specified
Currently we only support "xz", but keeping it as a `switch` to easily
support more types in the future.
The empty string is also supported as a no-op.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
c6bfb22f54 manifest: support specifying kickstart file location
Add support for specifying where the kickstart file will be created:
either in the default location in the anaconda tree or at the root of
the ISO like we did so far in RHEL.

From the distro level, this is controlled by a boolean that when set to
true puts the kickstart file in the root of the ISO tree at /osbuild.ks
(the old behaviour) and if unset falls back to the default location
/usr/share/anaconda/interactive-defaults.ks.

Changed the name of the kickstart file for ostree back to osbuild.ks
Was ostree.ks for a while since a1bfcfe91c.

For Fedora we use the default and for RHEL we maintain the old behaviour
for now.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
5d55ccf109 manifest: support specifying squashfs compression for ISOs
Add support for specifying the squashfs compression method for ISOTree
pipelines from the caller.
Build Fedora ISOs with lz4 compression and RHEL with xz.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
cb0280c8c9 image: always enable users module in anaconda
Unconditionally enable the users module in Anaconda.
The module serves two purposes:
- It will create a user that's defined in the blueprint by adding the
  user creation stage in the kickstart file.
- It allows users to create user accounts interactively during
  installation.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
e100c57e58 image: new ImageKind: archive 2022-11-28 17:20:49 +01:00
Achilleas Koutsou
2369869db7 distro/rhel9: update gce images to new definitions
add the image function and remove the pipeline function.
Remove the build package set.

Parameterise image config creation functions so that RHSM is added
conditionally based on distro name, like we did for AMI/EC2.

image: set the raw filename for the GCE image type

GCP requires that the raw image file inside the archive be named
'disk.raw'.  We set it on the imagePipeline while instantiating the
manifest as a workaround for now.

This should be changed to be configurable on the image type when
necessary, the same way the final filename is defined.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
f0e29ab697 image: handle the GCE format in the live image
Add the options required by GCE to a tar pipeline at the end of the
manifest for images defined on the GCE format.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
ae37ebb286 image: support compression on all live image types
Apply "xz" compression to any artifact pipeline if it's specified in the
image type.  The image filename should be applied to the pipeline only
if it's the last one, so we need to skip this assignment if we're going
to add a compression pipeline at the end.

This is a bit dirty but the plan is to remove artifact compression from
manifests and perform it during the export in osbuild-composer, so this
should go away soon.
2022-11-28 17:20:49 +01:00
Achilleas Koutsou
6fed422972 image: xz compress a pipeline if the image specifies it
If an image specifies xz compression, add an xz pipeline to the end of
the manifest.
2022-11-28 17:20:49 +01:00
Simon de Vlieger
3443484502 image: image_installer, use gzip compression 2022-11-24 17:59:56 +01:00
Simon de Vlieger
0e2f8bb115 image-installer: move conditionals into distro
Try and keep `image/image_installer.go` as clean as possible and instead
pass any customizations one layer up.
2022-11-21 09:45:26 +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
Achilleas Koutsou
d32dff14b4 image: make read only sysroot optional for OSTreeRawImage 2022-10-11 10:00:22 +02:00
Achilleas Koutsou
4ae8304bd2 image: make ostree commit mandatory in the OSTreeRawImage
Make the ostree commit spec mandatory in the OSTreeRawImage by adding it
to the constructor.

Use the ostree.CommitSpec to specify parameters in the OSTreeRawImage
ImageKind and the OSTreeDeployment Pipeline.
2022-10-11 10:00:22 +02:00
Achilleas Koutsou
5f98d7082c manifest: make ostree commit spec mandatory in the OSTreeInstaller
Make the ostree commit spec mandatory in the OSTreeInstaller ImageKind.
The installer image type is not just for ostree types so make the ostree
parameters optional for the ISOTree Pipeline.

Use the ostree.CommitSpec to specify commits parameters.
2022-10-11 10:00:22 +02:00
Achilleas Koutsou
99952afbd4 Separate ostree ref from parent spec in Pipelines and ImageKinds
In the OS pipeline, the parent configuration was used to detect if the
pipeline's setup was meant for an ostree commit or not.  Also, the
pipeline used a new type to specify the ostree parameters.

- Use the ostree.CommitSpec for the parent configuration.
- Add a new attribute, OSTreeRef, that defines the ref for the ostree
  commit being built.  An empty string indicates that the tree is not
  for an ostree commit.

Additionally, in the ImageKind configurations for the ostree archive and
container, separate the ostree ref from the parent spec, make the parent
spec optional (pointer) and the ostree ref mandatory, by requiring it in
the constructor of the ImageKind.
2022-10-11 10:00:22 +02:00
Achilleas Koutsou
aec3ef4161 image: update ostree installer to use new pipelines
Fedora iot-installer now uses the new ostree installer pipelines that no
longer use the bootiso.mono stage.
2022-09-29 18:09:38 +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
a1bfcfe91c manifest: update bootiso-tree pipeline to use new stages
- Use newer granular stages to build the bootiso tree rather than the
  deprecated bootiso.mono stage.
- Adjust the ISOTree struct properties: add the ones needed by the new
  stages and remove any properties that have been moved to the new
  pipelines.
2022-09-29 18:09:38 +02:00
Achilleas Koutsou
6cd3a34099 image: add users and groups to edge/iot raw images 2022-09-13 16:06:19 +01:00
Achilleas Koutsou
1de55c73e6 ostree: define type for handling ostree remote config
A new struct in ostree can be used to define configuration options for
the ostree remote of an image.  So far remotes were always set up with
the remote URL used to pull the commit.  Now we support setting a
different remote with extra configuration options.

This is used by the fedora-iot-raw-image to set up the remote
configuration of the final image, separately from the source of the
commit.

Test manifests updated.
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
76031d4104 manifest: add OSTreeDeployment config options
Adding support for config options to OSTreeDeployment that are required
by the IoT raw image:
- Kernel command line options
- Keyboard layout
- Locale

Test manifests updated.
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
b85fe8109c manifest: add the platform configuration to the RawOSTreeImage 2022-09-13 16:06:19 +01:00
Achilleas Koutsou
74a196e427 image: complete OSTreeRawImage.InstantiateManifest()
Create all the necessary pipelines for the OSTreeRawImage and return the
artifact from the XZ pipeline.

Co-Authored-By: Ondřej Budai <ondrej@budai.cz>
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
5d61ba5d39 image: add OSTreeRawImage ImageKind
InstantiateManifest is a stub.  No implementation yet.

Co-Authored-By: Ondřej Budai <ondrej@budai.cz>
2022-09-13 16:06:19 +01:00
Achilleas Koutsou
18abe661a7 distro/fedora: enable hybrid boot for iot-installer 2022-08-25 14:54:56 +01:00
Tom Gundersen
0f5846326c image: introduce image kinds for Fedora
Implement all of Fedora in terms of this new abstraction. What used to be the
manifest functions (and before that the pipeline functions) are now the image
functions, whose purpose is to instantiate the right image kind structs from the
image type definitions we currently have in the distro definition.
2022-07-22 16:04:07 +02:00
Tom Gundersen
5a15608c89 image: add image kind abstraction
This abstracts away the manifest instantiation. The idea is that we define one
of these image kind types to represent a group of image types that are
sufficiently similar. Each image kind will have a struct with with all the
properties that can be customised for the image and a function to turn that into
an actual manifest. This is similar to how distro/fedora/manifest.go and
cmd/osbuild-playground works today, and aspires to move these closer together
and to eventually make the distro definitions simpler.

For now cmd/osbuild-playground is moved over to using the new abstraction.
2022-07-22 16:04:07 +02:00