blob: ebc282fc22c338ff6f458cd11033b0615fcf1d2b [file] [log] [blame]
developer837fd292022-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"
developerdfb50982023-09-11 13:34:36 +08008SRC_URI[sha256sum] = "26d4c2a727cc59239b84735aad856b7c7d0b04e30aa5c235c4f7f47f5f053491"
developer837fd292022-06-15 19:38:55 +08009
10FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
11require files/patches/patches.inc
12
developer758b7552024-01-17 12:29:44 +080013inherit bin_package allarch ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)}
developere13ffc72022-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}
developer837fd292022-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
25 install -m 0644 sforshee.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/sforshee.key.pub.pem
26
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"