From 6f4d06897bb746f64e6ec6c2d6d67aba5ff93416 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Mon, 20 May 2019 13:18:48 +0200 Subject: Split grub_efi class override Split the class override into generic changes and Secure Boot specific (efi_populate). This allows us to override the secureboot parts only if the efi-secure-boot distro feature is enabled. Change-Id: I68ab1a9eae2ffceecd057506ef493b4388ff5343 Signed-off-by: Adrian Dudau --- classes/override_grub-efi_secureboot.inc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 classes/override_grub-efi_secureboot.inc (limited to 'classes/override_grub-efi_secureboot.inc') diff --git a/classes/override_grub-efi_secureboot.inc b/classes/override_grub-efi_secureboot.inc new file mode 100644 index 0000000..a33c1a8 --- /dev/null +++ b/classes/override_grub-efi_secureboot.inc @@ -0,0 +1,27 @@ +efi_populate() { + # DEST must be the root of the image so that EFIDIR is not + # nested under a top level directory. + DEST=$1 + + install -d ${DEST}${EFIDIR} + + GRUB_IMAGE="grub-efi-bootia32.efi" + DEST_IMAGE="bootia32.efi" + if [ "${TARGET_ARCH}" = "x86_64" ]; then + GRUB_IMAGE="grub-efi-bootx64.efi" + DEST_IMAGE="bootx64.efi" + fi + + #Install EFI binaries + install -m 0644 ${IMAGE_ROOTFS}/boot/efi${EFIDIR}/*.* ${DEST}${EFIDIR} + + #Install kernel and initramfs sig + install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}.p7b ${DEST}/vmlinuz.p7b + install -m 0644 ${INITRD_LIVE}.p7b ${DEST}/initrd.p7b + + EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g') + printf 'fs0:%s\%s\n' "$EFIPATH" "$DEST_IMAGE" >${DEST}/startup.nsh + + install -m 0644 ${GRUB_CFG} ${DEST}${EFIDIR}/grub.cfg + +} -- cgit v1.2.3-54-g00ecf