developer | 2b1cf5c | 2022-06-15 19:38:55 +0800 | [diff] [blame] | 1 | SUMMARY = "Wireless Central Regulatory Domain Database" |
| 2 | HOMEPAGE = "https://wireless.wiki.kernel.org/en/developers/regulatory/crda" |
| 3 | SECTION = "net" |
| 4 | LICENSE = "ISC" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c" |
| 6 | |
| 7 | SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz" |
developer | 42c7a43 | 2024-07-12 14:39:29 +0800 | [diff] [blame^] | 8 | SRC_URI[sha256sum] = "9832a14e1be24abff7be30dee3c9a1afb5fdfcf475a0d91aafef039f8d85f5eb" |
developer | 2b1cf5c | 2022-06-15 19:38:55 +0800 | [diff] [blame] | 9 | |
| 10 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
| 11 | require files/patches/patches.inc |
| 12 | |
developer | 93e9720 | 2024-01-17 12:29:44 +0800 | [diff] [blame] | 13 | inherit bin_package allarch ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)} |
developer | dac0b65 | 2022-08-29 10:24:26 +0800 | [diff] [blame] | 14 | |
| 15 | S = "${WORKDIR}/${PN}-${PV}" |
| 16 | |
| 17 | do_install_prepend() { |
| 18 | (python ${S}/db2fw.py ${S}/regulatory.db ${S}/db.txt) |
| 19 | } |
developer | 2b1cf5c | 2022-06-15 19:38:55 +0800 | [diff] [blame] | 20 | |
| 21 | do_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 |
developer | 753619c | 2024-02-22 13:42:45 +0800 | [diff] [blame] | 25 | install -m 0644 wens.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/wens.key.pub.pem |
developer | 2b1cf5c | 2022-06-15 19:38:55 +0800 | [diff] [blame] | 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. |
| 35 | PACKAGES = "${PN}-static ${PN}" |
| 36 | RCONFLICTS:${PN} = "${PN}-static" |
| 37 | |
| 38 | FILES:${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. |
| 46 | do_install:append:class-native() { |
| 47 | install -m 0644 -D db.txt ${D}${libdir}/crda/db.txt |
| 48 | } |
| 49 | |
| 50 | RSUGGESTS:${PN} = "crda" |
| 51 | |
| 52 | BBCLASSEXTEND = "native" |