diff options
| author | Krzysztof Kozlowski <krzk@kernel.org> | 2018-07-05 20:58:12 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2018-07-05 17:51:16 -0700 |
| commit | 8603b7643b9025bf88dd55165ec808c4cea144e3 (patch) | |
| tree | f18a49be2731f0073fc4412a4cd1ee3132f910fd | |
| parent | 20e3c3e2e435526c3666cf0bf6a1d06266337174 (diff) | |
| download | meta-openembedded-8603b7643b9025bf88dd55165ec808c4cea144e3.tar.gz | |
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>
| -rw-r--r-- | meta-networking/classes/kernel_wireless_regdb.bbclass | 20 | ||||
| -rw-r--r-- | meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2018.05.31.bb | 9 |
2 files changed, 29 insertions, 0 deletions
diff --git a/meta-networking/classes/kernel_wireless_regdb.bbclass b/meta-networking/classes/kernel_wireless_regdb.bbclass new file mode 100644 index 0000000000..1238172bd4 --- /dev/null +++ b/meta-networking/classes/kernel_wireless_regdb.bbclass | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | # Linux kernels before v4.15, allowed to be compiled with static | ||
| 2 | # regulatory database if it was put under net/wireless/db.txt. | ||
| 3 | # | ||
| 4 | # This class copies the regulatory plaintext database to kernel sources before | ||
| 5 | # compiling. | ||
| 6 | # | ||
| 7 | # Usage: | ||
| 8 | # 1. The class should be inherited by kernel recipe (e.g. in | ||
| 9 | # linux-yocto_%.bbappend). | ||
| 10 | # 2. For Linux kernels up to v4.14, build kernel with CONFIG_EXPERT and | ||
| 11 | # CONFIG_CFG80211_INTERNAL_REGDB. | ||
| 12 | |||
| 13 | DEPENDS += "wireless-regdb-native" | ||
| 14 | |||
| 15 | SRCTREECOVEREDTASKS += "do_kernel_add_regdb" | ||
| 16 | do_kernel_add_regdb() { | ||
| 17 | cp ${STAGING_LIBDIR_NATIVE}/crda/db.txt ${S}/net/wireless/db.txt | ||
| 18 | } | ||
| 19 | do_kernel_add_regdb[dirs] = "${S}" | ||
| 20 | addtask kernel_add_regdb before do_build after do_configure | ||
diff --git a/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2018.05.31.bb b/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2018.05.31.bb index 2ae9e85427..d1c8d56759 100644 --- a/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2018.05.31.bb +++ b/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2018.05.31.bb | |||
| @@ -22,6 +22,7 @@ do_install() { | |||
| 22 | 22 | ||
| 23 | # Install static regulatory DB in /lib/firmware for kernel to load. | 23 | # Install static regulatory DB in /lib/firmware for kernel to load. |
| 24 | # This requires Linux kernel >= v4.15. | 24 | # This requires Linux kernel >= v4.15. |
| 25 | # For kernel <= v4.14, inherit the kernel_wireless_regdb.bbclass in kernel's recipe. | ||
| 25 | PACKAGES =+ "${PN}-static" | 26 | PACKAGES =+ "${PN}-static" |
| 26 | RCONFLICTS_${PN} = "${PN}-static" | 27 | RCONFLICTS_${PN} = "${PN}-static" |
| 27 | 28 | ||
| @@ -30,4 +31,12 @@ FILES_${PN}-static = " \ | |||
| 30 | ${nonarch_base_libdir}/firmware/regulatory.db.p7s \ | 31 | ${nonarch_base_libdir}/firmware/regulatory.db.p7s \ |
| 31 | " | 32 | " |
| 32 | 33 | ||
| 34 | # Native users might want to use the source of regulatory DB. | ||
| 35 | # This is for example used by Linux kernel <= v4.14 and kernel_wireless_regdb.bbclass. | ||
| 36 | do_install_append_class-native() { | ||
| 37 | install -m 0644 -D db.txt ${D}${libdir}/crda/db.txt | ||
| 38 | } | ||
| 39 | |||
| 33 | RSUGGESTS_${PN} = "crda" | 40 | RSUGGESTS_${PN} = "crda" |
| 41 | |||
| 42 | BBCLASSEXTEND = "native" | ||
