From 9110e80daf36f54c8c121852f98a6adc4369264d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 17 2022 10:28:59 +0000 Subject: import wireless-regdb-2020.11.20-6.el9 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a48d6d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/wireless-regdb-2020.11.20.tar.xz diff --git a/.wireless-regdb.metadata b/.wireless-regdb.metadata new file mode 100644 index 0000000..464d7ac --- /dev/null +++ b/.wireless-regdb.metadata @@ -0,0 +1 @@ +b7652a04b38e371282286863be0a587f79d29b60 SOURCES/wireless-regdb-2020.11.20.tar.xz diff --git a/SOURCES/85-regulatory.rules b/SOURCES/85-regulatory.rules new file mode 100644 index 0000000..705e765 --- /dev/null +++ b/SOURCES/85-regulatory.rules @@ -0,0 +1,5 @@ +# Set wireless regulatory domain at device creation +# For more information: +# man setregdomain + +SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/usr/sbin/setregdomain" diff --git a/SOURCES/setregdomain b/SOURCES/setregdomain new file mode 100755 index 0000000..74d885a --- /dev/null +++ b/SOURCES/setregdomain @@ -0,0 +1,69 @@ +#!/bin/sh +# +# Copyright 2009-2014 Red Hat, Inc. All rights reserved. +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +REGDOMAIN=/etc/sysconfig/regdomain +LOCALTIME=/etc/localtime + +LOGGER="/usr/bin/logger -t wireless" + +getcountry() { + while read c a z r + do + if [ "$z" = "$ZONE" ] + then + echo $c + break + fi + done < /usr/share/zoneinfo/zone.tab +} + +if [ -f $REGDOMAIN ] +then + # This should set COUNTRY + . $REGDOMAIN + if [ -n "$COUNTRY" ] + then + /usr/sbin/iw reg set $COUNTRY + exit + fi +fi + +if [ -f "$LOCALTIME" ] +then + ZONE=$(readlink -f $LOCALTIME) + ZONE=${ZONE#/usr/share/zoneinfo/} +else + $LOGGER -s "Timezone information not found! Unable to set regulatory domain." + exit 1 +fi + +if [ -z "$ZONE" -o "$ZONE" = "$LOCALTIME" ] +then + $LOGGER -s "Could not determine timezone! Unable to set regulatory domain." + exit 1 +fi + +COUNTRY=$(getcountry) + +if [ -z "$COUNTRY" ] +then + $LOGGER -s "Could not determine country! Unable to set regulatory domain." + exit 1 +fi + +$LOGGER "setting regulatory domain to $COUNTRY based on timezone ($ZONE)" +/usr/sbin/iw reg set $COUNTRY diff --git a/SOURCES/setregdomain.1 b/SOURCES/setregdomain.1 new file mode 100644 index 0000000..e246275 --- /dev/null +++ b/SOURCES/setregdomain.1 @@ -0,0 +1,36 @@ +.\" Copyright 2009 Red Hat, Inc. +.TH segregdomain 1 2014-11-19 "CRDA" "User Commands" +.SH NAME +setregdomain \- set regulatory domain based on country code +.SH SYNOPSIS +.B setregdomain +.SH DESCRIPTION +setregdomain sets the regulatory domain for your system; it takes no +arguments and is normally called via system script (eg, udev) rather +than manually by an administrator. + +The regulatory domain is represented by an ISO / IEC 3166-1 alpha2 +country code. By default, setregdomain attempts to determine +the appropriate country code by examining the target of the +.IR /etc/localtime +symbolic link. That information is used to look-up the matching +country code in the +.IR /usr/share/zoneinfo/zone.tab +file. + +The country code look-up may fail. This could be due to faulty +or incomplete information in the +.IR /usr/share/zoneinfo/zone.tab +file, or the use of an actual file rather than a symlink for +.IR /etc/localtime +, among other possibilities. In those cases the system +administrator should define a COUNTRY environment variable in the +.IR /etc/sysconfig/regdomain +file. This value will be used as the country code and the country +code look-up will be skipped. +.SH "FILES" +.BR /etc/sysconfig/regdomain +.BR /etc/localtime +.BR /usr/share/zoneinfo/zone.tab +.SH "SEE ALSO" +.BR iw (1) diff --git a/SPECS/wireless-regdb.spec b/SPECS/wireless-regdb.spec new file mode 100644 index 0000000..9331314 --- /dev/null +++ b/SPECS/wireless-regdb.spec @@ -0,0 +1,124 @@ +%global _firmwarepath /usr/lib/firmware + +Name: wireless-regdb +Version: 2020.11.20 +Release: 6%{?dist} +Summary: Regulatory database for 802.11 wireless networking + +License: ISC +URL: https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb +BuildArch: noarch + +Requires: udev, iw +Requires: systemd >= 190 + +BuildRequires: make +BuildRequires: systemd-devel + +Provides: crda = 3.19-1 +Obsoletes: crda < 3.19-1 + +Source0: http://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-%{version}.tar.xz +Source1: setregdomain +Source2: setregdomain.1 +Source3: 85-regulatory.rules + + +%description +The wireless-regdb package provides the regulatory rules database +used by the kernels 802.11 networking stack in order to comply +with radio frequency regulatory rules around the world. + + +%prep +%setup -q + + +%build +: # Package installs a firmware-like, prebuilt binary from upstream... + + +%install +make install DESTDIR=%{buildroot} MANDIR=%{_mandir} \ + FIRMWARE_PATH=%{_firmwarepath} + +install -D -pm 0755 %SOURCE1 %{buildroot}%{_sbindir}/setregdomain +install -D -pm 0644 %SOURCE2 %{buildroot}%{_mandir}/man1/setregdomain.1 +install -D -pm 0644 %SOURCE3 %{buildroot}%{_udevrulesdir}/85-regulatory.rules + +rm -rf %{buildroot}/usr/lib/crda + + +%files +%{_sbindir}/setregdomain +%{_udevrulesdir}/85-regulatory.rules +%{_firmwarepath}/regulatory.db +%{_firmwarepath}/regulatory.db.p7s +%{_mandir}/man1/setregdomain.1* +%{_mandir}/man5/regulatory.db.5* +%{_mandir}/man5/regulatory.bin.5* +%license LICENSE +%doc README + + +%changelog +* Mon Nov 22 2021 Michal Schmidt - 2020.11.20-6 +- To let the Obsoletes fix land, enable gating, bump release. +- Resolves: rhbz#1997398 + +* Thu Nov 18 2021 Michal Schmidt - 2020.11.20-5 +- Update crda Provides/Obsoletes to cover the version in RHEL 8. +- Resolves: rhbz#1997398 + +* Tue Aug 10 2021 Mohan Boddu - 2020.11.20-4 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Apr 16 2021 Mohan Boddu - 2020.11.20-3 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Wed Jan 27 2021 Fedora Release Engineering - 2020.11.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Dec 09 2020 John W. Linville - 2020.11.20-1 +- Update to version 2020.11.20 from upstream + +* Wed Jul 29 2020 Fedora Release Engineering - 2020.04.29-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu May 21 2020 John W. Linville - 2020.04.29-1 +- Update to version 2020.04.29 from upstream + +* Fri Jan 31 2020 Fedora Release Engineering - 2019.06.03-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Aug 28 2019 John W. Linville - 2019.06.03-5 +- Remove patch preventing install of regulatory.bin.5 man page +- Include regulatory.bin.5 man page in distributed files + +* Mon Aug 26 2019 John W. Linville - 2019.06.03-4 +- Bump crda Provides and Obsoletes to ensure proper upgrades + +* Mon Aug 05 2019 John W. Linville - 2019.06.03-3 +- remove Requires for kernel + +* Sat Jul 27 2019 Fedora Release Engineering - 2019.06.03-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jun 06 2019 John W. Linville - 2019.06.03-1 +- Update to version 2019.06.03 from upstream + +* Sun Feb 03 2019 Fedora Release Engineering - 2018.05.31-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Aug 02 2018 John W. Linville - 2018.05.31-4 +- Enable Provides for crda so as to promote automated upgrades + +* Wed Jul 18 2018 John W. Linville - 2018.05.31-3 +- Fix-up changelog typos and bump Release + +* Wed Jul 18 2018 John W. Linville - 2018.05.31-2 +- Add BuildRequires for systemd-devel to provide _udevrulesdir definition + +* Fri Jul 06 2018 John W. Linville - 2018.05.31-1 +- Initial build