diff --git a/internal/distro/fedora/images.go b/internal/distro/fedora/images.go index 7440e377a..6c28a266d 100644 --- a/internal/distro/fedora/images.go +++ b/internal/distro/fedora/images.go @@ -283,6 +283,10 @@ func iotRawImage(workload workload.Workload, img := image.NewOSTreeRawImage() + img.KernelOptionsAppend = []string{"modprobe.blacklist=vc4"} + img.Keyboard = "us" + img.Locale = "C.UTF-8" + img.Platform = t.platform img.Workload = workload diff --git a/internal/image/ostree_raw.go b/internal/image/ostree_raw.go index 501b88f49..b98819bfd 100644 --- a/internal/image/ostree_raw.go +++ b/internal/image/ostree_raw.go @@ -14,6 +14,7 @@ import ( type OSTreeRawImage struct { Base + Platform platform.Platform Workload workload.Workload PartitionTable *disk.PartitionTable @@ -25,6 +26,10 @@ type OSTreeRawImage struct { Remote string OSName string + KernelOptionsAppend []string + Keyboard string + Locale string + Filename string } @@ -43,6 +48,9 @@ func (img *OSTreeRawImage) InstantiateManifest(m *manifest.Manifest, osPipeline := manifest.NewOSTreeDeployment(m, buildPipeline, img.OSTreeRef, img.OSTreeCommit, img.OSTreeURL, img.OSName, img.Remote, img.Platform) osPipeline.PartitionTable = img.PartitionTable + osPipeline.KernelOptionsAppend = img.KernelOptionsAppend + osPipeline.Keyboard = img.Keyboard + osPipeline.Locale = img.Locale imagePipeline := manifest.NewRawOStreeImage(m, buildPipeline, img.Platform, osPipeline) diff --git a/internal/manifest/commit_deployment.go b/internal/manifest/commit_deployment.go index 7d344499b..ef3fbcdc2 100644 --- a/internal/manifest/commit_deployment.go +++ b/internal/manifest/commit_deployment.go @@ -13,14 +13,20 @@ import ( // on a deployed ostree commit. type OSTreeDeployment struct { Base + OSVersion string osTreeCommit string osTreeURL string osTreeRef string - osName string - remote string + osName string + remote string + + KernelOptionsAppend []string + Keyboard string + Locale string + platform platform.Platform PartitionTable *disk.PartitionTable @@ -102,6 +108,8 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline { }, })) kernelOpts := osbuild.GenImageKernelOptions(p.PartitionTable) + kernelOpts = append(kernelOpts, p.KernelOptionsAppend...) + pipeline.AddStage(osbuild.NewOSTreeDeployStage( &osbuild.OSTreeDeployStageOptions{ OsName: p.osName, @@ -147,6 +155,22 @@ func (p *OSTreeDeployment) serialize() osbuild.Pipeline { } pipeline.AddStage(osbuild.NewFSTabStage(fstabOptions)) + if p.Keyboard != "" { + options := &osbuild.KeymapStageOptions{ + Keymap: p.Keyboard, + } + keymapStage := osbuild.NewKeymapStage(options) + pipeline.AddStage(keymapStage) + } + + if p.Locale != "" { + options := &osbuild.LocaleStageOptions{ + Language: p.Locale, + } + localeStage := osbuild.NewLocaleStage(options) + pipeline.AddStage(localeStage) + } + // TODO: Add users? // NOTE: Users can be embedded in a commit, but we should also support adding them at deploy time. diff --git a/test/data/manifests/fedora_35-aarch64-fedora_iot_raw_image-boot.json b/test/data/manifests/fedora_35-aarch64-fedora_iot_raw_image-boot.json index 3cf939e9f..8cc84bbce 100644 --- a/test/data/manifests/fedora_35-aarch64-fedora_iot_raw_image-boot.json +++ b/test/data/manifests/fedora_35-aarch64-fedora_iot_raw_image-boot.json @@ -1831,7 +1831,9 @@ "rootfs": { "label": "root" }, - "kernel_opts": [] + "kernel_opts": [ + "modprobe.blacklist=vc4" + ] } }, { @@ -1891,6 +1893,18 @@ } } }, + { + "type": "org.osbuild.keymap", + "options": { + "keymap": "us" + } + }, + { + "type": "org.osbuild.locale", + "options": { + "language": "C.UTF-8" + } + }, { "type": "org.osbuild.grub2", "options": { diff --git a/test/data/manifests/fedora_35-x86_64-fedora_iot_raw_image-boot.json b/test/data/manifests/fedora_35-x86_64-fedora_iot_raw_image-boot.json index 42869c5cc..bcda411c1 100644 --- a/test/data/manifests/fedora_35-x86_64-fedora_iot_raw_image-boot.json +++ b/test/data/manifests/fedora_35-x86_64-fedora_iot_raw_image-boot.json @@ -1855,7 +1855,9 @@ "rootfs": { "label": "root" }, - "kernel_opts": [] + "kernel_opts": [ + "modprobe.blacklist=vc4" + ] } }, { @@ -1915,6 +1917,18 @@ } } }, + { + "type": "org.osbuild.keymap", + "options": { + "keymap": "us" + } + }, + { + "type": "org.osbuild.locale", + "options": { + "language": "C.UTF-8" + } + }, { "type": "org.osbuild.grub2", "options": { diff --git a/test/data/manifests/fedora_36-aarch64-fedora_iot_raw_image-boot.json b/test/data/manifests/fedora_36-aarch64-fedora_iot_raw_image-boot.json index ebbb98bac..0be635744 100644 --- a/test/data/manifests/fedora_36-aarch64-fedora_iot_raw_image-boot.json +++ b/test/data/manifests/fedora_36-aarch64-fedora_iot_raw_image-boot.json @@ -2079,7 +2079,9 @@ "rootfs": { "label": "root" }, - "kernel_opts": [] + "kernel_opts": [ + "modprobe.blacklist=vc4" + ] } }, { @@ -2139,6 +2141,18 @@ } } }, + { + "type": "org.osbuild.keymap", + "options": { + "keymap": "us" + } + }, + { + "type": "org.osbuild.locale", + "options": { + "language": "C.UTF-8" + } + }, { "type": "org.osbuild.grub2", "options": { diff --git a/test/data/manifests/fedora_36-x86_64-fedora_iot_raw_image-boot.json b/test/data/manifests/fedora_36-x86_64-fedora_iot_raw_image-boot.json index 5f5e9a797..34da7c2b6 100644 --- a/test/data/manifests/fedora_36-x86_64-fedora_iot_raw_image-boot.json +++ b/test/data/manifests/fedora_36-x86_64-fedora_iot_raw_image-boot.json @@ -2103,7 +2103,9 @@ "rootfs": { "label": "root" }, - "kernel_opts": [] + "kernel_opts": [ + "modprobe.blacklist=vc4" + ] } }, { @@ -2163,6 +2165,18 @@ } } }, + { + "type": "org.osbuild.keymap", + "options": { + "keymap": "us" + } + }, + { + "type": "org.osbuild.locale", + "options": { + "language": "C.UTF-8" + } + }, { "type": "org.osbuild.grub2", "options": { diff --git a/test/data/manifests/fedora_37-aarch64-fedora_iot_raw_image-boot.json b/test/data/manifests/fedora_37-aarch64-fedora_iot_raw_image-boot.json index c03525252..26bad4b90 100644 --- a/test/data/manifests/fedora_37-aarch64-fedora_iot_raw_image-boot.json +++ b/test/data/manifests/fedora_37-aarch64-fedora_iot_raw_image-boot.json @@ -2087,7 +2087,9 @@ "rootfs": { "label": "root" }, - "kernel_opts": [] + "kernel_opts": [ + "modprobe.blacklist=vc4" + ] } }, { @@ -2147,6 +2149,18 @@ } } }, + { + "type": "org.osbuild.keymap", + "options": { + "keymap": "us" + } + }, + { + "type": "org.osbuild.locale", + "options": { + "language": "C.UTF-8" + } + }, { "type": "org.osbuild.grub2", "options": { diff --git a/test/data/manifests/fedora_37-x86_64-fedora_iot_raw_image-boot.json b/test/data/manifests/fedora_37-x86_64-fedora_iot_raw_image-boot.json index 22c5a7384..db246dd2a 100644 --- a/test/data/manifests/fedora_37-x86_64-fedora_iot_raw_image-boot.json +++ b/test/data/manifests/fedora_37-x86_64-fedora_iot_raw_image-boot.json @@ -2111,7 +2111,9 @@ "rootfs": { "label": "root" }, - "kernel_opts": [] + "kernel_opts": [ + "modprobe.blacklist=vc4" + ] } }, { @@ -2171,6 +2173,18 @@ } } }, + { + "type": "org.osbuild.keymap", + "options": { + "keymap": "us" + } + }, + { + "type": "org.osbuild.locale", + "options": { + "language": "C.UTF-8" + } + }, { "type": "org.osbuild.grub2", "options": {