Commit graph

12 commits

Author SHA1 Message Date
Achilleas Koutsou
0e4a9e586f split: replace internal packages with images library
Remove all the internal package that are now in the
github.com/osbuild/images package and vendor it.

A new function in internal/blueprint/ converts from an osbuild-composer
blueprint to an images blueprint.  This is necessary for keeping the
blueprint implementation in both packages.  In the future, the images
package will change the blueprint (and most likely rename it) and it
will only be part of the osbuild-composer internals and interface.  The
Convert() function will be responsible for converting the blueprint into
the new configuration object.
2023-07-10 21:11:19 +02:00
Sanne Raymaekers
1687937c51 internal/image: add ova support to live image 2023-05-25 10:14:32 +02:00
Achilleas Koutsou
822571e28e manifest: support specifying force_size for VPC
The RHEL 7 vpc subformat in qemu does not support force_size so we need
to be able to disable it.  The parameter in all parts is defined as a
pointer because the default value is 'true'.  Not specifying it will
keep the option in the osbuild stage as 'nil', falling back to 'true' in
osbuild.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
b39d802155 manifest: add support for selecting grub2.legacy
Older OS versions (RHEL 7) with older versions of grub2 don't support
BLS entries.  Setting NoBLS to true configures the bootloader with
traditional menu entries through the grub2.legacy osbuild stage.  This
requires specifying extra information for the OS to the pipeline:
version, product, and nick.
2023-01-25 20:37:12 +01:00
Achilleas Koutsou
83fc8218d6 manifest: make the partition tool for raw images configurable
Add the partition tool as an option on the Raw pipeline.  Set it to the
old value (sfdisk) by default.

Expose the option up through the liveImage image kind so that the
distribution can set it if needed.
For RHEL 7, set it to sgdisk.
2023-01-25 20:37:12 +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
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
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
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