developer | 837fd29 | 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" |
| 8 | SRC_URI[sha256sum] = "ac00f97efecce5046ed069d1d93f3365fdf994c7c7854a8fc50831e959537230" |
| 9 | |
| 10 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
| 11 | require files/patches/patches.inc |
| 12 | |
| 13 | inherit bin_package allarch |
| 14 | |
| 15 | do_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. |
| 29 | PACKAGES = "${PN}-static ${PN}" |
| 30 | RCONFLICTS:${PN} = "${PN}-static" |
| 31 | |
| 32 | FILES:${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. |
| 40 | do_install:append:class-native() { |
| 41 | install -m 0644 -D db.txt ${D}${libdir}/crda/db.txt |
| 42 | } |
| 43 | |
| 44 | RSUGGESTS:${PN} = "crda" |
| 45 | |
| 46 | BBCLASSEXTEND = "native" |