[hbbtv/youtubetv] Fixed hanup bug and segmentation fault on 3rd-party images.
[vuplus_openembedded] / recipes / linux / linux-mtx-3_2.6.15.4.bb
1 DESCRIPTION = "Linux kernel for MTX-3 (Surfbox3)"
2 HOMEPAGE = "http://meshcube.org/meshwiki/"
3 LICENSE = "GPL"
4 KV = "${PV}"
5 PR = "r11"
6
7 inherit kernel
8 # therefore
9 # PROVIDES = "virtual/kernel"
10
11 DEPENDS = "u-boot"
12 RDEPENDS = "mtd-utils"
13
14 SRC_URI += "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${KV}.tar.bz2 \
15         file://00-mtx-3.diff;patch=1 \
16         file://01-verbose-and-fatal-mkuboot.diff;patch=1 \
17         file://defconfig-mtx-3"
18
19 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/linux-mtx-3-${KV}"
20
21 S = "${WORKDIR}/linux-${KV}"
22
23
24 COMPATIBLE_HOST = "arm.*-linux"
25 COMPATIBLE_MACHINE = "mtx-3"
26
27 # overriding default target 'zImage' with U-Boot-Image
28 # (note: uImage depends on zImage)
29 # U-Boot's "mkimage" is required for this to work
30 KERNEL_IMAGETYPE = "uImage"
31
32 # overriding default 'boot'
33 KERNEL_IMAGEDEST = "tmp"
34
35 XIP_PHYS_ADDR = "0x00080000"
36
37 MTX_KERNEL_NON_PCI_OHCI = "no"
38
39 PACKAGE_ARCH = "mtx-3"
40
41 do_configure_prepend() {
42         install -m 0644 ${WORKDIR}/defconfig-mtx-3 ${S}/.config
43         if [ "x${MTX_KERNEL_NON_PCI_OHCI}" == "xyes" ]; then
44                 echo "CONFIG_USB_NON_PCI_OHCI=y" >> ${S}/.config
45         fi
46 }
47
48 do_compile() {
49
50         kernel_do_compile
51
52         # set CONFIG_XIP_KERNEL=y and CONFIG_XIP_PHYS_ADDR=xxxx if commented out, else append it
53 #        sed -i -e "s/^[#        ]*CONFIG_XIP_KERNEL.*/CONFIG_XIP_KERNEL=y/" \
54 #                -e "s/^[#       ]*CONFIG_XIP_PHYS_ADDR.*/CONFIG_XIP_PHYS_ADDR=${XIP_PHYS_ADDR}/" .config
55 #       grep -q "^CONFIG_XIP_PHYS_ADDR=" .config || echo "CONFIG_XIP_PHYS_ADDR=${XIP_PHYS_ADDR}" >>.config
56
57 #        oe_runmake xipImage CC="arm-linux-gcc " LD="arm-linux-ld " ARCH="arm"
58 }
59
60 #
61 # FIXME: we need to find out the proper names and kernel image formats
62 # used / needed here and then fix the following ...
63 #
64
65 pkg_postinst_kernel() {
66 if test "x$D" != "x"; then
67         exit 1
68 else
69         if test -e /tmp/zImage.flash-${KV}; then
70                 echo "*** flashing kernel ***"
71                 flashcp -v /tmp/zImage.flash-${KV} /dev/mtd/2
72                 echo "*** done. please reboot ***"
73         fi
74 fi
75 }
76
77 FILES_kernel += " /tmp"
78
79 do_deploy() {
80         install -d ${DEPLOY_DIR_IMAGE}
81
82 # uncompressed Image
83         install -m 0644 arch/arm/boot/Image ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}
84
85 # xip is probably not very useful for us - text segment reading may be slow on flash and we have enough ram
86 #       install -m 0644 arch/arm/boot/xipImage ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_NAME}.xip
87
88 # old mtx-2 mips
89         #install -m 0644 arch/mips/boot/mtx-3.flash.srec ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.flash.srec
90         #install -m 0644 arch/mips/boot/mtx-3.srec ${DEPLOY_DIR}/images/${KERNEL_IMAGE_NAME}.ram.srec
91 }