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" |
developer | 33907d4 | 2022-09-19 14:33:58 +0800 | [diff] [blame] | 8 | SRC_URI[sha256sum] = "59c8f7d17966db71b27f90e735ee8f5b42ca3527694a8c5e6e9b56bd379c3b84" |
developer | 837fd29 | 2022-06-15 19:38:55 +0800 | [diff] [blame] | 9 | |
| 10 | FILESEXTRAPATHS_prepend := "${THISDIR}/files/patches:" |
| 11 | require files/patches/patches.inc |
| 12 | |
developer | e13ffc7 | 2022-08-29 10:24:26 +0800 | [diff] [blame] | 13 | inherit bin_package allarch pythonnative |
| 14 | |
| 15 | S = "${WORKDIR}/${PN}-${PV}" |
| 16 | |
| 17 | do_install_prepend() { |
| 18 | (python ${S}/db2fw.py ${S}/regulatory.db ${S}/db.txt) |
| 19 | } |
developer | 837fd29 | 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 |
| 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. |
| 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" |