omap3-pandora-kernel2: package firmware from media_build
[openpandora.oe.git] / recipes / linux / omap3-pandora-kernel2_3.2-pandora.bb
1 DESCRIPTION = "3.2 Linux kernel for the Pandora handheld console"
2 SECTION = "kernel"
3 LICENSE = "GPLv2"
4 COMPATIBLE_MACHINE = "omap3-pandora"
5 PACKAGE_ARCH = "${MACHINE_ARCH}"
6
7 PR = "r20"
8
9 # we already build 2.6 kernel using OE infrastructure, and
10 # as we don't know how to build another one into the same image
11 # (especially out-of-tree modules), we just package manually prebuilt one
12 # git://git.openpandora.org/pandora-kernel.git , branch pandora-3.2
13 # commit: cfc13acd0430df213e3782e95571b863f049dce4
14 # out-of-tree modules are built from:
15 # http://git.openpandora.org/cgi-bin/gitweb.cgi?p=sgx.git
16 # http://notaz.gp2x.de/misc/pnd/oe_rootfs_extra_modules.tar.bz2
17 SRC_URI = "http://notaz.gp2x.de/misc/pnd/oe_rootfs_extra_${PR}.tar.bz2"
18
19 S = "${WORKDIR}"
20
21 do_install() {
22   cp -a ${S}/boot ${D}/
23   cp -a ${S}/lib ${D}/
24   rm -f ${D}/lib/modules/*/modules.dep*
25 }
26
27 PACKAGES =+ "linux-firmware-media"
28
29 FILES_${PN} = "boot lib"
30 FILES_linux-firmware-media = "lib/firmware"
31
32 pkg_postinst_${PN} () {
33   # this will cause depmod to be run on next boot
34   rm -f /lib/modules/`uname -r`/modules.dep
35   sync
36
37   if ! grep -q '[[:blank:]]/[[:blank:]]*ubifs' /proc/mounts; then
38     for dir in `ls -d /media/*boot* 2> /dev/null` `ls -d /media/*BOOT* 2> /dev/null`; do
39       test -e $dir/uImage && oldkernel=$dir/uImage
40       test -e $dir/uImage-3 && oldkernel=$dir/uImage-3
41     done
42
43     if test -n "$oldkernel"; then
44       cp /boot/uImage-3 $oldkernel
45       msg="Updated kernel has beed copied to ${oldkernel}. \
46 If this location is wrong, copy /boot/uImage-3 to the location \
47 where your kernel is booted from (usually set in boot.txt / autoboot.txt)."
48     else
49       msg="The kernel in /boot/uImage-3 has been updated. You need to \
50 copy it to the location where kernel is booted from (usually set in \
51 boot.txt / autoboot.txt) or the system might not start after reboot."
52     fi
53     sync
54     if test -n "$DISPLAY"; then
55       zenity --info --text "$msg"
56     else
57       echo "=================================="
58       echo "$msg"
59       sleep 5
60     fi
61   fi
62 }
63
64 PACKAGE_STRIP = "no"
65 SRC_URI[md5sum] = "894dba4bce65bbb8652c1df49572f1fb"
66 SRC_URI[sha256sum] = "85a22700e1376fa9822beeb259d738f20ad0114425bfd0c8b12fae9b4dcb12d6"