dm520: add modules-load.d config for stb-proc when no lcd is available (its needed...
[opendreambox.git] / meta-dreambox / recipes-bsp / dreambox-dvb-modules / dreambox-dvb-modules-base.inc
1 SUMMARY = "Hardware drivers for Dreambox"
2 SECTION = "base"
3 LICENSE = "CLOSED"
4 DEPENDS += "virtual/kernel"
5 PRIORITY = "required"
6
7 inherit module-base
8
9 addtask make_scripts after do_patch before do_compile
10 do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
11 do_make_scripts[deptask] = "do_populate_sysroot"
12
13 do_install_append() {
14     install -d ${D}${sysconfdir}/modules-load.d
15     if [ -f ${D}/lib/modules/${DM_LOCALVERSION}/extra/lcd.ko ]; then
16         echo lcd > ${D}${sysconfdir}/modules-load.d/01-${BPN}-lcd.conf
17         chmod 0644 ${D}${sysconfdir}/modules-load.d/01-${BPN}-lcd.conf
18     else
19         echo stb-core > ${D}${sysconfdir}/modules-load.d/01-${BPN}-stb-core.conf
20         chmod 0644 ${D}${sysconfdir}/modules-load.d/01-${BPN}-stb-core.conf
21     fi
22     for module in ${SOC_FAMILY} dreambox_keyboard; do
23         if [ -f ${D}/lib/modules/${DM_LOCALVERSION}/extra/$module.ko ]; then
24             echo $module >> ${D}${sysconfdir}/modules-load.d/10-${BPN}.conf
25         fi
26     done
27     chmod 0644 ${D}${sysconfdir}/modules-load.d/10-${BPN}.conf
28 }
29
30 PACKAGES =+ "${PN}-lcd ${PN}-stb-core"
31
32 RDEPENDS_${PN} = "${PN}-stb-core"
33 RDEPENDS_${PN}-lcd = "${PN}-stb-core"
34 RRECOMMENDS_${PN} = "${PN}-lcd ${PN}-systemd"
35
36 FILES_${PN} = "${sysconfdir}/modules-load.d/10-${BPN}.conf \
37                /lib/modules/${DM_LOCALVERSION}/extra/"
38
39 FILES_${PN}-lcd = "${sysconfdir}/modules-load.d/01-${BPN}-lcd.conf \
40                    /lib/modules/${DM_LOCALVERSION}/extra/lcd.ko"
41
42 FILES_${PN}-stb-core = "${sysconfdir}/modules-load.d/01-${BPN}-stb-core.conf \
43                         /lib/modules/${DM_LOCALVERSION}/extra/stb-core.ko"
44
45 # We don't use KERNEL_VERSION in this recipe, because the
46 # precompiled modules depend on a specific version.
47 DM_LOCALVERSION = "${@d.getVar('PV', True).rsplit('-', 1)[0]}"
48
49 pkg_postinst_${PN} () {
50 if [ -z "$D" ]; then
51         depmod -a ${DM_LOCALVERSION}
52 fi
53 }
54 pkg_postinst_${PN}-lcd () {
55 if [ -z "$D" ]; then
56         depmod -a ${DM_LOCALVERSION}
57 fi
58 }
59 pkg_postinst_${PN}-stb-core () {
60 if [ -z "$D" ]; then
61         depmod -a ${DM_LOCALVERSION}
62 fi
63 }