diff --git a/shared/templates/grub2_bootloader_argument/oval.template b/shared/templates/grub2_bootloader_argument/oval.template index 63478873a01..374aca885a1 100644 --- a/shared/templates/grub2_bootloader_argument/oval.template +++ b/shared/templates/grub2_bootloader_argument/oval.template @@ -9,6 +9,7 @@ {{% set system_with_referenced_kernel_options_in_loader_entries = false -%}} {{% set system_with_kernel_options_in_grubenv = false -%}} {{% set system_with_kernel_options_in_etc_default_grub = true -%}} +{{% set system_with_kernel_options_in_etc_default_grub_d = false -%}} {{% set system_with_expanded_kernel_options_in_grub_cfg = false -%}} {{% set system_with_bios_and_uefi_support = false -%}} @@ -25,6 +26,10 @@ {{% set system_with_expanded_kernel_options_in_grub_cfg = true %}} {{%- endif -%}} +{{% if 'ubuntu' in product -%}} +{{% set system_with_kernel_options_in_etc_default_grub_d = true -%}} +{{%- endif -%}} + {{% if grub2_uefi_boot_path and grub2_uefi_boot_path != grub2_boot_path -%}} {{% set system_with_bios_and_uefi_support = true %}} {{%- endif -%}} @@ -66,11 +71,23 @@ {{%- endif %}} {{% if system_with_kernel_options_in_etc_default_grub -%}} - + + + {{% if system_with_kernel_options_in_etc_default_grub_d -%}} + + {{%- endif %}} + - + + + {{% if system_with_kernel_options_in_etc_default_grub_d -%}} + + {{%- endif %}} + @@ -88,11 +105,7 @@ - {{%- if 'ubuntu' in product %}} - ^/etc/default/grub(\.d/[^/]+\.cfg)?$ - {{%- else %}} /etc/default/grub - {{%- endif %}} ^\s*GRUB_CMDLINE_LINUX="(.*)"$ 1 @@ -106,11 +119,36 @@ - {{%- if 'ubuntu' in product %}} - ^/etc/default/grub(\.d/[^/]+\.cfg)?$ - {{%- else %}} /etc/default/grub - {{%- endif %}} + ^\s*GRUB_CMDLINE_LINUX_DEFAULT="(.*)"$ + 1 + +{{%- endif %}} + +{{% if system_with_kernel_options_in_etc_default_grub_d -%}} + + + + + + + + + + + + /etc/default/grub.d/*.cfg + ^\s*GRUB_CMDLINE_LINUX="(.*)"$ + 1 + + + + /etc/default/grub.d/*.cfg ^\s*GRUB_CMDLINE_LINUX_DEFAULT="(.*)"$ 1 diff --git a/shared/templates/grub2_bootloader_argument/tests/correct_value_configdir.pass.sh b/shared/templates/grub2_bootloader_argument/tests/correct_value_configdir.pass.sh index 734142a4e3a..4a74b29a467 100644 --- a/shared/templates/grub2_bootloader_argument/tests/correct_value_configdir.pass.sh +++ b/shared/templates/grub2_bootloader_argument/tests/correct_value_configdir.pass.sh @@ -10,7 +10,7 @@ source common.sh -echo > /etc/default/grub +echo "GRUB_CMDLINE_LINUX=\"\"" > /etc/default/grub rm -f /etc/default/grub.d/* echo "GRUB_CMDLINE_LINUX=\"\$GRUB_CMDLINE_LINUX {{{ ARG_NAME_VALUE }}}\"" > /etc/default/grub.d/custom.cfg