blob: 6ac0578d6ea524f17f88533aaa11d0a770b5e04e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
DESCRIPTION = "mts-io controller and sysfs wrapper"
HOMEPAGE = "http://www.multitech.net/"
SECTION = "base"
PRIORITY = "optional"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
"
do_fetch[depends] += "virtual/kernel:do_shared_workdir"
INC_PR = "r0"
SRCREV = "${PV}"
PR = "${INC_PR}.2"
PKGR = "${PR}-${KERNEL_MODULE_PACKAGE_SUFFIX}${EXTENDPRAUTO}"
# Some package needs to provide mts-io
RPROVIDES_kernel-module-${PN} = "mts-io"
RDEPENDS_${PN}-noarch_append = " mts-io-sysfs"
RDEPENDS_${PN}-noarch_append_mtcap = " mts-io-sysfs i2c-tools"
SRC_URI = " \
git://git.multitech.net/cgit/mts-io.git;protocol=https;branch=master \
file://led-status_heartbeat_trigger \
file://lora-led-updater \
file://mts-io.init \
file://mts-io.blacklist \
file://mts-io.mtcap.init \
file://mts-io.conf \
"
S = "${WORKDIR}/git"
inherit module
inherit update-rc.d
inherit autotools
EXTRA_OEMAKE = " -C ${STAGING_KERNEL_DIR} \
EXTRA_CFLAGS='-I${B}' \
KBUILD_VERBOSE=1 \
M=${S}/io-module \
modules \
"
EXTRA_OEMAKE_append_mtre = "EXTRA_CFLAGS+=' -D MTRE'"
EXTRA_OEMAKE_append_mtcap3 = "EXTRA_CFLAGS+=' -D PLATFORM_BUS_SYMLINK'"
do_compile () {
bbnote make "$@"
make "$@"
unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
oe_runmake
}
PACKAGES += "${PN}-noarch kernel-module-${PN} ${PN}-util ${PN}-util-dbg ${PN}-skipcharge"
RDEPENDS_${PN}-dev = ""
FILES_kernel-module-${PN} = " \
${base_libdir}/modules/${KERNEL_VERSION}/extra/mts_io.ko \
${sysconfdir}/modprobe.d/mts-io.conf \
"
FILES_${PN}-noarch = "${sysconfdir}/init.d/mts-io \
${sysconfdir}/rc5.d/S95led-status_heartbeat_trigger \
${sysconfdir}/default/mts-io \
${sysconfdir}/init.d/led-status_heartbeat_trigger"
FILES_${PN}-noarch_append_mtcap += "${sbindir}/lora-led-updater"
FILES_${PN}-noarch_append_mtcap3 += "${sbindir}/lora-led-updater"
FILES_${PN}-util += "${sbindir}/mts-util-lora2-reset"
FILES_${PN}-util-dbg += "/usr/src /usr/sbin/.debug"
FILES_${PN}-dev += "${includedir}/linux ${includedir}/mts-kernel-headers"
INITSCRIPT_PACKAGES = "${PN}-noarch"
INITSCRIPT_NAME_${PN}-noarch = "mts-io"
INITSCRIPT_PARAMS_${PN}-noarch = "start 39 S ."
PARALLEL_MAKE = ""
fakeroot do_install () {
make DESTDIR=${D} install
install -m 0755 -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra
# use cp instead of install so the driver doesn't get stripped
cp ${S}/io-module/mts_io.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra
install -Dm0644 ${S}/io-module/Module.symvers ${D}${includedir}/${BPN}/Module.symvers
# install headers for kernel modules
install -d ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/mts_io.h ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/mts_io_module.h ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/mts_eeprom.h ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/at91gpio.h ${D}${includedir}/mts-kernel-headers/linux
# install same headers for userspace applications
# Note this dupication can be avoided by adding the following into the recipes
# CFLAGS += ${STAGING_INCDIR}/mts-kernel-headers
#
install -d ${D}${includedir}/linux
install -m 0644 ${S}/io-module/mts_io.h ${D}${includedir}/linux
install -m 0644 ${S}/io-module/mts_io_module.h ${D}${includedir}/linux
install -m 0644 ${S}/io-module/mts_eeprom.h ${D}${includedir}/linux
install -m 0644 ${S}/io-module/at91gpio.h ${D}${includedir}/linux
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/mts-io.init ${D}${sysconfdir}/init.d/mts-io
install -m 0755 ${WORKDIR}/led-status_heartbeat_trigger ${D}/${sysconfdir}/init.d/
install -d ${D}${sysconfdir}/default
install -m 0755 ${WORKDIR}/mts-io.conf ${D}${sysconfdir}/default/mts-io
install -d ${D}${sysconfdir}/modprobe.d
install -m 0644 ${WORKDIR}/mts-io.blacklist ${D}${sysconfdir}/modprobe.d/mts-io.conf
# blink status LED after booted
install -d ${D}${sysconfdir}/rc5.d
ln -sf ${sysconfdir}/init.d/led-status_heartbeat_trigger ${D}/${sysconfdir}/rc5.d/S95led-status_heartbeat_trigger
install -m 0755 -d ${D}${sbindir}
}
fakeroot do_install_append_mtcap() {
# install MTCAP mts-io init script
install -m 0755 ${WORKDIR}/mts-io.mtcap.init ${D}${sysconfdir}/init.d/mts-io
install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater
}
fakeroot do_install_append_mtcap3() {
install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater
sed -i 's/spidev0.0/spidev1.0/' ${D}${sbindir}/lora-led-updater
}
fakeroot do_install_append_mtre() {
# no status led on mtre
echo "" > ${D}${sysconfdir}/init.d/led-status_heartbeat_trigger
}
# skipcharge is to prevent waiting for the supercap to charge on
# units with a supercap. This is for code development and testing
# purposes only.
ALLOW_EMPTY_${PN}-skipcharge = "1"
RDEPENDS_${PN}-skipcharge = "${PN}-noarch"
pkg_postinst_${PN}-skipcharge() {
sed -i 's/^SUPERCAPFULL=1/SUPERCAPFULL=0/' $D${sysconfdir}/default/mts-io
}
pkg_prerm_${PN}-skipcharge() {
sed -i 's/^SUPERCAPFULL=1/SUPERCAPFULL=0/' $D${sysconfdir}/default/mts-io
}
|