-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the new partitioning customizations to RHEL and CentOS #1077
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding the new customizations to all image types.
The duplication makes me slightly sad but I guess there is no way with the current design to do it differently, I would still love to explore ideas here. I was thinking about at least suggesting a comment like "// keep in sync with the other distros" but I guess that is implied already so redundant.
if err != nil { | ||
return nil, err | ||
} | ||
if partitioning != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could be defensive here and double check that customizations.Filesystem and partitioning is never both non-nil and raise an internal error. But maybe overkill.
partitioning.MinSize = imageSize | ||
} | ||
|
||
partOptions := &disk.CustomPartitionTableOptions{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the fact that this is duplicated with fedor/imagetype.go is unavoidable currently (and consistent with the rest of the code)(?)
return warnings, err | ||
} | ||
|
||
if err := partitioning.ValidateLayoutConstraints(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this here three times makes me wonder if we could consolidate this longer term, might be nice to have a single "validate" helper somewhere so that it's less duplicated lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xref #1065
If you're referring to the The way it's structured currently, it's a bit of a necessary evil because for some (but perhaps not most) customizations, the requirements are different between distributions and major versions. Perhaps extracting the common ones would be enough to get the ball rolling on some of the simplification and to avoid diverging where possible. |
RHEL 8 aarch64 builds are failing. 🤔 Digging. |
A comment in @ondrejbudai's #1080 PR got me thinking:
Instead of listing all supported customizations for each image type like I tried to do in that linked branch, it might be simpler (and more readable) to have properties and capabilities for each image type, and then customizations would be valid or invalid for a given property. For example "has partition table" is an image type property, which internally could just be a method that checks if the base image type defines a partition table or not. Defining disk or filesystem customizations for any image type that doesn't have a PT is invalid. This could probably be cleanly extended to all blueprint options: "has package payload" (if false, don't allow packages), "has ostree payload" (requires ostree commit), "can oscap"... Those payload ones in particular will simplify things a lot. Right now, when we're dealing with ostree types, we first check for |
I managed to reproduce the issue. When building a RHEL 8 image on a Fedora host, it seems the swap partition doesn't get created properly, or at least there's some incompatibility with the RHEL 8 kernel, resulting in:
when trying to enable the swap space. Building the same image on RHEL 8 works fine. It's strange though that this only happens on aarch64. |
Might be time to switch to running each build on the same host as the target. Not a huge change to set up, but might need some changes in the test scripts that were written to run on newer python versions. OTOH, maybe running stuff on RHEL 8 doesn't make sense. We're not targeting RHEL 8 any more (no more releases), so it might make more sense to test RHEL 8 builds on RHEL 9. |
I suspect the issue is the pagesize on aarch64. Apparently this got changed recently(ish).c.f. https://bugzilla.redhat.com/show_bug.cgi?id=1978730 and https://bugzilla.redhat.com/show_bug.cgi?id=2001569 - I guess we could try to be smart about it in images too and add a "mkswap -p 64k" option if we target arm and rhel < 9.2(?) |
777a6f2
to
9896461
Compare
We decided to not enable support for disk customizations in RHEL 8 and CentOS 8 for now. |
pkg/distro/rhel/imagetype.go
Outdated
partOptions := &disk.CustomPartitionTableOptions{ | ||
PartitionTableType: basePartitionTable.Type, // PT type is not customizable, it is determined by the base PT for an image type or architecture | ||
BootMode: t.BootMode(), | ||
DefaultFSType: disk.FS_EXT4, // default fs type for Fedora |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is RHEL here, right? so should this be updated to XFS and comment twekaed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy pastaaaaaa!!
9896461
to
e463a57
Compare
Pass the whole customizations struct so we can then use the Disk customization if it's set.
Read the new Partitioning/Disk customizations in the RHEL partition table generators. Validate the customizations and check that they're not used at the same time as FilesystemCustomization. We are not enabling disk customizations on RHEL 8 currently because of issues with kernel page size differences in some versions on aarch64.
e463a57
to
4e5f0c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Enabling the new partitioning customizations for RHEL and CentOS.
I also found some duplication in Fedora that I cleaned up.