summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-08 15:17:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-12 10:34:08 +0000
commit5e73287ad88837c6fea9d03bb1af81a1f83e89cc (patch)
treef6b2daa969c1a87b563bca6417beab1c4c1132f1 /meta/classes
parent4fdc3d77d4a875b7236536bf78849a4d1f6a7449 (diff)
downloadpoky-5e73287ad88837c6fea9d03bb1af81a1f83e89cc.tar.gz
kernel: Use hardlinks during do_install for speed
Whilst the comment says we can't do this, its incorrect, install operates on WORKDIR and its hard for different parts of WORKDIR to be on different filesystems. Hardlinking instead of copying is therefore a nice performance gain. Also, completely skip the Documentation directory (adding a dummy Makefile to keep make happy) and tweak the other cp commands to link since if we don't we'd get "this is the same file" type errors from cp for some kernel versions. For do_install on linux-yocto, this takes it from 227s -> 84s. (From OE-Core rev: 0727e510f8533216518563b1533e804a1dc44402) (From OE-Core rev: f6e98af6b9f6729bb61f17e3b4203c3c79829205) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel.bbclass18
1 files changed, 9 insertions, 9 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a4db9f5375..8d4a733f54 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -236,20 +236,21 @@ kernel_do_install() {
236 # dir. This ensures the original Makefiles are used and not the 236 # dir. This ensures the original Makefiles are used and not the
237 # redirecting Makefiles in the build directory. 237 # redirecting Makefiles in the build directory.
238 # 238 #
239 # work and sysroots can be on different partitions, so we can't rely on 239 find . -depth -not -name "*.cmd" -not -name "*.o" -not -path "./Documentation*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir
240 # hardlinking, unfortunately.
241 #
242 find . -depth -not -name "*.cmd" -not -name "*.o" -not -path "./.*" -print0 | cpio --null -pdu $kerneldir
243 cp .config $kerneldir 240 cp .config $kerneldir
244 if [ "${S}" != "${B}" ]; then 241 if [ "${S}" != "${B}" ]; then
245 pwd="$PWD" 242 pwd="$PWD"
246 cd "${S}" 243 cd "${S}"
247 find . -depth -not -path "./.*" -print0 | cpio --null -pdu $kerneldir 244 find . -depth -not -path "./Documentation*" -not -path "./.*" -print0 | cpio --null -pdlu $kerneldir
248 cd "$pwd" 245 cd "$pwd"
249 fi 246 fi
250 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} 247 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
251 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} 248 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}
252 249
250 # Dummy Makefile so the clean below works
251 mkdir $kerneldir/Documentation
252 touch $kerneldir/Documentation/Makefile
253
253 # 254 #
254 # Clean and remove files not needed for building modules. 255 # Clean and remove files not needed for building modules.
255 # Some distributions go through a lot more trouble to strip out 256 # Some distributions go through a lot more trouble to strip out
@@ -262,22 +263,21 @@ kernel_do_install() {
262 oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean 263 oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean
263 make -C $kerneldir _mrproper_scripts 264 make -C $kerneldir _mrproper_scripts
264 find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \; 265 find $kerneldir -path $kerneldir/lib -prune -o -path $kerneldir/tools -prune -o -path $kerneldir/scripts -prune -o -name "*.[csS]" -exec rm '{}' \;
265 find $kerneldir/Documentation -name "*.txt" -exec rm '{}' \;
266 266
267 # As of Linux kernel version 3.0.1, the clean target removes 267 # As of Linux kernel version 3.0.1, the clean target removes
268 # arch/powerpc/lib/crtsavres.o which is present in 268 # arch/powerpc/lib/crtsavres.o which is present in
269 # KBUILD_LDFLAGS_MODULE, making it required to build external modules. 269 # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
270 if [ ${ARCH} = "powerpc" ]; then 270 if [ ${ARCH} = "powerpc" ]; then
271 cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o 271 cp -l arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
272 fi 272 fi
273 273
274 # Necessary for building modules like compat-wireless. 274 # Necessary for building modules like compat-wireless.
275 if [ -f include/generated/bounds.h ]; then 275 if [ -f include/generated/bounds.h ]; then
276 cp include/generated/bounds.h $kerneldir/include/generated/bounds.h 276 cp -l include/generated/bounds.h $kerneldir/include/generated/bounds.h
277 fi 277 fi
278 if [ -d arch/${ARCH}/include/generated ]; then 278 if [ -d arch/${ARCH}/include/generated ]; then
279 mkdir -p $kerneldir/arch/${ARCH}/include/generated/ 279 mkdir -p $kerneldir/arch/${ARCH}/include/generated/
280 cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/ 280 cp -flR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
281 fi 281 fi
282 282
283 # Remove the following binaries which cause strip or arch QA errors 283 # Remove the following binaries which cause strip or arch QA errors