blob: e23b9c3fb66a3f7d694615ba0771387affed6a5d [file] [log] [blame]
developerf2e3f562022-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
developer4697a312023-11-30 15:52:52 +08009DEPENDS = "dbus libnl-tiny ubus ucode"
developerf2e3f562022-12-26 19:41:22 +080010FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
11FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches-${PV}:"
12
developerbd9fa1e2023-10-16 11:04:00 +080013SRCREV ?= "e5ccbfc69ecf297590341ae8b461edba9d8e964c"
developerf2e3f562022-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 \
developerf0fd7052023-08-14 20:23:42 +080020 file://src-${PV} \
21 file://002-rdkb-add-ucode-support.patch;apply=no \
developerf2e3f562022-12-26 19:41:22 +080022 "
23require files/patches-${PV}/patches.inc
24
25S = "${WORKDIR}/git"
26
27inherit pkgconfig systemd
28
29PACKAGECONFIG ?= "openssl"
30PACKAGECONFIG[openssl] = ",,openssl"
31
32CVE_PRODUCT = "wpa_supplicant"
33
34EXTRA_OEMAKE = "'LIBDIR=${libdir}' 'INCDIR=${includedir}' 'BINDIR=${sbindir}'"
35
36do_unpack_append() {
37 bb.build.exec_func('do_copy_openwrt_src', d)
38}
39
40do_copy_openwrt_src() {
developerf0fd7052023-08-14 20:23:42 +080041 cp -Rfp ${WORKDIR}/src-${PV}/* ${S}/
developerf2e3f562022-12-26 19:41:22 +080042}
43
44do_filogic_patches() {
45 cd ${S}
46 if [ ! -e patch_applied ]; then
developerf0fd7052023-08-14 20:23:42 +080047 patch -p1 < ${WORKDIR}/002-rdkb-add-ucode-support.patch
developerf2e3f562022-12-26 19:41:22 +080048 touch patch_applied
49 fi
50}
51
52addtask filogic_patches after do_patch before do_compile
53
54do_configure () {
55 ${MAKE} -C wpa_supplicant clean
56
57 # For rebuild
58 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
59}
60
61do_configure_append () {
62 # from Openwrt defconfig
63 install -m 0644 ${WORKDIR}/wpa_supplicant-full.config wpa_supplicant/.config
64
65 # RDKB
66 echo "CONFIG_BUILD_WPA_CLIENT_SO=y" >> wpa_supplicant/.config
developer4697a312023-11-30 15:52:52 +080067 echo "CFLAGS +=-I${STAGING_INCDIR}/libnl-tiny -D_GNU_SOURCE" >> wpa_supplicant/.config
68 echo "DRV_CFLAGS +=-I${STAGING_INCDIR}/libnl-tiny" >> wpa_supplicant/.config
developerf2e3f562022-12-26 19:41:22 +080069 # 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
developerda18a742023-04-06 13:44:00 +080086 echo "CONFIG_IEEE80211BE=y" >> wpa_supplicant/.config
developerf0fd7052023-08-14 20:23:42 +080087 echo "CONFIG_IEEE80211AC=y" >> wpa_supplicant/.config
developerda18a742023-04-06 13:44:00 +080088 echo "CONFIG_HE_OVERRIDES=y" >> wpa_supplicant/.config
89 echo "CONFIG_EHT_OVERRIDES=y" >> wpa_supplicant/.config
developerf0fd7052023-08-14 20:23:42 +080090 echo "CONFIG_UCODE=y" >> wpa_supplicant/.config
developer4697a312023-11-30 15:52:52 +080091 echo "CONFIG_LIBNL20=y" >> wpa_supplicant/.config
92 echo "CONFIG_LIBNL_TINY=y" >> wpa_supplicant/.config
developerf2e3f562022-12-26 19:41:22 +080093}
94
95do_compile () {
96 oe_runmake -C wpa_supplicant
97 oe_runmake -C wpa_supplicant libwpa_client.a
98}
99
100do_install () {
101 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
102
103 install -d ${D}${docdir}/wpa_supplicant
104 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
105
106 install -d ${D}${sysconfdir}
107 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
108
109 install -d ${D}${sysconfdir}/network/if-pre-up.d/
110 install -d ${D}${sysconfdir}/network/if-post-down.d/
111 install -d ${D}${sysconfdir}/network/if-down.d/
112 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
113 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
114
115 install -d ${D}/${sysconfdir}/dbus-1/system.d
116 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
117 install -d ${D}/${datadir}/dbus-1/system-services
118 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
119
120 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
121 install -d ${D}/${systemd_system_unitdir}
122 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
123 fi
124
125 install -d ${D}/etc/default/volatiles
126 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
127
128 install -d ${D}${includedir}
129 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
130
131 install -d ${D}${libdir}
132 install -m 0644 ${S}/wpa_supplicant/libwpa_client.so ${D}${libdir}
133}
134
135pkg_postinst:${PN} () {
136 # If we're offline, we don't need to do this.
137 if [ "x$D" = "x" ]; then
138 killall -q -HUP dbus-daemon || true
139 fi
140}
141
142PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
143PACKAGES =+ "${PN}-lib"
144PACKAGES += "${PN}-plugins"
145ALLOW_EMPTY:${PN}-plugins = "1"
146
147PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
148NOAUTOPACKAGEDEBUG = "1"
149
150FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
151FILES:${PN}-cli = "${sbindir}/wpa_cli"
developerf0fd7052023-08-14 20:23:42 +0800152FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/* ${datadir}/hostap/*"
developerf2e3f562022-12-26 19:41:22 +0800153FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
154
155CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
156
157RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
158
159SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
160SYSTEMD_AUTO_ENABLE = "disable"
161
162# move from cmf
163FILES_SOLIBSDEV = ""
164FILES_${PN} += "${libdir}/libwpa_client.so"
165