diff options
Diffstat (limited to 'packages/linux/compulab-pxa270_2.6.16.bb')
-rw-r--r-- | packages/linux/compulab-pxa270_2.6.16.bb | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/packages/linux/compulab-pxa270_2.6.16.bb b/packages/linux/compulab-pxa270_2.6.16.bb index 6e09281546..6064224d80 100644 --- a/packages/linux/compulab-pxa270_2.6.16.bb +++ b/packages/linux/compulab-pxa270_2.6.16.bb @@ -1,7 +1,7 @@ SECTION = "kernel" DESCRIPTION = "Linux kernel for the Compulab PXA270 system" LICENSE = "GPL" -PR = "r3" +PR = "r5" # Note, the compulab package contains a binary NAND driver that is not # EABI compatible @@ -9,7 +9,7 @@ PR = "r3" SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2 \ file://linux-2.6.16.patch;patch=1 \ file://defconfig \ - http://www.compulab.co.il/x270/download/x270-linux-drv.zip;md5sum=ac57536294406223e527367af5aefce2" + http://www.compulab.co.il/x270/download/x270-linux-drv.zip;md5sum=6b8c1bda1dd066674b7a9f614976a715" S = "${WORKDIR}/linux-2.6.16" @@ -32,25 +32,38 @@ do_deploy() { KNAME=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin install -d ${DEPLOY_DIR_IMAGE} install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${KNAME} - # Create an image file that has the size prepended (used by cm-x270 BL) - # The following can only be done on a little endian machine - # the following does not work on all computers as it requires a recent - # version of coreutils (>= 6.0). We will eventually replace the following - # with python code. - #size=$(stat --printf=%s ${KNAME}) - #size_=$(printf '\%03o'\ - #$((size & 0x000000FF))\ - #$((size>>8 & 0x000000FF))\ - #$((size>>16 & 0x000000FF))\ - #$((size>>24 & 0x000000FF))) - #size_=${size_}'\c' - #echo -e $size_ > ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.img - #cat ${KNAME} >> ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}-${DATETIME}.img } +python do_compulab_image() { + import os + import os.path + import struct + + deploy_dir = bb.data.getVar('DEPLOY_DIR_IMAGE', d, 1) + kernel_name = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGETYPE}-${MACHINE}.bin', d)) + + img_file = os.path.join(deploy_dir, 'zImage-compulab-pxa270.img') + + fo = open(img_file, 'wb') + + image_data = open(kernel_name, 'rb').read() + + # first write size into first 4 bytes + size_s = struct.pack('i', len(image_data)) + + # truncate size if we are running on a 64-bit host + size_s = size_s[:4] + + fo.write(size_s) + fo.write(image_data) + fo.close() +} + + do_deploy[dirs] = "${S}" addtask deploy before do_build after do_compile +addtask compulab_image before do_build after do_deploy COMPATIBLE_MACHINE = "compulab-pxa270" |