linux-dreambox: build modules for bluetooth, dmcrypt, usb printer, hfs, wiimote
[opendreambox.git] / meta-bsp / common / recipes / linux / linux-dreambox.inc
1 require recipes/linux/linux.inc
2
3 INC_PR = "r8"
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         gzip -9 ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
20         echo "/boot/bootlogo-${MACHINE}.elf.gz filename=/boot/bootlogo-${MACHINE}.jpg" > ${D}/${KERNEL_IMAGEDEST}/autoexec.bat
21         echo "/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}.gz ${CMDLINE}" >> ${D}/${KERNEL_IMAGEDEST}/autoexec.bat
22         echo "/boot/bootlogo-${MACHINE}.elf.gz filename=/boot/bootlogo-${MACHINE}.jpg" > ${D}/${KERNEL_IMAGEDEST}/autoexec_${MACHINE}.bat
23         echo "/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}.gz ${USB_CMDLINE}" >> ${D}/${KERNEL_IMAGEDEST}/autoexec_${MACHINE}.bat
24 }
25
26 FILES_kernel-image += "/${KERNEL_IMAGEDEST}/autoexec*.bat"
27
28 python __anonymous () {
29         import bb, re
30         kv = d.getVar('DREAMBOX_KERNEL_VERSION', True)
31         pv = d.getVar('PV', True)
32         if kv != pv:
33                 raise bb.parse.SkipPackage("incompatible with kernel version %s" % kv)
34 }
35
36 pkg_preinst_kernel-image() {
37         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,rw /${KERNEL_IMAGEDEST}; fi
38 }
39 pkg_prerm_kernel-image() {
40         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,rw /${KERNEL_IMAGEDEST}; fi
41 }
42 pkg_postinst_kernel-image() {
43         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,ro /${KERNEL_IMAGEDEST}; fi
44 }
45 pkg_postrm_kernel-image() {
46         if [ -z "$D" ] && mountpoint -q /${KERNEL_IMAGEDEST}; then mount -o remount,ro /${KERNEL_IMAGEDEST}; fi
47 }
48
49 # Do not use update-alternatives!
50 pkg_postinst_kernel () {
51 }
52 pkg_postrm_kernel () {
53 }
54
55 CMDLINE = "root=/dev/mtdblock3 rootfstype=jffs2 rw ${CMDLINE_CONSOLE}"
56 USB_CMDLINE = "root=${USB_ROOT} rootdelay=10 rw ${CMDLINE_CONSOLE}"
57
58 LOCALVERSION = "-${MACHINE}"