mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2025-12-14 22:35:25 +01:00
kernel_wireless_regdb: Add class for embedding regulatory data into older kernel
Linux kernels before v4.15, allowed to be compiled with static regulatory database if it was put under net/wireless/db.txt. Add kernel_wireless_regdb class which allows in such cases to embed the wireless regulatory database directly in the Linux kernel during build process. Usage: 1. The class should be inherited by kernel recipe (e.g. in linux-yocto_%.bbappend). 2. For Linux kernels up to v4.14, build kernel with CONFIG_EXPERT and CONFIG_CFG80211_INTERNAL_REGDB. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
20e3c3e2e4
commit
8603b7643b
20
meta-networking/classes/kernel_wireless_regdb.bbclass
Normal file
20
meta-networking/classes/kernel_wireless_regdb.bbclass
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Linux kernels before v4.15, allowed to be compiled with static
|
||||
# regulatory database if it was put under net/wireless/db.txt.
|
||||
#
|
||||
# This class copies the regulatory plaintext database to kernel sources before
|
||||
# compiling.
|
||||
#
|
||||
# Usage:
|
||||
# 1. The class should be inherited by kernel recipe (e.g. in
|
||||
# linux-yocto_%.bbappend).
|
||||
# 2. For Linux kernels up to v4.14, build kernel with CONFIG_EXPERT and
|
||||
# CONFIG_CFG80211_INTERNAL_REGDB.
|
||||
|
||||
DEPENDS += "wireless-regdb-native"
|
||||
|
||||
SRCTREECOVEREDTASKS += "do_kernel_add_regdb"
|
||||
do_kernel_add_regdb() {
|
||||
cp ${STAGING_LIBDIR_NATIVE}/crda/db.txt ${S}/net/wireless/db.txt
|
||||
}
|
||||
do_kernel_add_regdb[dirs] = "${S}"
|
||||
addtask kernel_add_regdb before do_build after do_configure
|
||||
|
|
@ -22,6 +22,7 @@ do_install() {
|
|||
|
||||
# Install static regulatory DB in /lib/firmware for kernel to load.
|
||||
# This requires Linux kernel >= v4.15.
|
||||
# For kernel <= v4.14, inherit the kernel_wireless_regdb.bbclass in kernel's recipe.
|
||||
PACKAGES =+ "${PN}-static"
|
||||
RCONFLICTS_${PN} = "${PN}-static"
|
||||
|
||||
|
|
@ -30,4 +31,12 @@ FILES_${PN}-static = " \
|
|||
${nonarch_base_libdir}/firmware/regulatory.db.p7s \
|
||||
"
|
||||
|
||||
# Native users might want to use the source of regulatory DB.
|
||||
# This is for example used by Linux kernel <= v4.14 and kernel_wireless_regdb.bbclass.
|
||||
do_install_append_class-native() {
|
||||
install -m 0644 -D db.txt ${D}${libdir}/crda/db.txt
|
||||
}
|
||||
|
||||
RSUGGESTS_${PN} = "crda"
|
||||
|
||||
BBCLASSEXTEND = "native"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user