summaryrefslogtreecommitdiff
path: root/classes/kernel.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/kernel.bbclass')
-rw-r--r--classes/kernel.bbclass39
1 files changed, 20 insertions, 19 deletions
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index c00d0f3f58..f896492364 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -80,25 +80,12 @@ kernel_do_stage() {
mkdir -p ${STAGING_KERNEL_DIR}/include/pcmcia
cp -fR include/pcmcia/* ${STAGING_KERNEL_DIR}/include/pcmcia/
- if [ -d drivers/crypto ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/drivers/crypto
- cp -fR drivers/crypto/* ${STAGING_KERNEL_DIR}/drivers/crypto/
- fi
-
- if [ -d include/media ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/include/media
- cp -fR include/media/* ${STAGING_KERNEL_DIR}/include/media/
- fi
-
- if [ -d include/acpi ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/include/acpi
- cp -fR include/acpi/* ${STAGING_KERNEL_DIR}/include/acpi/
- fi
-
- if [ -d include/sound ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/include/sound
- cp -fR include/sound/* ${STAGING_KERNEL_DIR}/include/sound/
- fi
+ for entry in drivers/crypto include/media include/acpi include/sound include/video; do
+ if [ -d $entry ]; then
+ mkdir -p ${STAGING_KERNEL_DIR}/$entry
+ cp -fR $entry/* ${STAGING_KERNEL_DIR}/$entry/
+ fi
+ done
if [ -d drivers/sound ]; then
# 2.4 alsa needs some headers from this directory
@@ -418,3 +405,17 @@ python populate_packages_prepend () {
packages.append(metapkg)
bb.data.setVar('PACKAGES', ' '.join(packages), d)
}
+
+# Support checking the kernel size since some kernels need to reside in partitions
+# with a fixed length or there is a limit in transferring the kernel to memory
+do_sizecheck() {
+ if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
+ size=`ls -l arch/${ARCH}/boot/${KERNEL_IMAGETYPE} | awk '{ print $5}'`
+ if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+ rm arch/${ARCH}/boot/${KERNEL_IMAGETYPE}
+ die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular."
+ fi
+ fi
+}
+
+addtask sizecheck before do_install after do_compile