blob: 403580530d59b8b9bb145100d9f29dd3b6303c55 [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"
8SRC_URI[sha256sum] = "ac00f97efecce5046ed069d1d93f3365fdf994c7c7854a8fc50831e959537230"
9
10FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:"
11require files/patches/patches.inc
12
13inherit bin_package allarch
14
15do_install() {
16 install -d -m0755 ${D}${nonarch_libdir}/crda
17 install -d -m0755 ${D}${sysconfdir}/wireless-regdb/pubkeys
18 install -m 0644 regulatory.bin ${D}${nonarch_libdir}/crda/regulatory.bin
19 install -m 0644 sforshee.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/sforshee.key.pub.pem
20
21 install -m 0644 -D regulatory.db ${D}${nonarch_base_libdir}/firmware/regulatory.db
22 install -m 0644 regulatory.db.p7s ${D}${nonarch_base_libdir}/firmware/regulatory.db.p7s
23}
24
25# Install static regulatory DB in /lib/firmware for kernel to load.
26# This requires Linux kernel >= v4.15.
27# For kernel <= v4.14, inherit the kernel_wireless_regdb.bbclass
28# (in meta-networking) in kernel's recipe.
29PACKAGES = "${PN}-static ${PN}"
30RCONFLICTS:${PN} = "${PN}-static"
31
32FILES:${PN}-static = " \
33 ${nonarch_base_libdir}/firmware/regulatory.db \
34 ${nonarch_base_libdir}/firmware/regulatory.db.p7s \
35"
36
37# Native users might want to use the source of regulatory DB.
38# This is for example used by Linux kernel <= v4.14 and
39# kernel_wireless_regdb.bbclass in meta-networking.
40do_install:append:class-native() {
41 install -m 0644 -D db.txt ${D}${libdir}/crda/db.txt
42}
43
44RSUGGESTS:${PN} = "crda"
45
46BBCLASSEXTEND = "native"