linux-2.6.24: fix kernel oops upon driver unload for hipox machine
[openembedded.git] / recipes / linux / compulab-pxa270_2.6.16.bb
1 SECTION = "kernel"
2 DESCRIPTION = "Linux kernel for the Compulab PXA270 system"
3 LICENSE = "GPL"
4 PR = "r6"
5 do_unpack[depends] += "unzip-native:do_populate_staging"
6
7 # Note, the compulab package contains a binary NAND driver that is not
8 # EABI compatible
9 # if you get a md5 sum error on x270-linux-drv.zip, compulab has probably
10 # changed the binary.  Remove it and the md5 file from your tmp directory, 
11 # and rebuild the kernel.  If you still get md5 failures, contact cbrake
12 # on the #oe IRC channel -- this recipe probably needs updated.
13
14 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.16.tar.bz2 \
15            file://linux-2.6.16.patch;patch=1 \
16            file://defconfig \
17            http://www.compulab.co.il/x270/download/x270-linux-drv.zip;md5sum=05989295a5f99055c2f60f8b6f7abb6b"
18
19 S = "${WORKDIR}/linux-2.6.16"
20
21 COMPATIBLE_HOST = 'arm.*-linux'
22
23 inherit kernel
24 inherit package
25
26 ARCH = "arm"
27
28 FILES_kernel-image = ""
29
30 do_configure_prepend() {
31         install -m 0644 ${WORKDIR}/defconfig ${S}/.config
32         install -m 0644 ${WORKDIR}/2.6.16/CL_FlashDrv ${S}/drivers/block/cl_flash
33 }
34
35 python do_compulab_image() {
36         import os
37         import os.path
38         import struct
39
40         deploy_dir = bb.data.getVar('DEPLOY_DIR_IMAGE', d, 1)
41         kernel_name = os.path.join(deploy_dir, bb.data.expand('${KERNEL_IMAGETYPE}-${MACHINE}.bin', d))
42
43         img_file = os.path.join(deploy_dir, 'zImage-compulab-pxa270.img')
44
45         fo = open(img_file, 'wb')
46
47         image_data = open(kernel_name, 'rb').read()
48
49         # first write size into first 4 bytes
50         size_s = struct.pack('i', len(image_data))
51
52         # truncate size if we are running on a 64-bit host
53         size_s = size_s[:4]
54
55         fo.write(size_s)
56         fo.write(image_data)
57         fo.close()
58 }
59
60 addtask compulab_image before do_build after do_deploy
61
62 COMPATIBLE_MACHINE = "cm-x270"
63