diff options
author | Mike Crowe <mac@mcrowe.com> | 2013-11-22 14:23:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-24 12:48:39 +0000 |
commit | 97af6e46da2698c66acd64fe925377bcc7e9e32c (patch) | |
tree | 1bd5f4e941d45bb7e857b9a47648188730957219 /meta/classes/kernel.bbclass | |
parent | 3c9d11bf7f76b736b01c9b5632d6ea7ade5582e1 (diff) | |
download | poky-97af6e46da2698c66acd64fe925377bcc7e9e32c.tar.gz |
kernel.bbclass: Stop bundle_initramfs thwarting sstate cache and fix race
The new do_bundle_initramfs task introduced in
609d5a9ab9e58bb1c2bcc2145399fbc8b701b85a defeats using the sstate
cache. The kernel is resurrected from the sstate cache but ends up being
built again since do_bundle_initramfs depends on do_compile.
The task is no longer nostamp to avoid causing unnecessary rebuilds. The
sstate checksum stamps should know when to rebuild.
The task now runs before do_deploy and part of the work has been moved to
do_deploy where it now writes to ${DEPLOYDIR} rather than
${DEPLOY_DIR_IMAGE} so that the files end up in sstate.
The task can also race against do_install since both call into the kernel
build system. This is fixed by making do_bundle_initramfs run after
do_install (which therefore also fixes the problem that
3baa63b4d588c3262254528b406ede265dd117bf was addressing.)
(From OE-Core master rev: 55989cb509340bd265d0ce0d8bfe849681be4616)
(From OE-Core rev: e64d2a6d408ac542bdaa42680d10d0fb05b92a60)
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r-- | meta/classes/kernel.bbclass | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index 1374e68d1a..e639bd57b9 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -134,25 +134,14 @@ do_bundle_initramfs () { | |||
134 | echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs" | 134 | echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs" |
135 | install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin | 135 | install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin |
136 | echo "${B}/${KERNEL_OUTPUT}.initramfs" | 136 | echo "${B}/${KERNEL_OUTPUT}.initramfs" |
137 | cd ${B} | ||
138 | # Update deploy directory | ||
139 | if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then | ||
140 | echo "Copying deploy kernel-initramfs image and setting up links..." | ||
141 | initramfs_base_name=${INITRAMFS_BASE_NAME} | ||
142 | initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} | ||
143 | install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOY_DIR_IMAGE}/${initramfs_base_name}.bin | ||
144 | cd ${DEPLOY_DIR_IMAGE} | ||
145 | ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin | ||
146 | fi | ||
147 | fi | 137 | fi |
148 | } | 138 | } |
149 | do_bundle_initramfs[nostamp] = "1" | ||
150 | 139 | ||
151 | python do_devshell_prepend () { | 140 | python do_devshell_prepend () { |
152 | os.environ["LDFLAGS"] = '' | 141 | os.environ["LDFLAGS"] = '' |
153 | } | 142 | } |
154 | 143 | ||
155 | addtask bundle_initramfs after do_compile before do_build | 144 | addtask bundle_initramfs after do_install before do_deploy |
156 | 145 | ||
157 | kernel_do_compile() { | 146 | kernel_do_compile() { |
158 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE | 147 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE |
@@ -464,6 +453,17 @@ kernel_do_deploy() { | |||
464 | ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE} | 453 | ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE} |
465 | 454 | ||
466 | cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt | 455 | cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt |
456 | |||
457 | cd ${B} | ||
458 | # Update deploy directory | ||
459 | if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then | ||
460 | echo "Copying deploy kernel-initramfs image and setting up links..." | ||
461 | initramfs_base_name=${INITRAMFS_BASE_NAME} | ||
462 | initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE} | ||
463 | install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin | ||
464 | cd ${DEPLOYDIR} | ||
465 | ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin | ||
466 | fi | ||
467 | } | 467 | } |
468 | do_deploy[dirs] = "${DEPLOYDIR} ${B}" | 468 | do_deploy[dirs] = "${DEPLOYDIR} ${B}" |
469 | do_deploy[prefuncs] += "package_get_auto_pr" | 469 | do_deploy[prefuncs] += "package_get_auto_pr" |