dreambox-dvb-modules: fix dependency on shared workdir
[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 dreambox-dvb-modules-systemd"
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[depends] += "virtual/kernel:do_shared_workdir"
12
13 do_install_append() {
14     install -d ${D}${sysconfdir}/modules-load.d
15     echo stb-core > ${D}${sysconfdir}/modules-load.d/01-${BPN}-stb-core.conf
16     chmod 0644 ${D}${sysconfdir}/modules-load.d/01-${BPN}-stb-core.conf
17     if [ -f ${D}/lib/modules/${DM_LOCALVERSION}/extra/lcd.ko ]; then
18         echo lcd > ${D}${sysconfdir}/modules-load.d/02-${BPN}-lcd.conf
19         chmod 0644 ${D}${sysconfdir}/modules-load.d/02-${BPN}-lcd.conf
20     fi
21     for module in ${SOC_FAMILY} dreambox_keyboard; do
22         if [ -f ${D}/lib/modules/${DM_LOCALVERSION}/extra/$module.ko ]; then
23             echo $module >> ${D}${sysconfdir}/modules-load.d/10-${BPN}.conf
24         fi
25     done
26     chmod 0644 ${D}${sysconfdir}/modules-load.d/10-${BPN}.conf
27 }
28
29 PACKAGES =+ "${PN}-lcd ${PN}-stb-core"
30
31 RDEPENDS_${PN} = "${PN}-stb-core"
32 RDEPENDS_${PN}-lcd = "${PN}-stb-core"
33 RRECOMMENDS_${PN} = "${PN}-lcd dreambox-dvb-modules-systemd"
34
35 FILES_${PN} = "${sysconfdir}/modules-load.d/10-${BPN}.conf \
36                /lib/modules/${DM_LOCALVERSION}/extra/"
37
38 FILES_${PN}-lcd = "${sysconfdir}/modules-load.d/02-${BPN}-lcd.conf \
39                    /lib/modules/${DM_LOCALVERSION}/extra/lcd.ko"
40
41 FILES_${PN}-stb-core = "${sysconfdir}/modules-load.d/01-${BPN}-stb-core.conf \
42                         /lib/modules/${DM_LOCALVERSION}/extra/stb-core.ko"
43
44 # We don't use KERNEL_VERSION in this recipe, because the
45 # precompiled modules depend on a specific version.
46 DM_LOCALVERSION = "${@d.getVar('PV', True).rsplit('-', 1)[0]}"
47
48 pkg_postinst_${PN} () {
49 if [ -z "$D" ]; then
50         depmod -a ${DM_LOCALVERSION}
51 fi
52 }
53 pkg_postinst_${PN}-lcd () {
54 if [ -z "$D" ]; then
55         depmod -a ${DM_LOCALVERSION}
56 fi
57 }
58 pkg_postinst_${PN}-stb-core () {
59 if [ -z "$D" ]; then
60         depmod -a ${DM_LOCALVERSION}
61 fi
62 }