Repository navigation
distro: make "rhel-10" a generic distro (HMS-8743) - #1577
Conversation
|
|
||
| // checkOptions checks the validity and compatibility of options and customizations for the image type. | ||
| // Returns ([]string, error) where []string, if non-nil, will hold any generated warnings (e.g. deprecation notices). | ||
| func checkOptions(t *rhel.ImageType, bp *blueprint.Blueprint, options distro.ImageOptions) ([]string, error) { |
There was a problem hiding this comment.
This needs double checking that really all options are ported over to "generic"
There was a problem hiding this comment.
We currently do not port the checks UnsupportedPartitioningModes - this is only needed in rhel-9,8, when we port the images to the generic distro this will happen there.
|
|
||
| - &rhel10 | ||
| name: "rhel-{{.MajorVersion}}.{{.MinorVersion}}" | ||
| match: "rhel-10.[0-9]{,[0-9]}" |
There was a problem hiding this comment.
Fwiw, once we move rhel-9 into a generic distro we will need to be able to parse rhel-910 and rhel-98 style versions too for backward compat. For rhel-10 this parsing was dropped.
8e0468d to
e83e4ae
Compare
| // Put the kickstart file in the root of the iso, some image | ||
| // types (like rhel10/image-installer) put them there, some | ||
| // others (like fedora/image-installer) do not and because | ||
| // its not uniform we need to make it configurable. | ||
| // XXX: unify with rhel-11 ? or rhel-10.x? | ||
| img.ISORootKickstart = t.ISORootKickstart |
There was a problem hiding this comment.
Even in Fedora we put it in the root when we want the installation to be non-interactive. IIRC, the reason we do this is because the correct way to set default values for Anaconda is in /usr/share/anaconda/interactive-defaults.ks, but you can't configure a fully automated installation with that file.
So we can:
- Use the same logic in both Fedora and RHEL, though this might be considered a breaking change for RHEL users who modify the kickstart file after building one of our ISOs.
- Always put the kickstart file in the root. This is what we used to do, but were asked to use interactive-defaults in Fedora (my memory is not 100% clear on this).
- Use profiles for setting defaults, which we wanted to do at some point but never got around to it.
There was a problem hiding this comment.
If people expect to be able to alter the kickstart it should be in the root of the iso, this makes it easy to use mkksiso to change them. Putting them into the installer root filesystem makes it much more difficult to make changes once the iso is built. Were these kickstarts incomplete? Anaconda used to support that, allowing the user to fill in missing details like the disk they wanted to install to.
There was a problem hiding this comment.
Thanks for the extra context! I'm not sure if there is anything actionable for me here though, should I file an issue or do a followup ? It seems necessary to keep things as they are if changing is considered a breaking change in rhel, so the first opportunity for this would be rhel-11 I guess(?).
There was a problem hiding this comment.
Were these kickstarts incomplete? Anaconda used to support that, allowing the user to fill in missing details like the disk they wanted to install to.
Sometimes they are, yes. Right now users can write their own kickstart in the blueprint, so we make no assumptions for its completeness or what they want to do with it after the build.
Thanks for the extra context! I'm not sure if there is anything actionable for me here though, should I file an issue or do a followup ?
Don't change anything for now. But we should revisit this.
| if err != nil { | ||
| return nil, err | ||
| } | ||
| var buf bytes.Buffer |
There was a problem hiding this comment.
I think this should also check for an empty vendor string, if that were to happen the UEFI files would end up in the wrong place in the EFI directory.
There was a problem hiding this comment.
Thanks, I added support for this (in its own commit). Its slightly roundabout, see the commit message but I think its a reasonable approach, i.e. it will only error if {{.DistroVendor}} is used in a template but unset (but as always feedback welcome, maybe I was overthinking this).
bcl
left a comment
There was a problem hiding this comment.
Looks excellent, just one teeny typo and checking for empty uefi vendor strings.
60d8ec6 to
9b6cd04
Compare
bcl
left a comment
There was a problem hiding this comment.
Looks good to me, but now it has a conflict :)
thozza
left a comment
There was a problem hiding this comment.
Thanks.
I've added a few comments in-line, but in general, this looks good.
d604c79 to
5595ed3
Compare
This commit adds: - default_kernel_name - rhsm_facts - subscriptions - rhsm_config - no_bls
For rhel based distros we need more flexibility when it comes to format the ISO label, so this commit adds the full `distro.ID` to the `getISOLabelFunc()` helper.
Some image types (like rhel10/image-installer) put the kickstart files into the root of the ISO, some others (like fedora/image-installer) do not and because its not uniform we need to make it configurable. It would be nice if we could unify this for rhel-11 or even rhel-10.x?
For centos we need a way to exclude certain image types. We have various options here, one is to put it into the image types and the other to make it a property of the distro. This commit makes it a propery of the distro because this way the image-types are easier to reuse, i.e. when something like "alma" is added we do not need to worry about changing all our image types and external consumers can also define it on the outside.
The uefi vendor need to be adjust for each distro, allow to define it in the distros.yaml and use a template in the platforms to allow this.
This commit makes rhel-10 a generic distro.
This commit ensures that we error if the `{{.DistroVendor}}`
template is used in a platform definition but the coresponding
`vendor:` attribute is not set in the `distros.yaml` yaml
definition of the distro.
We need to do it in a slightly roundabout way because:
a) not all distros set vendor (e.g. fedora just hardcodes it)
b) not all platforms need uefi
So we use the feature `missingkey=error` of text/template and
set the DistroVendor in the struct only if its actually
set in DistroYAML. This ensures that the template execution
fails if the template is used by the user has not set it.
Thanks to Brian!
This commit tweaks the `distro.InstallConfig` base on feedback from Tomáš (thanks!): 1. move KickstartUnattendedExtraKernelOpts into InstallerConfig 2. move ISORootKickstart into InstallerConfig 3. allow to have InstallerConfig defaults, this requires that we can inherit similar to ImageConfig. As part of the work the `ImageConfig.InheritFrom()` is extracted as a generic helper and used in both `ImageConfig.InheritFrom()` and `InstallerConfig.ImageConfig.InheritFrom()` The other nice benefit from this work is that need (much) less duplication in our `installer_config:` conditions because we now only need to override the specific parts we want to change instead of replacing the full config.
thozza
left a comment
There was a problem hiding this comment.
There's just one addition that I'm not sure about; the rest looks great. Thanks for all the changes, such as moving options to InstallerConfig and implementing shallow merge for it.
I'm not sure if we still support regular "override" operation for any other structures. If not, we may need to fix the docs that you've recently added.
Unfortunately there is a bunch of knowledge in the `manifest` package about distro versions. We should fix this but for now we just accept the status-quo and provide a mechanism for each "generic" distro to declare that it is similar to "rhel-$ver" or "fedora" etc.
25b8c91
This PR makes "rhel-10" a generic distro that is fully defined in YAML.