From b2e633e24073fb1ed75534d5a2b4750a6781bcca Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Tue, 19 Jan 2021 11:21:12 +0100 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/wireless-regdb.git#5a60b504820970d8c8ab0353bd78bd16adffd672 --- .gitignore | 2 + 85-regulatory.rules | 5 +++ setregdomain | 69 ++++++++++++++++++++++++++++ setregdomain.1 | 36 +++++++++++++++ sources | 1 + wireless-regdb.spec | 106 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 219 insertions(+) create mode 100644 85-regulatory.rules create mode 100755 setregdomain create mode 100644 setregdomain.1 create mode 100644 sources create mode 100644 wireless-regdb.spec diff --git a/.gitignore b/.gitignore index e69de29..3022e68 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/wireless-regdb-2020.04.29.tar.xz +/wireless-regdb-2020.11.20.tar.xz diff --git a/85-regulatory.rules b/85-regulatory.rules new file mode 100644 index 0000000..705e765 --- /dev/null +++ b/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/setregdomain b/setregdomain new file mode 100755 index 0000000..74d885a --- /dev/null +++ b/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/setregdomain.1 b/setregdomain.1 new file mode 100644 index 0000000..e246275 --- /dev/null +++ b/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/sources b/sources new file mode 100644 index 0000000..8fb8cac --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (wireless-regdb-2020.11.20.tar.xz) = 93764e677c4d5cdcb4e927bff206c646061fe1e65896dd63f683e145d45917545b4e08caa14bfb3ea04ffb85438935503bbde386cbabfef2804905e508ecf7a0 diff --git a/wireless-regdb.spec b/wireless-regdb.spec new file mode 100644 index 0000000..f83c589 --- /dev/null +++ b/wireless-regdb.spec @@ -0,0 +1,106 @@ +%global _firmwarepath /usr/lib/firmware + +Name: wireless-regdb +Version: 2020.11.20 +Release: 1%{?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.18_2019.03.01-3 +Obsoletes: crda <= 3.18_2019.03.01-2 + +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 +* 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