blob: 5b8bdd2b88707a9436f183879b8ac0e72cd1f6d5 [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"
developer05f3b2b2024-08-19 19:17:34 +08007LIC_FILES_CHKSUM = "file://hostapd/README;md5=0e430ef1be3d6eebf257cf493fc7661d"
developerf2e3f562022-12-26 19:41:22 +08008
developer1a173672023-12-21 14:49:33 +08009DEPENDS = "dbus libnl-tiny ubus ucode udebug"
developerf2e3f562022-12-26 19:41:22 +080010FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
11FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches-${PV}:"
12
developer05f3b2b2024-08-19 19:17:34 +080013SRCREV ?= "7e0e69cfeac300414ef0492bc76a2aa164443249"
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 \
developer05f3b2b2024-08-19 19:17:34 +080022 file://003-fix_wpa_supplicant_build_issue.patch;apply=no \
developerf2e3f562022-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
developerf2e3f562022-12-26 19:41:22 +080037do_filogic_patches() {
38 cd ${S}
39 if [ ! -e patch_applied ]; then
developerf0fd7052023-08-14 20:23:42 +080040 patch -p1 < ${WORKDIR}/002-rdkb-add-ucode-support.patch
developer05f3b2b2024-08-19 19:17:34 +080041 patch -p1 < ${WORKDIR}/003-fix_wpa_supplicant_build_issue.patch
developerf2e3f562022-12-26 19:41:22 +080042 touch patch_applied
43 fi
44}
45
46addtask filogic_patches after do_patch before do_compile
47
48do_configure () {
49 ${MAKE} -C wpa_supplicant clean
50
51 # For rebuild
52 rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
53}
54
55do_configure_append () {
56 # from Openwrt defconfig
57 install -m 0644 ${WORKDIR}/wpa_supplicant-full.config wpa_supplicant/.config
58
59 # RDKB
60 echo "CONFIG_BUILD_WPA_CLIENT_SO=y" >> wpa_supplicant/.config
developer4697a312023-11-30 15:52:52 +080061 echo "CFLAGS +=-I${STAGING_INCDIR}/libnl-tiny -D_GNU_SOURCE" >> wpa_supplicant/.config
62 echo "DRV_CFLAGS +=-I${STAGING_INCDIR}/libnl-tiny" >> wpa_supplicant/.config
developerf2e3f562022-12-26 19:41:22 +080063 # mtk add
64 echo "CONFIG_MBO=y" >> wpa_supplicant/.config
65 echo "CONFIG_WPS_UPNP=y" >> wpa_supplicant/.config
66 echo "CONFIG_DPP=y" >> wpa_supplicant/.config
67 echo "CONFIG_DPP2=y" >> wpa_supplicant/.config
68 echo "CONFIG_DPP3=y" >> wpa_supplicant/.config
69
70 # OpenWRT hostapd Makefile add
71 echo "CONFIG_ACS=y" >> wpa_supplicant/.config
72 echo "CONFIG_IEEE80211AX=y" >> wpa_supplicant/.config
73 echo "CONFIG_TLS=openssl" >> wpa_supplicant/.config
74 echo "CONFIG_SAE=y" >> wpa_supplicant/.config
75 echo "CONFIG_OWE=y" >> wpa_supplicant/.config
76 echo "CONFIG_SUITEB192=y" >> wpa_supplicant/.config
77 echo "CONFIG_WEP=y" >> wpa_supplicant/.config
78 echo "CONFIG_AP=y" >> wpa_supplicant/.config
79 echo "CONFIG_MESH=y" >> wpa_supplicant/.config
developerda18a742023-04-06 13:44:00 +080080 echo "CONFIG_IEEE80211BE=y" >> wpa_supplicant/.config
developerf0fd7052023-08-14 20:23:42 +080081 echo "CONFIG_IEEE80211AC=y" >> wpa_supplicant/.config
developerda18a742023-04-06 13:44:00 +080082 echo "CONFIG_HE_OVERRIDES=y" >> wpa_supplicant/.config
83 echo "CONFIG_EHT_OVERRIDES=y" >> wpa_supplicant/.config
developerf0fd7052023-08-14 20:23:42 +080084 echo "CONFIG_UCODE=y" >> wpa_supplicant/.config
developer4697a312023-11-30 15:52:52 +080085 echo "CONFIG_LIBNL20=y" >> wpa_supplicant/.config
86 echo "CONFIG_LIBNL_TINY=y" >> wpa_supplicant/.config
developer05f3b2b2024-08-19 19:17:34 +080087 echo "CONFIG_TESTING_OPTIONS=y" >> wpa_supplicant/.config
88 echo "CONFIG_SAE_PK=y" >> wpa_supplicant/.config
89 echo "CONFIG_HS20=y" >> wpa_supplicant/.config
90 echo "CONFIG_HE_OVERRIDES=y" >> wpa_supplicant/.config
91 echo "CONFIG_EHT_OVERRIDES=y" >> wpa_supplicant/.config
developerf2e3f562022-12-26 19:41:22 +080092}
93
94do_compile () {
95 oe_runmake -C wpa_supplicant
96 oe_runmake -C wpa_supplicant libwpa_client.a
97}
98
99do_install () {
100 oe_runmake -C wpa_supplicant DESTDIR="${D}" install
101
102 install -d ${D}${docdir}/wpa_supplicant
103 install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
104
105 install -d ${D}${sysconfdir}
106 install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
107
108 install -d ${D}${sysconfdir}/network/if-pre-up.d/
109 install -d ${D}${sysconfdir}/network/if-post-down.d/
110 install -d ${D}${sysconfdir}/network/if-down.d/
111 install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
112 ln -sf ../if-pre-up.d/wpa-supplicant ${D}${sysconfdir}/network/if-post-down.d/wpa-supplicant
113
114 install -d ${D}/${sysconfdir}/dbus-1/system.d
115 install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
116 install -d ${D}/${datadir}/dbus-1/system-services
117 install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
118
119 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
120 install -d ${D}/${systemd_system_unitdir}
121 install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_system_unitdir}
122 fi
123
124 install -d ${D}/etc/default/volatiles
125 install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
126
127 install -d ${D}${includedir}
128 install -m 0644 ${S}/src/common/wpa_ctrl.h ${D}${includedir}
129
130 install -d ${D}${libdir}
131 install -m 0644 ${S}/wpa_supplicant/libwpa_client.so ${D}${libdir}
132}
133
134pkg_postinst:${PN} () {
135 # If we're offline, we don't need to do this.
136 if [ "x$D" = "x" ]; then
137 killall -q -HUP dbus-daemon || true
138 fi
139}
140
141PACKAGE_BEFORE_PN += "${PN}-passphrase ${PN}-cli"
142PACKAGES =+ "${PN}-lib"
143PACKAGES += "${PN}-plugins"
144ALLOW_EMPTY:${PN}-plugins = "1"
145
146PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
147NOAUTOPACKAGEDEBUG = "1"
148
149FILES:${PN}-passphrase = "${sbindir}/wpa_passphrase"
150FILES:${PN}-cli = "${sbindir}/wpa_cli"
developerf0fd7052023-08-14 20:23:42 +0800151FILES:${PN} += "${datadir}/dbus-1/system-services/* ${systemd_system_unitdir}/* ${datadir}/hostap/*"
developerf2e3f562022-12-26 19:41:22 +0800152FILES:${PN}-dbg += "${sbindir}/.debug ${libdir}/.debug"
153
154CONFFILES:${PN} += "${sysconfdir}/wpa_supplicant.conf"
155
156RRECOMMENDS:${PN} = "${PN}-passphrase ${PN}-cli ${PN}-plugins"
157
158SYSTEMD_SERVICE:${PN} = "wpa_supplicant.service"
159SYSTEMD_AUTO_ENABLE = "disable"
160
161# move from cmf
162FILES_SOLIBSDEV = ""
163FILES_${PN} += "${libdir}/libwpa_client.so"
164