blob: 94af9771e43fc394588735b0bce8774f204aaf09 [file] [log] [blame]
developer29c4d2d2022-12-26 19:41:22 +08001SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
2DESCRIPTION = "wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver."
3HOMEPAGE = "http://w1.fi/wpa_supplicant/"
4BUGTRACKER = "http://w1.fi/security/"
5SECTION = "network"
6LICENSE = "BSD-3-Clause"
7LIC_FILES_CHKSUM = "file://hostapd/README;md5=c905478466c90f1cefc0df987c40e172"
8
developer2a209692023-08-14 20:23:42 +08009DEPENDS = "dbus libnl ubus ucode"
developer29c4d2d2022-12-26 19:41:22 +080010FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
11FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches-${PV}:"
12
developere35b8e42023-10-16 11:04:00 +080013SRCREV ?= "e5ccbfc69ecf297590341ae8b461edba9d8e964c"
developer29c4d2d2022-12-26 19:41:22 +080014SRC_URI = "git://w1.fi/hostap.git;protocol=https;branch=main \
15 file://wpa-supplicant.sh \
16 file://wpa_supplicant.conf \
17 file://wpa_supplicant.conf-sane \
18 file://99_wpa_supplicant \
19 file://wpa_supplicant-full.config \
developer2a209692023-08-14 20:23:42 +080020 file://wpa_supplicant.uc \
21 file://src-${PV} \
22 file://002-rdkb-add-ucode-support.patch;apply=no \
developer29c4d2d2022-12-26 19:41:22 +080023 "
24require files/patches-${PV}/patches.inc
25
26S = "${WORKDIR}/git"
27
28inherit pkgconfig systemd
29
30PACKAGECONFIG ?= "openssl"
31PACKAGECONFIG[openssl] = ",,openssl"
32
33CVE_PRODUCT = "wpa_supplicant"
34
35EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'"
36
37do_unpack_append() {
38 bb.build.exec_func('do_copy_openwrt_src', d)
39}
40
41do_copy_openwrt_src() {
developer2a209692023-08-14 20:23:42 +080042 cp -Rfp ${WORKDIR}/src-${PV}/* ${S}/
developer29c4d2d2022-12-26 19:41:22 +080043}
44
45do_filogic_patches() {
46 cd ${S}
47 if [ ! -e patch_applied ]; then
developer2a209692023-08-14 20:23:42 +080048 patch -p1 < ${WORKDIR}/002-rdkb-add-ucode-support.patch
developer29c4d2d2022-12-26 19:41:22 +080049 touch patch_applied
50 fi
51}
52
53addtask filogic_patches after do_patch before do_compile
54
55do_configure () {
56 ${MAKE} -C wpa_supplicant clean
57
58 # For rebuild
59 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
60}
61
62do_configure_append () {
63 # from Openwrt defconfig
64 install -m 0644 ${WORKDIR}/wpa_supplicant-full.config wpa_supplicant/.config
65
66 # RDKB
67 echo "CONFIG_BUILD_WPA_CLIENT_SO=y" >> wpa_supplicant/.config
68
69 # mtk add
70 echo "CONFIG_MBO=y" >> wpa_supplicant/.config
71 echo "CONFIG_WPS_UPNP=y" >> wpa_supplicant/.config
72 echo "CONFIG_DPP=y" >> wpa_supplicant/.config
73 echo "CONFIG_DPP2=y" >> wpa_supplicant/.config
74 echo "CONFIG_DPP3=y" >> wpa_supplicant/.config
75
76 # OpenWRT hostapd Makefile add
77 echo "CONFIG_ACS=y" >> wpa_supplicant/.config
78 echo "CONFIG_IEEE80211AX=y" >> wpa_supplicant/.config
79 echo "CONFIG_TLS=openssl" >> wpa_supplicant/.config
80 echo "CONFIG_SAE=y" >> wpa_supplicant/.config
81 echo "CONFIG_OWE=y" >> wpa_supplicant/.config
82 echo "CONFIG_SUITEB192=y" >> wpa_supplicant/.config
83 echo "CONFIG_WEP=y" >> wpa_supplicant/.config
84 echo "CONFIG_AP=y" >> wpa_supplicant/.config
85 echo "CONFIG_MESH=y" >> wpa_supplicant/.config
developer78848c62023-04-06 13:44:00 +080086 echo "CONFIG_IEEE80211BE=y" >> wpa_supplicant/.config
developer2a209692023-08-14 20:23:42 +080087 echo "CONFIG_IEEE80211AC=y" >> wpa_supplicant/.config
developer78848c62023-04-06 13:44:00 +080088 echo "CONFIG_HE_OVERRIDES=y" >> wpa_supplicant/.config
89 echo "CONFIG_EHT_OVERRIDES=y" >> wpa_supplicant/.config
developer2a209692023-08-14 20:23:42 +080090 echo "CONFIG_UCODE=y" >> wpa_supplicant/.config
developer29c4d2d2022-12-26 19:41:22 +080091}
92
93do_compile () {
94 oe_runmake -C wpa_supplicant
95 oe_runmake -C wpa_supplicant libwpa_client.a
96}
97
98do_install () {
99 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
100
101 install -d ${D}${docdir}/wpa_supplicant
102 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
103
104 install -d ${D}${sysconfdir}
105 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
106
107 install -d ${D}${sysconfdir}/network/if-pre-up.d/
108 install -d ${D}${sysconfdir}/network/if-post-down.d/
109 install -d ${D}${sysconfdir}/network/if-down.d/
110 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
111 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
112
113 install -d ${D}/${sysconfdir}/dbus-1/system.d
114 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
115 install -d ${D}/${datadir}/dbus-1/system-services
116 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
117
118 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
119 install -d ${D}/${systemd_system_unitdir}
120 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
121 fi
122
123 install -d ${D}/etc/default/volatiles
124 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
125
126 install -d ${D}${includedir}
127 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
128
129 install -d ${D}${libdir}
130 install -m 0644 ${S}/wpa_supplicant/libwpa_client.so ${D}${libdir}
developer2a209692023-08-14 20:23:42 +0800131
132 install -d ${D}${datadir}/hostap
133 install -m 0755 ${WORKDIR}/wpa_supplicant.uc ${D}${datadir}/hostap
developer29c4d2d2022-12-26 19:41:22 +0800134}
135
136pkg_postinst:${PN} () {
137 # If we're offline, we don't need to do this.
138 if [ "x$D" = "x" ]; then
139 killall -q -HUP dbus-daemon || true
140 fi
141}
142
143PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
144PACKAGES =+ "${PN}-lib"
145PACKAGES += "${PN}-plugins"
146ALLOW_EMPTY:${PN}-plugins = "1"
147
148PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
149NOAUTOPACKAGEDEBUG = "1"
150
151FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
152FILES:${PN}-cli = "${sbindir}/wpa_cli"
developer2a209692023-08-14 20:23:42 +0800153FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/* ${datadir}/hostap/*"
developer29c4d2d2022-12-26 19:41:22 +0800154FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
155
156CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
157
158RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
159
160SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
161SYSTEMD_AUTO_ENABLE = "disable"
162
163# move from cmf
164FILES_SOLIBSDEV = ""
165FILES_${PN} += "${libdir}/libwpa_client.so"
166