blob: cb614bc1abd5ad502b07977e11fe1526bcf63998 [file] [log] [blame]
developer2b1cf5c2022-06-15 19:38:55 +08001SUMMARY = "Wireless Central Regulatory Domain Database"
2HOMEPAGE = "https://wireless.wiki.kernel.org/en/developers/regulatory/crda"
3SECTION = "net"
4LICENSE = "ISC"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c"
6
7SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz"
developer42c7a432024-07-12 14:39:29 +08008SRC_URI[sha256sum] = "9832a14e1be24abff7be30dee3c9a1afb5fdfcf475a0d91aafef039f8d85f5eb"
developer2b1cf5c2022-06-15 19:38:55 +08009
10FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
11require files/patches/patches.inc
12
developer93e97202024-01-17 12:29:44 +080013inherit bin_package allarch ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)}
developerdac0b652022-08-29 10:24:26 +080014
15S = "${WORKDIR}/${PN}-${PV}"
16
17do_install_prepend() {
18 (python ${S}/db2fw.py ${S}/regulatory.db ${S}/db.txt)
19}
developer2b1cf5c2022-06-15 19:38:55 +080020
21do_install() {
22 install -d -m0755 ${D}${nonarch_libdir}/crda
23 install -d -m0755 ${D}${sysconfdir}/wireless-regdb/pubkeys
24 install -m 0644 regulatory.bin ${D}${nonarch_libdir}/crda/regulatory.bin
developer753619c2024-02-22 13:42:45 +080025 install -m 0644 wens.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/wens.key.pub.pem
developer2b1cf5c2022-06-15 19:38:55 +080026
27 install -m 0644 -D regulatory.db ${D}${nonarch_base_libdir}/firmware/regulatory.db
28 install -m 0644 regulatory.db.p7s ${D}${nonarch_base_libdir}/firmware/regulatory.db.p7s
29}
30
31# Install static regulatory DB in /lib/firmware for kernel to load.
32# This requires Linux kernel >= v4.15.
33# For kernel <= v4.14, inherit the kernel_wireless_regdb.bbclass
34# (in meta-networking) in kernel's recipe.
35PACKAGES = "${PN}-static ${PN}"
36RCONFLICTS:${PN} = "${PN}-static"
37
38FILES:${PN}-static = " \
39 ${nonarch_base_libdir}/firmware/regulatory.db \
40 ${nonarch_base_libdir}/firmware/regulatory.db.p7s \
41"
42
43# Native users might want to use the source of regulatory DB.
44# This is for example used by Linux kernel <= v4.14 and
45# kernel_wireless_regdb.bbclass in meta-networking.
46do_install:append:class-native() {
47 install -m 0644 -D db.txt ${D}${libdir}/crda/db.txt
48}
49
50RSUGGESTS:${PN} = "crda"
51
52BBCLASSEXTEND = "native"