blob: d23af12596a424f24cbdea0be4930f0c8b592c88 [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"
developerc07d01e2023-05-05 13:45:43 +08008SRC_URI[sha256sum] = "f254d08ab3765aeae2b856222e11a95d44aef519a6663877c71ef68fae4c8c12"
developer837fd292022-06-15 19:38:55 +08009
10FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
11require files/patches/patches.inc
12
developere13ffc72022-08-29 10:24:26 +080013inherit bin_package allarch pythonnative
14
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"