Skip to content

rhel8,9: move partitioning into YAML - #1372

Closed
mvo5 wants to merge 16 commits into
osbuild:mainfrom
mvo5:yaml-unmarshal-via-json-6
Closed

mvo5 wants to merge 16 commits into
osbuild:mainfrom
mvo5:yaml-unmarshal-via-json-6

Conversation

@mvo5

@mvo5 mvo5 commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

An updated WIP branch that uses the new partition_table_override idea which seems much easier to read then the previous attempt that used partition_table_conditional (c.f. #1339). Still very messy but another (small) step into the right direction I think. Opening mostly get give ppl the chance to follow the current evolution of this work.

mvo5 added 14 commits March 31, 2025 09:44
This commit moves the partition tables for RHEL-10 (and by implication
Centos-10) into YAML.
This commit removes the hardcoded `size`, `fstab_options` and
moves them to a generic reflect based override implementation.
This commit adds support for more partition table override
options: `distro_name` and `version_less_than` with the same
semantics as for package sets. This will be needed for rhel8.
The rhel8 partition table is slightly more complicated than rhel7
and rhel10. It requires changing the size of the "/boot" partition
depending on the version but only aarch64 systems have a /boot
partition so the existing selection based on partition index to
override does not work. Hence a new `partition_mount_point` selector
is added that can override:
```yaml
    partition_table_override:
      condition:
       version_less_than:
          "8.9":
            - partition_mount_point: "/boot"
              partition_mode: ignore-missing
              size: 222_222_222
```
It also adds the ability to control how the selection works, i.e
if not finding the selected partition is an error (the default)
or should be ignored (which we need for rhel8).
Helper as we need to remove the /boot/efi on a bunch of images
The rhel8 partition tables only defines /boot/efi for x86_64
with rhel-8.9 but it always had it for aarch64. So to make things
compatible we need yet another ad-hoc selector
For centos/fedora there are no minor versions so
centos-9 is always higher than anything 9.x. as "9" translates
to "9.0" in semVer we need to hack around this by adding .999
mvo5 added a commit to mvo5/images that referenced this pull request Apr 1, 2025
This commit exposes the base partition table for `ImageType`s.
The rational is that we want to expose those via:
```console
$ image-bulder describe-image qcow2
```
so that the yaml of the partition table is visible. This helps
developing our image definitions wihtout having to look at the
code and as added benefit it gives a "flattened" version of the
partition YAML.

As part of the work in fedora the `basePartitionTablesFunc` was
removed as it is now fully based on YAML. Once all partition
tables in RHEL are also in YAML [0] we can do a similar
simplification there.

[0] osbuild#1372
mvo5 added a commit to mvo5/images that referenced this pull request Apr 1, 2025
This commit exposes the base partition table for `ImageType`s.
The rational is that we want to expose those via:
```console
$ image-bulder describe-image qcow2
```
so that the yaml of the partition table is visible. This helps
developing our image definitions wihtout having to look at the
code and as added benefit it gives a "flattened" version of the
partition YAML.

As part of the work in fedora the `basePartitionTablesFunc` was
removed as it is now fully based on YAML. Once all partition
tables in RHEL are also in YAML [0] we can do a similar
simplification there.

[0] osbuild#1372
mvo5 added a commit to mvo5/images that referenced this pull request Apr 1, 2025
This commit exposes the base partition table for `ImageType`s.
The rational is that we want to expose those via:
```console
$ image-bulder describe-image qcow2
```
so that the yaml of the partition table is visible. This helps
developing our image definitions wihtout having to look at the
code and as added benefit it gives a "flattened" version of the
partition YAML.

As part of the work in fedora the `basePartitionTablesFunc` was
removed as it is now fully based on YAML. Once all partition
tables in RHEL are also in YAML [0] we can do a similar
simplification there.

[0] osbuild#1372
mvo5 added a commit to mvo5/images that referenced this pull request Apr 2, 2025
This commit exposes the base partition table for `ImageType`s.
The rational is that we want to expose those via:
```console
$ image-bulder describe-image qcow2
```
so that the yaml of the partition table is visible. This helps
developing our image definitions wihtout having to look at the
code and as added benefit it gives a "flattened" version of the
partition YAML.

As part of the work in fedora the `basePartitionTablesFunc` was
removed as it is now fully based on YAML. Once all partition
tables in RHEL are also in YAML [0] we can do a similar
simplification there.

[0] osbuild#1372
@mvo5
mvo5 force-pushed the yaml-unmarshal-via-json-6 branch from 6af7a83 to 5e9e9c1 Compare April 2, 2025 15:47
github-merge-queue Bot pushed a commit that referenced this pull request Apr 3, 2025
This commit exposes the base partition table for `ImageType`s.
The rational is that we want to expose those via:
```console
$ image-bulder describe-image qcow2
```
so that the yaml of the partition table is visible. This helps
developing our image definitions wihtout having to look at the
code and as added benefit it gives a "flattened" version of the
partition YAML.

As part of the work in fedora the `basePartitionTablesFunc` was
removed as it is now fully based on YAML. Once all partition
tables in RHEL are also in YAML [0] we can do a similar
simplification there.

[0] #1372
mvo5 added a commit to mvo5/images that referenced this pull request Apr 3, 2025
This is an alternative implementation of a partition table override
implementation that is *very* simple (thanks Achilleas). With the
right YAML anchor/alias support this will allow overrides for our
current cases. We can look into more complicated schemes (c.f.
osbuild#1372) if we ever need them.
@mvo5

mvo5 commented Apr 4, 2025

Copy link
Copy Markdown
Contributor Author

Closing for now in favor of #1388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant