blob: d14587af3225fb22e7b35e87e35760d7c0b204d7 (
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
|
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
# cfg80211 should be configured when loading wifi
# modules using a regulatory database, not here.
PR = "m3"
# -p option is striplevel
SRC_URI += " file://WiFi-SSID \
file://setchan \
file://default \
file://init \
file://defconfig \
"
do_install() {
install -d ${D}${sbindir} ${D}${sysconfdir}/init.d
install -d ${D}${sbindir} ${D}${sysconfdir}/default
install -m 0644 ${B}/hostapd.conf ${D}${sysconfdir}
install -m 0755 ${B}/hostapd ${D}${sbindir}
install -m 0755 ${B}/hostapd_cli ${D}${sbindir}
install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/hostapd
install -m 755 ${WORKDIR}/default ${D}${sysconfdir}/default/hostapd
install -d ${D}/usr/share/hostapd
install -m 0444 ${WORKDIR}/WiFi-SSID ${D}/usr/share/hostapd/WiFi-SSID.patch
install -d ${D}/usr/local/bin
install -m 0744 ${WORKDIR}/setchan ${D}/usr/local/bin
}
# ${PN}-extra sets a unique SSID name, and has a channel setting utility
PACKAGES =+ "${PN}-extra ${PN}-cfg"
RDEPENDS_${PN}-extra = "${PN}-cfg bash"
FILES_${PN}-extra = "/usr/local/bin/* /usr/share/hostapd/WiFi-SSID.patch"
# initscripts are unique to mLinux so put into ${PN}-cfg
INITSCRIPT_NAME_${PN}-cfg = "hostapd"
SYSTEMD_SERVICE_${PN}-cfg = "hostapd.service"
SYSTEMD_AUTO_ENABLE_${PN}-cfg = "disable"
INITSCRIPT_PACKAGES = "${PN}-cfg"
SYSTEMD_PACKAGES = "${PN}-cfg"
INITSCRIPT_NAME = ""
SYSTEMD_SERVICE_${PN} = ""
SYSTEMD_AUTO_ENABLE_${PN} = ""
SYSTEMD_SERVICE_${PN}-cfg = "hostapd.service"
SYSTEMD_AUTO_ENABLE_${PN}-cfg = "disable"
# mLinux files
FILES_${PN}-cfg = "/etc/init.d/hostapd /etc/default/hostapd /etc/hostapd.conf"
pkg_postinst_${PN}-extra() {
cd /$D
if patch --dry-run -p1 < $D/usr/share/hostapd/WiFi-SSID.patch ; then
patch -p1 < $D/usr/share/hostapd/WiFi-SSID.patch
fi
}
pkg_prerm_${PN}-extra() {
cd /$D
patch -Rp1 < $D/usr/share/hostapd/WiFi-SSID.patch
}
|