Skip to content

Commit

Permalink
distro/rhel9: support kernel options in edge images
Browse files Browse the repository at this point in the history
Add kernel options to the image type for edge images (raw, ami, and
vsphere) and handle them in the edgeRawImage() function.
Move the 'modprobe.blacklist=vc4' option, which was used to be set in
the image function, to the image types instead.
  • Loading branch information
achilleas-k committed Oct 30, 2023
1 parent 18d64d7 commit d40977f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/distro/rhel8/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ func edgeRawImgType() imageType {
filename: "image.raw.xz",
compression: "xz",
mimeType: "application/xz",
image: edgeRawImage,
packageSets: nil,
defaultSize: 10 * common.GibiByte,
rpmOstree: true,
bootable: true,
bootISO: false,
image: edgeRawImage,
kernelOptions: "modprobe.blacklist=vc4",
buildPipelines: []string{"build"},
payloadPipelines: []string{"ostree-deployment", "image", "xz"},
exports: []string{"xz"},
Expand Down
4 changes: 3 additions & 1 deletion pkg/distro/rhel9/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ var (
defaultImageConfig: &distro.ImageConfig{
Locale: common.ToPtr("en_US.UTF-8"),
},
kernelOptions: "modprobe.blacklist=vc4",
defaultSize: 10 * common.GibiByte,
rpmOstree: true,
bootable: true,
Expand Down Expand Up @@ -145,7 +146,7 @@ var (
defaultImageConfig: &distro.ImageConfig{
Locale: common.ToPtr("en_US.UTF-8"),
},
kernelOptions: amiKernelOptions,
kernelOptions: amiKernelOptions + " modprobe.blacklist=vc4",
defaultSize: 10 * common.GibiByte,
rpmOstree: true,
bootable: true,
Expand All @@ -166,6 +167,7 @@ var (
defaultImageConfig: &distro.ImageConfig{
Locale: common.ToPtr("en_US.UTF-8"),
},
kernelOptions: "modprobe.blacklist=vc4",
defaultSize: 10 * common.GibiByte,
rpmOstree: true,
bootable: true,
Expand Down
7 changes: 6 additions & 1 deletion pkg/distro/rhel9/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,12 @@ func edgeRawImage(workload workload.Workload,
img.Users = users.UsersFromBP(customizations.GetUsers())
img.Groups = users.GroupsFromBP(customizations.GetGroups())

img.KernelOptionsAppend = []string{"modprobe.blacklist=vc4"}
// The kernel options defined on the image type are usually handled in
// osCustomiztions() but ostree images don't use OSCustomizations, so we
// handle them here separately.
if t.kernelOptions != "" {
img.KernelOptionsAppend = append(img.KernelOptionsAppend, t.kernelOptions)
}
img.Keyboard = "us"
img.Locale = "C.UTF-8"
if !common.VersionLessThan(t.arch.distro.osVersion, "9.2") || !t.arch.distro.isRHEL() {
Expand Down

0 comments on commit d40977f

Please sign in to comment.