]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel.bbclass: test for hardlinks before installing
authorBruce Ashfield <bruce.ashfield@windriver.com>
Thu, 14 Nov 2013 16:55:26 +0000 (11:55 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Nov 2013 15:27:02 +0000 (15:27 +0000)
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@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/kernel.bbclass

index 383043ed9c726e8a284e56ccb0bb531331469286..624b15101edc70d84717d674e5bb3646fa6ce07b 100644 (file)
@@ -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