diff options
author | Louai Al-Khanji <louai.al-khanji@qt.io> | 2016-07-28 12:25:28 -0700 |
---|---|---|
committer | Louai Al-Khanji <louai.al-khanji@qt.io> | 2016-07-29 15:42:40 +0000 |
commit | 6b5219b8034c9ffd3094657486e500119ad47325 (patch) | |
tree | fdf106cce1392c4cb73286c8d4df877f90b4836e /meta-intel-extras | |
parent | 0409e66022fb4cec06de10c355a7ab9c59aae945 (diff) | |
download | meta-boot2qt-6b5219b8034c9ffd3094657486e500119ad47325.tar.gz |
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 <gatis.paeglis@qt.io>
Diffstat (limited to 'meta-intel-extras')
-rw-r--r-- | meta-intel-extras/classes/image_dd_efi.bbclass | 9 | ||||
-rw-r--r-- | meta-intel-extras/recipes/grub/grub-efi_2.00.bbappend | 13 |
2 files changed, 12 insertions, 10 deletions
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" | |||
33 | inherit image_dd | 33 | inherit image_dd |
34 | 34 | ||
35 | EXTRA_IMAGECMD_ext3 += "-L rootfs" | 35 | EXTRA_IMAGECMD_ext3 += "-L rootfs" |
36 | IMAGE_DEPENDS_ext3 += "initramfs-basic:do_rootfs" | ||
37 | |||
38 | IMAGE_CMD_ext3_prepend() { | ||
39 | |||
40 | # https://www.kernel.org/doc/Documentation/x86/early-microcode.txt | ||
41 | microcode="${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}" | ||
42 | cat ${microcode} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz > ${IMAGE_ROOTFS}/boot/initramfs | ||
43 | chmod 0644 ${IMAGE_ROOTFS}/boot/initramfs | ||
44 | } | ||
45 | 36 | ||
46 | do_populate_boot() { | 37 | do_populate_boot() { |
47 | 38 | ||
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 @@ | |||
30 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | 30 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" |
31 | SRC_URI += "file://grub.cfg" | 31 | SRC_URI += "file://grub.cfg" |
32 | 32 | ||
33 | do_install[depends] += " \ | ||
34 | virtual/kernel:do_deploy \ | ||
35 | ${INITRAMFS_IMAGE}:do_rootfs \ | ||
36 | ${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', 'intel-microcode:do_deploy', '', d)} \ | ||
37 | " | ||
38 | |||
33 | do_deploy_prepend() { | 39 | do_deploy_prepend() { |
34 | 40 | ||
35 | cat > ${WORKDIR}/cfg <<EOF | 41 | cat > ${WORKDIR}/cfg <<EOF |
@@ -42,7 +48,12 @@ do_install_append() { | |||
42 | 48 | ||
43 | install -d ${D}/boot/grub2/ | 49 | install -d ${D}/boot/grub2/ |
44 | install -m 644 ${WORKDIR}/grub.cfg ${D}/boot/grub2/ | 50 | install -m 644 ${WORKDIR}/grub.cfg ${D}/boot/grub2/ |
51 | |||
52 | # https://www.kernel.org/doc/Documentation/x86/early-microcode.txt | ||
53 | microcode="${@bb.utils.contains('MACHINE_FEATURES', 'intel-ucode', '${DEPLOY_DIR_IMAGE}/microcode.cpio ', '', d)}" | ||
54 | cat ${microcode} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.cpio.gz > ${D}/boot/initramfs | ||
55 | chmod 0644 ${D}/boot/initramfs | ||
45 | } | 56 | } |
46 | 57 | ||
47 | PACKAGES += "${PN}-config" | 58 | PACKAGES += "${PN}-config" |
48 | FILES_${PN}-config = "/boot/grub2/" | 59 | FILES_${PN}-config = "/boot/grub2/ /boot/initramfs" |