diff --git a/internal/distro/rhel9/images.go b/internal/distro/rhel9/images.go index 1f1694339..006afc008 100644 --- a/internal/distro/rhel9/images.go +++ b/internal/distro/rhel9/images.go @@ -73,6 +73,9 @@ func osCustomizations( osc.Keyboard = keyboard } else if imageConfig.Keyboard != nil { osc.Keyboard = &imageConfig.Keyboard.Keymap + if imageConfig.Keyboard.X11Keymap != nil { + osc.X11KeymapLayouts = imageConfig.Keyboard.X11Keymap.Layouts + } } if hostname := c.GetHostname(); hostname != nil { diff --git a/internal/manifest/os.go b/internal/manifest/os.go index 8016d4a67..e91c7db97 100644 --- a/internal/manifest/os.go +++ b/internal/manifest/os.go @@ -45,6 +45,7 @@ type OSCustomizations struct { GPGKeyFiles []string Language string Keyboard *string + X11KeymapLayouts []string Hostname string Timezone string EnabledServices []string @@ -256,7 +257,11 @@ func (p *OS) serialize() osbuild.Pipeline { pipeline.AddStage(osbuild.NewLocaleStage(&osbuild.LocaleStageOptions{Language: p.Language})) if p.Keyboard != nil { - pipeline.AddStage(osbuild.NewKeymapStage(&osbuild.KeymapStageOptions{Keymap: *p.Keyboard})) + keymapOptions := &osbuild.KeymapStageOptions{Keymap: *p.Keyboard} + if len(p.X11KeymapLayouts) > 0 { + keymapOptions.X11Keymap = &osbuild.X11KeymapOptions{Layouts: p.X11KeymapLayouts} + } + pipeline.AddStage(osbuild.NewKeymapStage(keymapOptions)) } if p.Hostname != "" {