[oe-commits] Bruce Ashfield : kernel.bbclass: test for hardlinks before installing

git at git.openembedded.org git at git.openembedded.org
Fri Nov 15 15:26:48 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 6a3b3e501c66733216ac43d3f020cfdb512dd640
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=6a3b3e501c66733216ac43d3f020cfdb512dd640

Author: Bruce Ashfield <bruce.ashfield at windriver.com>
Date:   Thu Nov 14 11:55:26 2013 -0500

kernel.bbclass: test for hardlinks before installing

commit df564c4 [kernel: Use hardlinks for do_populate_sysroot for speed]
does indeed speed up the build, but it also means that the KERNEL_OUPUT
and KERNEL_IMAGETYPE may be hardlinks.

If they are hardlinks, install complains that they are actually the same
file and stops the build. We can easily test and avoid the copy if the
file is already in place.

[YOCTO #5527]

Signed-off-by: Bruce Ashfield <bruce.ashfield at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/kernel.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 383043e..624b151 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -244,7 +244,11 @@ kernel_do_install() {
 		find . -depth -not -path "./Documentation*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir
 		cd "$pwd"
 	fi
-	install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
+
+	# Test to ensure that the output file and image type are not actually
+	# the same file. If hardlinking is used, they will be the same, and there's
+	# no need to install.
+	![ ${KERNEL_OUTPUT} -ef $kerneldir/${KERNEL_IMAGETYPE} ] && install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
 	install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
 
 	# Dummy Makefile so the clean below works



More information about the Openembedded-commits mailing list