linux-dreambox-3.2: switch to 3.2.51, add memory mapping support to usbfs
[opendreambox.git] / meta-bsp / common / recipes / linux / linux-dreambox.inc
1 require recipes/linux/linux.inc
2
3 INC_PR = "r12"
4
5 PACKAGES_DYNAMIC = "kernel-*"
6
7 # By default, kernel.bbclass modifies package names to allow multiple kernels
8 # to be installed in parallel. We revert this change and rprovide the versioned
9 # package names instead, to allow only one kernel to be installed.
10 PKG_kernel-base = "kernel-base"
11 PKG_kernel-image = "kernel-image"
12 RPROVIDES_kernel-base = "kernel-${KERNEL_VERSION}"
13 RPROVIDES_kernel-image = "kernel-image-${KERNEL_VERSION}"
14
15 USB_ROOT = "/dev/sdb2"
16 USB_ROOT_dm8000 = "/dev/sdf2"
17
18 do_install_append() {
19         # mark the kernel executable, so it gets stripped during do_package
20         chmod +x ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
21         echo "/boot/bootlogo-${MACHINE}.elf.gz filename=/boot/bootlogo-${MACHINE}.jpg" > ${D}/${KERNEL_IMAGEDEST}/autoexec.bat
22         echo "/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}.gz ${CMDLINE}" >> ${D}/${KERNEL_IMAGEDEST}/autoexec.bat
23         echo "/boot/bootlogo-${MACHINE}.elf.gz filename=/boot/bootlogo-${MACHINE}.jpg" > ${D}/${KERNEL_IMAGEDEST}/autoexec_${MACHINE}.bat
24         echo "/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}.gz ${USB_CMDLINE}" >> ${D}/${KERNEL_IMAGEDEST}/autoexec_${MACHINE}.bat
25 }
26
27 PACKAGES += "kernel-image-dbg"
28
29 FILES_kernel-image += "/${KERNEL_IMAGEDEST}/autoexec*.bat"
30 FILES_kernel-image-dbg = "/${KERNEL_IMAGEDEST}/.debug"
31
32 python populate_packages_prepend() {
33         os.system(d.expand("gzip -9 ${PKGD}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}"))
34 }
35 python __anonymous () {
36         import bb, re
37         kv = d.getVar('DREAMBOX_KERNEL_VERSION', True)
38         pv = d.getVar('PV', True)
39         if kv != pv:
40                 raise bb.parse.SkipPackage("incompatible with kernel version %s" % kv)
41 }
42
43 pkg_preinst_kernel-image() {
44         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,rw /${KERNEL_IMAGEDEST}; fi
45 }
46 pkg_prerm_kernel-image() {
47         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,rw /${KERNEL_IMAGEDEST}; fi
48 }
49 pkg_postinst_kernel-image() {
50         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then
51                 if grep -q '\<root=/dev/mtdblock3\>' /proc/cmdline && grep -q '\<root=ubi0:rootfs\>' /boot/autoexec.bat; then
52                         sed -ie 's!${CMDLINE_UBI}!${CMDLINE_JFFS2}!' /boot/autoexec.bat;
53                 fi
54                 mount -o remount,ro /${KERNEL_IMAGEDEST};
55         fi
56 }
57 pkg_postrm_kernel-image() {
58         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,ro /${KERNEL_IMAGEDEST}; fi
59 }
60
61 # Do not use update-alternatives!
62 pkg_postinst_kernel () {
63 }
64 pkg_postrm_kernel () {
65 }
66
67 CMDLINE_JFFS2 = "root=/dev/mtdblock3 rootfstype=jffs2 rw ${CMDLINE_CONSOLE}"
68 CMDLINE_UBI = "ubi.mtd=root root=ubi0:rootfs rootfstype=ubifs rw ${CMDLINE_CONSOLE}"
69 CMDLINE = "${@base_contains('IMAGE_FSTYPES', 'ubi.nfi', '${CMDLINE_UBI}', '${CMDLINE_JFFS2}', d)}"
70 USB_CMDLINE = "root=${USB_ROOT} rootdelay=10 rw ${CMDLINE_CONSOLE}"
71
72 LOCALVERSION = "-${MACHINE}"