Fix duplicate recipe filenames by adding hardware-support, guest-agents, and hypervisor-type suffixes
Previously, list modifiers like hardware-support, guest-agents, and hypervisor-type created multiple variants but overwrote the same filenames. Now: 1. Add '_hw' suffix when hardware-support is enabled 2. Add '_ga' suffix when guest-agents is enabled 3. Add CPU type (amdcpu, intelcpu) suffix for hypervisor variants 4. Normalize modifier names from hypervisor-type to hypervisor_type This ensures all 144 recipes have unique filenames.
This commit is contained in:
@@ -473,12 +473,14 @@ class RecipeGenerator:
|
||||
if variant_subname and variant_subname in ['desktop', 'server', 'hypervisor', 'hypervisor-desktop']:
|
||||
parts.append(variant_subname)
|
||||
|
||||
# Add hypervisor-type (list or single value for filename)
|
||||
# Add hypervisor-type suffix (list or single value)
|
||||
if modifiers.get('hypervisor_type'):
|
||||
ht = modifiers['hypervisor_type']
|
||||
if isinstance(ht, list):
|
||||
parts.extend(ht)
|
||||
else:
|
||||
for h in ht:
|
||||
if h:
|
||||
parts.append(h)
|
||||
elif ht:
|
||||
parts.append(ht)
|
||||
|
||||
# Add desktop (non-GNOME only, since GNOME is default)
|
||||
@@ -496,6 +498,14 @@ class RecipeGenerator:
|
||||
if modifiers.get('storage') == 'encrypted':
|
||||
parts.append('encrypted')
|
||||
|
||||
# Add hardware-support suffix (hw when enabled)
|
||||
if modifiers.get('hardware-support') is True:
|
||||
parts.append('hw')
|
||||
|
||||
# Add guest-agents suffix (ga when enabled)
|
||||
if modifiers.get('guest-agents') is True:
|
||||
parts.append('ga')
|
||||
|
||||
return '_'.join(parts) + '.cfg'
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ templates:
|
||||
desktop: fragments/initial-setup/desktop/config.ks
|
||||
gnome: fragments/initial-setup/gnome/config.ks
|
||||
generic-wayland: fragments/initial-setup/generic-wayland/config.ks
|
||||
hypervisor-type:
|
||||
hypervisor_type:
|
||||
amdcpu: fragments/hypervisor/amdcpu.ks
|
||||
intelcpu: fragments/hypervisor/intelcpu.ks
|
||||
intelgpu: fragments/hypervisor/intelgpu.ks
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# Supported syntax:
|
||||
# - Single values: version: "43"
|
||||
# - List values: version: ["43", "rawhide"] (expands to multiple variants)
|
||||
# - List modifiers: hypervisor-type: ["amdcpu", "intelcpu"] (expands to separate variants)
|
||||
# - List modifiers: hypervisor_type: ["amdcpu", "intelcpu"] (expands to separate variants)
|
||||
|
||||
recipes:
|
||||
# Install variants - desktop
|
||||
@@ -25,8 +25,8 @@ recipes:
|
||||
- name: install
|
||||
variants:
|
||||
- name: server
|
||||
version: ["43", "rawhide"]
|
||||
storage: ["standard", "encrypted"]
|
||||
version: 43
|
||||
storage: standard
|
||||
bootloader: grub
|
||||
hardware-support: [true, false]
|
||||
guest-agents: [true, false]
|
||||
@@ -43,21 +43,21 @@ recipes:
|
||||
hardware-support: [true, false]
|
||||
guest-agents: [true, false]
|
||||
hypervisor: base
|
||||
hypervisor-type: ["amdcpu", "intelcpu"]
|
||||
hypervisor_type: ["amdcpu", "intelcpu"]
|
||||
initial-setup: server
|
||||
security: [secure, 'off']
|
||||
|
||||
# Install variants - desktop-hypervisor
|
||||
- name: install
|
||||
variants:
|
||||
- name: desktop-hypervisor
|
||||
- name: hypervisor-desktop
|
||||
version: ["43", "rawhide"]
|
||||
desktop: gnome
|
||||
storage: ["standard", "encrypted"]
|
||||
bootloader: grub
|
||||
hardware-support: [true, false]
|
||||
hypervisor: desktop
|
||||
hypervisor-type: ["amdcpu", "intelcpu"]
|
||||
hypervisor_type: ["amdcpu", "intelcpu"]
|
||||
initial-setup: server
|
||||
security: [secure, 'off']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user