From 6b5219b8034c9ffd3094657486e500119ad47325 Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Thu, 28 Jul 2016 12:25:28 -0700 Subject: intel-corei7-64: fix race in image generation Prepending to IMAGE_CMD_ext3 in order to push files into the rootfs is flaky for a couple of reasons. First, it is conceptually inconsistent with the rest of the build system - files that go into the rootfs should really by installed by packages through the regular mechanisms. Second, and what prompted this patch, with several concurrent image generation tasks this is just unsafe. I regularly experienced .tgz image generation failures, as tar complained that the files changed from under it. Since this is related to the grub-efi packaging on this particular device, just package the microcode into the required initramfs in that recipe. Change-Id: I4e037ddbb017d1764852310b0b77900cde260dd6 Reviewed-by: Gatis Paeglis --- meta-intel-extras/classes/image_dd_efi.bbclass | 9 --------- meta-intel-extras/recipes/grub/grub-efi_2.00.bbappend | 13 ++++++++++++- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'meta-intel-extras') diff --git a/meta-intel-extras/classes/image_dd_efi.bbclass b/meta-intel-extras/classes/image_dd_efi.bbclass index 9cb2075..1f5fd9f 100644 --- a/meta-intel-extras/classes/image_dd_efi.bbclass +++ b/meta-intel-extras/classes/image_dd_efi.bbclass @@ -33,15 +33,6 @@ LICENSE = "CLOSED" inherit image_dd EXTRA_IMAGECMD_ext3 += "-L rootfs" -IMAGE_DEPENDS_ext3 += "initramfs-basic:do_rootfs" - -IMAGE_CMD_ext3_prepend() { - - # https://www.kernel.org/doc/Documentation/x86/early-microcode.txt - microcode="${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}" - cat ${microcode} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz > ${IMAGE_ROOTFS}/boot/initramfs - chmod 0644 ${IMAGE_ROOTFS}/boot/initramfs -} do_populate_boot() { diff --git a/meta-intel-extras/recipes/grub/grub-efi_2.00.bbappend b/meta-intel-extras/recipes/grub/grub-efi_2.00.bbappend index 8a223fe..0104aab 100644 --- a/meta-intel-extras/recipes/grub/grub-efi_2.00.bbappend +++ b/meta-intel-extras/recipes/grub/grub-efi_2.00.bbappend @@ -30,6 +30,12 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://grub.cfg" +do_install[depends] += " \ + virtual/kernel:do_deploy \ + ${INITRAMFS_IMAGE}:do_rootfs \ + ${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', 'intel-microcode:do_deploy', '', d)} \ +" + do_deploy_prepend() { cat > ${WORKDIR}/cfg < ${D}/boot/initramfs + chmod 0644 ${D}/boot/initramfs } PACKAGES += "${PN}-config" -FILES_${PN}-config = "/boot/grub2/" +FILES_${PN}-config = "/boot/grub2/ /boot/initramfs" -- cgit v1.2.3-54-g00ecf