dreambox-dvb-modules.inc: adjust version parsers for kernel version 3.4-3.0
[opendreambox.git] / meta-dreambox / recipes-bsp / dreambox-dvb-modules / dreambox-dvb-modules.inc
1 SUMMARY = "Hardware drivers for Dreambox"
2 SECTION = "base"
3 LICENSE = "CLOSED"
4 DEPENDS += "virtual/kernel"
5 PRIORITY = "required"
6
7 # Use precompiled binaries from the previous opendreambox release.
8 DREAMBOX_DVB_MODULES_MIRROR ?= "http://dreamboxupdate.com/download/${DISTRO}/2.0.0/${PN}"
9 PRECOMPILED_ARCH = "${@d.getVar('PV', True).split('-')[-2]}"
10
11 SRC_URI = "${DREAMBOX_DVB_MODULES_MIRROR}/dreambox-dvb-modules-${PRECOMPILED_ARCH}-${PV}.tar.bz2;name=modules"
12
13 inherit module-base
14
15 addtask make_scripts after do_patch before do_compile
16 do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
17 do_make_scripts[deptask] = "do_populate_sysroot"
18
19 do_compile() {
20 }
21 do_install() {
22     install -d ${D}/lib/modules/${DM_LOCALVERSION}/extra
23     install -m 0644 ${WORKDIR}/*.ko ${D}/lib/modules/${DM_LOCALVERSION}/extra
24     install -m 0644 ${WORKDIR}/LICENSE ${D}/lib/modules/${DM_LOCALVERSION}/extra
25 }
26 do_install_append() {
27     install -d ${D}${sysconfdir}/modules-load.d
28     if [ -f ${D}/lib/modules/${DM_LOCALVERSION}/extra/lcd.ko ]; then
29         echo lcd > ${D}${sysconfdir}/modules-load.d/01-${BPN}-lcd.conf
30         chmod 0644 ${D}${sysconfdir}/modules-load.d/01-${BPN}-lcd.conf
31     fi
32     for module in ${SOC_FAMILY} dreambox_keyboard; do
33         if [ -f ${D}/lib/modules/${DM_LOCALVERSION}/extra/$module.ko ]; then
34             echo $module >> ${D}${sysconfdir}/modules-load.d/10-${BPN}.conf
35         fi
36     done
37     chmod 0644 ${D}${sysconfdir}/modules-load.d/10-${BPN}.conf
38 }
39
40 PACKAGES =+ "${PN}-lcd"
41
42 RDEPENDS_${PN} = "${PN}-lcd kernel-${DM_LOCALVERSION}"
43 RRECOMMENDS_${PN} = "${PN}-systemd"
44
45 FILES_${PN} = "${sysconfdir}/modules-load.d/10-${BPN}.conf \
46                /lib/modules/${DM_LOCALVERSION}/extra/"
47
48 FILES_${PN}-lcd = "${sysconfdir}/modules-load.d/01-${BPN}-lcd.conf \
49                    /lib/modules/${DM_LOCALVERSION}/extra/lcd.ko"
50
51 # We don't use KERNEL_VERSION in this recipe, because the
52 # precompiled modules depend on a specific version.
53 DM_LOCALVERSION = "${@d.getVar('PV', True).rsplit('-', 1)[0]}"