chore(efibootguard): better handling of efibootguard related variables

Default value related to efibootguard are not set inside the distro
and MACHINE that use coreos-image and doesn't define EFI as a
MACHINE_FEATURE doesn't get the efibootguard-tools package.
This commit is contained in:
Samuel Dolt 2023-02-02 11:47:06 +01:00
parent b4e480e15d
commit e02d4b95f8
4 changed files with 13 additions and 7 deletions

View File

@ -2,8 +2,6 @@
# ============================================================================== # ==============================================================================
MACHINE_FEATURES:append = " efi" MACHINE_FEATURES:append = " efi"
EFI_PROVIDER = "efibootguard"
EFIBOOTGUARD_TIMEOUT ?= "60"
do_image_wic[depends] += "efibootguard-native:do_populate_sysroot efibootguard:do_deploy" do_image_wic[depends] += "efibootguard-native:do_populate_sysroot efibootguard:do_deploy"

View File

@ -45,9 +45,10 @@ def get_coreos_ci_artifacts(d):
# Bootloaders # Bootloaders
# ========================================================================== # ==========================================================================
if(d.getVar('EFI_PROVIDER') == 'efibootguard'): if('efi' in d.getVar('MACHINE_FEATURES', ''):
efi_arch = d.getVar('EFI_ARCH') if(d.getVar('EFI_PROVIDER', "") == 'efibootguard'):
artifacts.append('efibootguard' + efi_arch + '.efi') efi_arch = d.getVar('EFI_ARCH')
artifacts.append('efibootguard' + efi_arch + '.efi')
# Machine specific files # Machine specific files
# ========================================================================== # ==========================================================================

View File

@ -64,11 +64,16 @@ PACKAGE_EXCLUDE_COMPLEMENTARY:append = "${@bb.utils.contains_any('PACKAGE_INSTAL
# IMAGE_FEATURES_CONFLICTS_foo = 'bar1 bar2' # IMAGE_FEATURES_CONFLICTS_foo = 'bar1 bar2'
# An error exception would be raised if both image features foo and bar1(or bar2) are included # An error exception would be raised if both image features foo and bar1(or bar2) are included
# packagegroup-core-boot will install the EFI_PROVIDER package if EFI is in Machine
# feature. We use this variable to install more EFI related tools
COREOS_IMAGE_EFI_PROVIDER_EXTRA = " \
${@'efibootguard-tools' if d.getVar('EFI_PROVIDER') == 'efibootguard' else ''} \
"
COREOS_IMAGE_BASE_INSTALL = "\ COREOS_IMAGE_BASE_INSTALL = "\
packagegroup-core-boot \ packagegroup-core-boot \
packagegroup-base-extended \ packagegroup-base-extended \
${@'efibootguard-tools' if d.getVar('EFI_PROVIDER') == 'efibootguard' else ''} \ ${@bb.utils.contains("MACHINE_FEATURES", "efi", "${COREOS_IMAGE_EFI_PROVIDER_EXTRA}", "", d)} \
os-release \ os-release \
" "

View File

@ -58,9 +58,11 @@ SDK_VERSION[vardepvalue] = "${SDK_VERSION}"
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}" SDK_NAME = "${DISTRO}-${TCLIBC}-${SDKMACHINE}-${IMAGE_BASENAME}-${TUNE_PKGARCH}-${MACHINE}"
SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}" SDKPATHINSTALL = "/opt/${DISTRO}/${SDK_VERSION}"
# Secure boot # EFI and Secure boot
# ============================================================================== # ==============================================================================
EFI_PROVIDER = "efibootguard"
EFIBOOTGUARD_TIMEOUT ??= "60"
INHERIT += "coreos-efi-secureboot" INHERIT += "coreos-efi-secureboot"
# Virtualization configuration # Virtualization configuration