xref: /openbmc/openbmc/meta-openembedded/meta-networking/classes/kernel_wireless_regdb.bbclass (revision c5535c91408e2c3f8231c10f6b00eaaee7c88717)
11a4b7ee2SBrad Bishop# Linux kernels before v4.15, allowed to be compiled with static
21a4b7ee2SBrad Bishop# regulatory database if it was put under net/wireless/db.txt.
31a4b7ee2SBrad Bishop#
41a4b7ee2SBrad Bishop# This class copies the regulatory plaintext database to kernel sources before
51a4b7ee2SBrad Bishop# compiling.
61a4b7ee2SBrad Bishop#
71a4b7ee2SBrad Bishop# Usage:
81a4b7ee2SBrad Bishop# 1. The class should be inherited by kernel recipe (e.g. in
91a4b7ee2SBrad Bishop#    linux-yocto_%.bbappend).
101a4b7ee2SBrad Bishop# 2. For Linux kernels up to v4.14, build kernel with CONFIG_EXPERT and
111a4b7ee2SBrad Bishop#    CONFIG_CFG80211_INTERNAL_REGDB.
121a4b7ee2SBrad Bishop
131a4b7ee2SBrad BishopDEPENDS += "wireless-regdb-native"
141a4b7ee2SBrad Bishop
151a4b7ee2SBrad BishopSRCTREECOVEREDTASKS += "do_kernel_add_regdb"
161a4b7ee2SBrad Bishopdo_kernel_add_regdb() {
171a4b7ee2SBrad Bishop    cp ${STAGING_LIBDIR_NATIVE}/crda/db.txt ${S}/net/wireless/db.txt
181a4b7ee2SBrad Bishop}
191a4b7ee2SBrad Bishopdo_kernel_add_regdb[dirs] = "${S}"
20*c5535c91SAndrew Geissleraddtask kernel_add_regdb before do_compile after do_configure
21