increase dvbapp PR.
[vuplus_openembedded] / recipes / linux / linux-handhelds-2.6.inc
1 SECTION = "kernel"
2 DESCRIPTION = "handhelds.org Linux kernel 2.6 for PocketPCs and other consumer handheld devices."
3 LICENSE = "GPL"
4
5 COMPATIBLE_HOST = "arm.*-linux"
6 COMPATIBLE_MACHINE ?= "(asus620|asus730|aximx50|aximx50v|eseries|h1910|h2200|h3600|h3800|h3900|h4000|h5000|htcalpine|htcapache|htcblueangel|htchermes|htchimalaya|htcsable|htcuniversal|htcwallaby|hx4700|ghi270|looxc550|jornada56x|magician|rx1950|rx3000)"
7
8 # SRC_URI *must* be overriden in includer, but this is a good reference
9 SRC_URI ?= "${HANDHELDS_CVS};module=linux/kernel26;tag=${@'K' + bb.data.getVar('PV',d,1).replace('.', '-')} \
10            file://24-hostap_cs_id.diff;patch=1 \
11            file://hrw-pcmcia-ids-r2.patch;patch=1 \
12            file://defconfig"
13
14 S = "${WORKDIR}/kernel26"
15
16 inherit kernel
17
18
19 K_MAJOR ?= "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[0]}"
20 K_MINOR ?= "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[1]}"
21 K_MICRO ?= "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[2]}"
22 HHV     ?= "${@bb.data.getVar('PV',d,1).split('-')[1].split('hh')[-1]}"
23
24 KERNEL_PRIORITY = "${@'%d' % (int(bb.data.getVar('K_MAJOR',d,1)) * 100000000 + int(bb.data.getVar('K_MINOR',d,1)) * 1000000 + int(bb.data.getVar('K_MICRO',d,1)) * 10000 + float(bb.data.getVar('HHV',d,1)))}"
25
26 do_configure() {
27
28         if [ `grep EXTRAVERSION Makefile | grep hh | awk '{print $3}' | sed s/-hh//` != ${HHV} ]; then
29                 die "-hh version mismatch"
30         fi
31
32         rm -f ${S}/.config
33
34         if [ ! -e ${WORKDIR}/defconfig ]; then
35                 die "No default configuration for ${MACHINE} available."
36         fi
37
38         if [ -n "${KERNEL_INITRAMFS_PATH}" -a "${ANGSTROMLIBC}" = "glibc" ]; then
39                 if [ ! -f ${KERNEL_INITRAMFS_PATH} ]; then
40                     echo "Kernel is requested to be built with internal initramfs."
41                     echo "The initramfs image must exist prior to building the kernel, but it does not"
42                     echo "exist at the specified path ${KERNEL_INITRAMFS_PATH}. You may need to bitbake"
43                     echo "it separately, possibly, with a different set of bitbake options. Please"
44                     echo "consult documentation for your distro."
45                     exit 1
46                 fi
47
48                 # Kernel expects non-compressed cpio
49                 gzip -d -c ${KERNEL_INITRAMFS_PATH} >${WORKDIR}/initramfs.cpio
50                 echo "CONFIG_INITRAMFS_SOURCE=\"${WORKDIR}/initramfs.cpio\"" >> ${S}/.config
51         fi
52
53         if [ "${TARGET_OS}" == "linux-gnueabi" -o  "${TARGET_OS}" == "linux-uclibceabi" ]; then
54                 echo "CONFIG_AEABI=y"                   >> ${S}/.config
55                 echo "CONFIG_OABI_COMPAT=y"             >> ${S}/.config
56         else
57                 echo "# CONFIG_AEABI is not set"        >> ${S}/.config
58                 echo "# CONFIG_OABI_COMPAT is not set"  >> ${S}/.config
59         fi
60
61         sed     -e '/CONFIG_AEABI/d' \
62                 -e '/CONFIG_OABI_COMPAT=/d' \
63                 -e '/CONFIG_INITRAMFS_SOURCE=/d' \
64                 '${WORKDIR}/defconfig' >>'${S}/.config'
65
66         yes '' | oe_runmake oldconfig
67
68 }
69
70 do_deploy_append() {
71         #reflash.ctl is required to reflash using bootldr
72         # format:
73         # name file md5sumfile destination
74         echo "${MACHINE}-kernel-${DATETIME} ${KERNEL_IMAGE_BASE_NAME} - kernel" >> ${DEPLOY_DIR_IMAGE}/reflash.ctl
75         gen_haret_startup
76
77         if [ -n "${KERNEL_INITRAMFS_PATH}" -a "${ANGSTROMLIBC}" == "glibc" ]; then
78                 cp ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-$(basename ${KERNEL_INITRAMFS_PATH} | awk -F. '{print $1}')-${PV}-${PR}-${MACHINE}.bin 
79         fi
80 }   
81    
82
83 gen_haret_startup() {
84         cat >${DEPLOY_DIR_IMAGE}/startup.txt <<EOF 
85 # This is startup file for HaRET, Linux bootloader for WinCE
86 # http://handhelds.org/wiki/HaRET
87
88 set kernel "${KERNEL_IMAGE_BASE_NAME}.bin"
89
90 # Boot choices. Uncomment 'set' statements in exactly one section
91
92 ## Choice 1 - Boot from SD/MMC card
93 # Have 2 partition on a card:
94 # 1st - FAT with HaRET executable, this file and zImage above
95 # 2nd - EXT2 with rootfs tarball extracted
96 set cmdline "root=/dev/mmcblk0p2 rootdelay=10 console=ttyS0,115200n8 console=tty0"
97
98 ## Choice 2 - Boot from CF card, setup like above
99 #set cmdline "root=/dev/hda2 rootdelay=10 console=ttyS0,115200n8 console=tty0"
100
101 ## Choice 3 - Boot kernel with builtin interactive bootloader (initramfs-bootmenu-image)
102 # rootdelay is a wait before scanning for the available partitions
103 # if root= is also specified, interactive selection will be skipped and
104 # direct boot will happen.
105 #set cmdline "rootdelay=3 console=ttyS0,115200n8 console=tty0"
106
107 ## Choice 4 - Boot rootfs image as initramfs (works only for smaller images)
108 # have a cpio.gz file below together with zImage, no EXT2 partition required
109 #set initrd "<image>.rootfs.cpio.gz"
110 #set cmdline "rdinit=/sbin/init console=ttyS0,115200n8 console=tty0"
111
112 ## Choice 5 - Boot via NFS over USB networking (must be kernel-builtin
113 # or initramfs-*-image works too)
114 # 192.168.x.x - Server address (the other side)
115 # 192.168.y.y - Handheld's address
116 #set cmdline "root=/dev/nfs nfsroot=192.168.x.x:<nfs_path> ip=192.168.y.y:192.168.x.x:192.168.x.x:255.255.255.0:pda:usb0 console=ttyS0,115200n8 console=tty0"
117
118 ## Choice 6 - Boot from MTD partition, for devices with lots of flash
119 #  to have both WinCE and Linux there. Note the value of root param,
120 #  that's how it should be, not "/dev/mtdblockN".
121 #set cmdline "root=mtdN console=ttyS0,115200n8 console=tty0"
122
123 bootlinux
124 EOF
125 }