Skip to content

Commit

Permalink
Merge pull request #2204 from pentoo/wireless-regdb
Browse files Browse the repository at this point in the history
wireless-regdb: fork for custom build and minor fix
  • Loading branch information
github-actions[bot] authored Jan 17, 2025
2 parents 0821286 + 5351aab commit aa2d370
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions net-wireless/wireless-regdb/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST wireless-regdb-2023.05.03.tar.xz 27260 BLAKE2B e880be3bacd7409719ede3e104ea6af870e0fb4edaefa6c61615ca74a8169a159348d631a4c296e273f6cc6e01ced2089e56c10080dd15a7439d8b4510eff7b8 SHA512 9de4852a1d351c11399ca55ea2ad61be23f488c61595b5c5afa3498d76488adc8120c6c77644275c460efcd1bb5bb68fa25597e73bec22ae847321bb55f7af27
DIST wireless-regdb-2024.05.08.tar.xz 27716 BLAKE2B 223268c6ba9e3f616b28a9317d62ac687cd09c9ff3cc8e0d0827b3a59efa7b3bc64c0c094b70aaceb87cffba7d36d36d550c001d0778238adcf2ac5cbe3f6b93 SHA512 edb562d708be7119e80bb48d7520c11e409b81178168f9c6873ea97a2e4d9277d02d3b72b1af9f0302ba2e252d94d14c4468ee4cc1a6bb186a17d74c57d7594d
86 changes: 86 additions & 0 deletions net-wireless/wireless-regdb/wireless-regdb-20240508.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit linux-info python-utils-r1

MY_P="wireless-regdb-${PV:0:4}.${PV:4:2}.${PV:6:2}"
DESCRIPTION="Wireless Regulatory database for Linux"
HOMEPAGE="https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb"
SRC_URI="https://mirrors.edge.kernel.org/pub/software/network/${PN}/${MY_P}.tar.xz"
S="${WORKDIR}/${MY_P}"

LICENSE="ISC"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv sparc x86"
REQUIRED_USE="kernel_linux"
IUSE="pentoo"

BDEPEND="${PYTHON_DEPS}
pentoo? ( dev-python/m2crypto )"

python_check_deps() {
if use pentoo; then
python_has_version "dev-python/m2crypto"
fi
}

pkg_pretend() {
if kernel_is -ge 4 15; then
if linux_config_exists; then
if linux_chkconfig_builtin CFG80211 &&
[[ $(linux_chkconfig_string EXTRA_FIRMWARE) != *regulatory.db* ]]; then
ewarn "REGULATORY DOMAIN PROBLEM:"
ewarn " With CONFIG_CFG80211=y (built-in), the driver(s) won't be able to load regulatory.db from"
ewarn " /lib/firmware, resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m"
ewarn " or add regulatory.db and regulatory.db.p7s to CONFIG_EXTRA_FIRMWARE."
fi
if ! linux_chkconfig_present CFG80211; then
ewarn "REGULATORY DOMAIN PROBLEM:"
ewarn " With CONFIG_CFG80211 unset, the driver(s) won't be able to load the regulatory.db from"
ewarn " /lib/firmware, resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m."
fi
if linux_chkconfig_present EXPERT && linux_chkconfig_present CFG80211_CRDA_SUPPORT; then
ewarn "You can safely disable CFG80211_CRDA_SUPPORT"
fi
fi
else
CONFIG_CHECK="~CFG80211_CRDA_SUPPORT"
WARNING_CFG80211_CRDA_SUPPORT="REGULATORY DOMAIN PROBLEM: \
please enable CFG80211_CRDA_SUPPORT for proper regulatory domain support"
fi

check_extra_config
}

src_prepare() {
if use pentoo; then
eapply "${FILESDIR}"/no-no-ir.patch
fi
default
}

src_compile() {
if use pentoo; then
emake clean
LSB_ID="Pentoo" emake -j1 --shuffle=none install-distro-key || die "make install-distro-key failed"
LSB_ID="Pentoo" emake -j1 --shuffle=none || die "emake failed"
#emake -j1 --shuffle=none regulatory.db
#emake -j1 --shuffle=none regulatory.db.p7s
else
einfo "Recompiling regulatory database(s) from db.txt would break signature verification."
einfo "Installing unmodified binary version."
fi
}

src_install() {
# install the files the kernel needs unconditionally,
# they are small and kernels get upgraded
insinto /lib/firmware
doins regulatory.db regulatory.db.p7s

# regulatory.db.5 is a reference to regulatory.bin.5 so you need both unconditionally
doman -i18n= regulatory.db.5 regulatory.bin.5
dodoc README db.txt
}

0 comments on commit aa2d370

Please sign in to comment.