summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2013-01-31 13:31:03 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-01 15:54:00 +0000
commitdbfa6f9563cb79a9c3db4a0f0c8c503fa3b3f29f (patch)
treec6af9f94f084e3776cd1613948bcf5ffff866c1a /meta/classes/kernel.bbclass
parent4a4049b2fb4ade9d0bdb9354271534066a601411 (diff)
downloadpoky-dbfa6f9563cb79a9c3db4a0f0c8c503fa3b3f29f.tar.gz
kernel: avoid copying unnecessary files during do_install
kernel_do_install() populates $kerneldir with files needed to build external modules. To accomplish this there are several copy commands to get source from the kernel source tree and build trees after which a 'clean' is performed. Since we are copying from the build tree we get about 1G of .o and .cmd files copied over only to have them removed when we clean. This adds additional IO overhead as well as overhead caused by pseudo. By avoiding copying these files in the first place we get multiple gains: * avoid initial copy * avoid file deletes during clean * reduce pseudo overhead Additionally we are making use of cpio vs cp which tends to be significantly faster at performing copies. With these changes I observe a 15-30% decrease in the time to complete the do_install() operation on the kernel. [YOCTO #3517] (From OE-Core rev: c753f9d59f4d0a5af4ea5deb6e2b9609e05314e2) Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r--meta/classes/kernel.bbclass7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index e2a582b9e9..cc61be6f18 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -143,10 +143,13 @@ kernel_do_install() {
143 # work and sysroots can be on different partitions, so we can't rely on 143 # work and sysroots can be on different partitions, so we can't rely on
144 # hardlinking, unfortunately. 144 # hardlinking, unfortunately.
145 # 145 #
146 cp -fR * $kerneldir 146 find . -depth -not -name "*.cmd" -not -name "*.o" -not -path "./.*" -print0 | cpio --null -pdu $kerneldir
147 cp .config $kerneldir 147 cp .config $kerneldir
148 if [ "${S}" != "${B}" ]; then 148 if [ "${S}" != "${B}" ]; then
149 cp -fR ${S}/* $kerneldir 149 pwd="$PWD"
150 cd "${S}"
151 find . -depth -not -path "./.*" -print0 | cpio --null -pdu $kerneldir
152 cd "$pwd"
150 fi 153 fi
151 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE} 154 install -m 0644 ${KERNEL_OUTPUT} $kerneldir/${KERNEL_IMAGETYPE}
152 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION} 155 install -m 0644 System.map $kerneldir/System.map-${KERNEL_VERSION}