2 DESCRIPTION = "handhelds.org Linux kernel 2.6 for PocketPCs and other consumer handheld devices."
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)"
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 \
14 S = "${WORKDIR}/kernel26"
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]}"
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)))}"
26 KERNEL_FILENAME = "${KERNEL_IMAGETYPE}-${PV}-${PR}-${MACHINE}.bin"
30 if [ `grep EXTRAVERSION Makefile | grep hh | awk '{print $3}' | sed s/-hh//` != ${HHV} ]; then
31 die "-hh version mismatch"
36 if [ ! -e ${WORKDIR}/defconfig ]; then
37 die "No default configuration for ${MACHINE} available."
40 if [ -n "${KERNEL_INITRAMFS_PATH}" -a "${ANGSTROM_MODE}" = "glibc" ]; then
41 if [ ! -f ${KERNEL_INITRAMFS_PATH} ]; then
42 echo "${KERNEL_INITRAMFS_PATH} does not exist, you may need to bitbake it separately"
46 # Kernel expects non-compressed cpio
47 gzip -d -c ${KERNEL_INITRAMFS_PATH} >${WORKDIR}/initramfs.cpio
48 echo "CONFIG_INITRAMFS_SOURCE=\"${WORKDIR}/initramfs.cpio\"" >> ${S}/.config
51 if [ "${TARGET_OS}" == "linux-gnueabi" -o "${TARGET_OS}" == "linux-uclibcgnueabi" ]; then
52 echo "CONFIG_AEABI=y" >> ${S}/.config
53 echo "CONFIG_OABI_COMPAT=y" >> ${S}/.config
55 echo "# CONFIG_AEABI is not set" >> ${S}/.config
56 echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config
59 sed -e '/CONFIG_AEABI/d' \
60 -e '/CONFIG_OABI_COMPAT=/d' \
61 -e '/CONFIG_INITRAMFS_SOURCE=/d' \
62 '${WORKDIR}/defconfig' >>'${S}/.config'
64 yes '' | oe_runmake oldconfig
69 install -d ${DEPLOY_DIR_IMAGE}
70 install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOY_DIR_IMAGE}/${KERNEL_FILENAME}
71 tar -cvzf ${DEPLOY_DIR_IMAGE}/modules-${PV}-${PR}-${MACHINE}.tgz -C ${D} lib
73 #reflash.ctl is required to reflash using bootldr
75 # name file md5sumfile destination
76 echo "${MACHINE}-kernel-${DATETIME} ${KERNEL_FILENAME} - kernel" >> ${DEPLOY_DIR_IMAGE}/reflash.ctl
79 if [ -n "${KERNEL_INITRAMFS_PATH}" -a "${ANGSTROM_MODE}" == "glibc" ]; then
80 cp ${DEPLOY_DIR_IMAGE}/${KERNEL_FILENAME} ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-$(basename ${KERNEL_INITRAMFS_PATH} | awk -F. '{print $1}')-${PV}-${PR}-${MACHINE}.bin
84 do_deploy[dirs] = "${S}"
86 addtask deploy before do_package after do_install
90 cat >${DEPLOY_DIR_IMAGE}/startup.txt <<EOF
91 # This is startup file for HaRET, Linux bootloader for WinCE
92 # http://handhelds.org/wiki/HaRET
94 set kernel "${KERNEL_FILENAME}"
96 # Boot choices. Uncomment 'set' statements in exactly one section
98 ## Choice 1 - Boot from SD/MMC card
99 # Have 2 partition on a card:
100 # 1st - FAT with HaRET executable, this file and zImage above
101 # 2nd - EXT2 with rootfs tarball extracted
102 set cmdline "root=/dev/mmcblk0p2 rootdelay=10 console=ttyS0,115200n8 console=tty0"
104 ## Choice 2 - Boot from CF card, setup like above
105 #set cmdline "root=/dev/hda2 rootdelay=10 console=ttyS0,115200n8 console=tty0"
107 ## Choice 3 - Boot kernel with builtin interactive bootloader (initramfs-bootmenu-image)
108 # rootdelay is a wait before scanning for the available partitions
109 # if root= is also specified, interactive selection will be skipped and
110 # direct boot will happen.
111 #set cmdline "rootdelay=3 console=ttyS0,115200n8 console=tty0"
113 ## Choice 4 - Boot rootfs image as initramfs (works only for smaller images)
114 # have a cpio.gz file below together with zImage, no EXT2 partition required
115 #set initrd "<image>.rootfs.cpio.gz"
116 #set cmdline "rdinit=/sbin/init console=ttyS0,115200n8 console=tty0"
118 ## Choice 5 - Boot via NFS over USB networking (must be kernel-builtin
119 # or initramfs-*-image works too)
120 # 192.168.x.x - Server address (the other side)
121 # 192.168.y.y - Handheld's address
122 #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"
124 ## Choice 6 - Boot from MTD partition, for devices with lots of flash
125 # to have both WinCE and Linux there. Note the value of root param,
126 # that's how it should be, not "/dev/mtdblockN".
127 #set cmdline "root=mtdN console=ttyS0,115200n8 console=tty0"