Skip to content
Snippets Groups Projects
Commit 6b5219b8 authored by Louai Al-Khanji's avatar Louai Al-Khanji
Browse files

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: default avatarGatis Paeglis <gatis.paeglis@qt.io>
parent 0409e660
No related branches found
No related tags found
No related merge requests found
......@@ -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() {
......
......@@ -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 <<EOF
......@@ -42,7 +48,12 @@ do_install_append() {
install -d ${D}/boot/grub2/
install -m 644 ${WORKDIR}/grub.cfg ${D}/boot/grub2/
# 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 > ${D}/boot/initramfs
chmod 0644 ${D}/boot/initramfs
}
PACKAGES += "${PN}-config"
FILES_${PN}-config = "/boot/grub2/"
FILES_${PN}-config = "/boot/grub2/ /boot/initramfs"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment