On 7/5/18 9:55 AM, Krzysztof Kozlowski wrote:
> Linux kernels before v4.15, allowed to be compiled with static
> regulatory dabatase 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.

I think it will be good to add this in comments in bbclass as well.

> 
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
>  meta-networking/classes/kernel_wireless_regdb.bbclass         | 11 
> +++++++++++
>  .../wireless-regdb/wireless-regdb_2018.05.31.bb               | 10 ++++++++++
>  2 files changed, 21 insertions(+)
>  create mode 100644 meta-networking/classes/kernel_wireless_regdb.bbclass
> 
> diff --git a/meta-networking/classes/kernel_wireless_regdb.bbclass 
> b/meta-networking/classes/kernel_wireless_regdb.bbclass
> new file mode 100644
> index 000000000000..a1eb4c532667
> --- /dev/null
> +++ b/meta-networking/classes/kernel_wireless_regdb.bbclass
> @@ -0,0 +1,11 @@
> +# Copies the regulatory plaintext database to kernel sources before 
> compiling.
> +# Linux kernel must be compiled with CONFIG_CFG80211_INTERNAL_REGDB to use 
> it.
> +
> +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
> 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 d40756ff2bbf..0b7930718761 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
> @@ -23,6 +23,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"
>  
> @@ -31,4 +32,13 @@ 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 -d -m 0755 ${D}${libdir}/crda

add -D to below cmd and you can avoid this line.

> +    install -m 0644 db.txt ${D}${libdir}/crda/db.txt
> +}
> +
>  RSUGGESTS_${PN} = "crda"
> +
> +BBCLASSEXTEND = "native"
> 


Attachment: signature.asc
Description: OpenPGP digital signature

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to