diff --git a/.crda.metadata b/.crda.metadata new file mode 100644 index 0000000..ebe96e5 --- /dev/null +++ b/.crda.metadata @@ -0,0 +1,2 @@ +16e5a1b67a168d37c28245d681512cbc46f865d9 SOURCES/crda-3.18.tar.xz +3f699d43748824fff3b21d8dd11ef540df205e32 SOURCES/wireless-regdb-2018.05.31.tar.xz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..970b392 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/crda-3.18.tar.xz +SOURCES/wireless-regdb-2018.05.31.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/crda-remove-ldconfig.patch b/SOURCES/crda-remove-ldconfig.patch new file mode 100644 index 0000000..f468eff --- /dev/null +++ b/SOURCES/crda-remove-ldconfig.patch @@ -0,0 +1,11 @@ +diff -up crda-3.13/Makefile.ldconfig-remove crda-3.13/Makefile +--- crda-3.13/Makefile.ldconfig-remove 2016-02-09 15:23:50.468086763 -0500 ++++ crda-3.13/Makefile 2016-02-09 15:24:18.735406109 -0500 +@@ -126,7 +126,6 @@ install-libreg: + $(NQ) ' INSTALL libreg' + $(Q)mkdir -p $(DESTDIR)/$(LIBDIR) + $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/ +- $(Q)ldconfig + + %.o: %.c regdb.h $(LIBREG) + $(NQ) ' CC ' $@ diff --git a/SOURCES/regulatory-rules-setregdomain.patch b/SOURCES/regulatory-rules-setregdomain.patch new file mode 100644 index 0000000..be8297c --- /dev/null +++ b/SOURCES/regulatory-rules-setregdomain.patch @@ -0,0 +1,10 @@ +diff -up crda-3.18_2018.05.09/crda-3.18/udev/regulatory.rules.setregdomain crda-3.18_2018.05.09/crda-3.18/udev/regulatory.rules +--- crda-3.18_2018.05.09/crda-3.18/udev/regulatory.rules.setregdomain 2012-01-18 21:19:09.000000000 -0500 ++++ crda-3.18_2018.05.09/crda-3.18/udev/regulatory.rules 2013-01-25 14:10:57.818931320 -0500 +@@ -2,4 +2,6 @@ + # For more information see: + # http://wireless.kernel.org/en/developers/Regulatory/CRDA + ++SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/sbin/setregdomain" ++ + KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="$(SBINDIR)crda" diff --git a/SOURCES/setregdomain b/SOURCES/setregdomain new file mode 100755 index 0000000..572fe06 --- /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 crda" + +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/SOURCES/wireless-regdb-fw-dependency.patch b/SOURCES/wireless-regdb-fw-dependency.patch new file mode 100644 index 0000000..244eef3 --- /dev/null +++ b/SOURCES/wireless-regdb-fw-dependency.patch @@ -0,0 +1,12 @@ +diff -up crda-3.18_2017.12.23/wireless-regdb-2017.12.23/Makefile.orig crda-3.18_2017.12.23/wireless-regdb-2017.12.23/Makefile +--- crda-3.18_2017.12.23/wireless-regdb-2017.12.23/Makefile.orig 2018-04-30 14:56:17.934744786 -0400 ++++ crda-3.18_2017.12.23/wireless-regdb-2017.12.23/Makefile 2018-04-30 14:57:15.182554167 -0400 +@@ -59,7 +59,7 @@ regulatory.bin: db.txt $(REGDB_PRIVKEY) + @echo Generating $@ digitally signed by $(REGDB_AUTHOR)... + ./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY) + +-regulatory.db: db.txt db2fw.py ++regulatory.db: db.txt db2fw.py $(REGDB_PRIVKEY) $(REGDB_PUBCERT) + @echo "Generating $@" + ./db2fw.py regulatory.db db.txt + diff --git a/SPECS/crda.spec b/SPECS/crda.spec new file mode 100644 index 0000000..28b1d66 --- /dev/null +++ b/SPECS/crda.spec @@ -0,0 +1,309 @@ +%define crda_version 3.18 +%define regdb_version 2018.05.31 + +%global _firmwarepath /usr/lib/firmware + +Name: crda +Version: %{crda_version}_%{regdb_version} +Release: 4%{?dist} +Summary: Regulatory compliance daemon for 802.11 wireless networking + +Group: System Environment/Base +License: ISC +URL: http://wireless.kernel.org/en/developers/Regulatory/CRDA +BuildRoot: %{_tmppath}/%{name}-%{crda_version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: kernel-headers >= 2.6.27 +BuildRequires: libnl3-devel +BuildRequires: libgcrypt-devel +BuildRequires: pkgconfig python m2crypto +BuildRequires: openssl + +Requires: udev, iw +Requires: systemd >= 190 + +Source0: http://www.kernel.org/pub/software/network/crda/crda-%{crda_version}.tar.xz +Source1: http://www.kernel.org/pub/software/network/wireless-regdb/wireless-regdb-%{regdb_version}.tar.xz +Source2: setregdomain +Source3: setregdomain.1 + +# Add udev rule to call setregdomain on wireless device add +Patch0: regulatory-rules-setregdomain.patch +# Do not call ldconfig in crda Makefile +Patch1: crda-remove-ldconfig.patch +# Ensure rebuild of regulatory.db after signature regeneration +Patch2: wireless-regdb-fw-dependency.patch + + +%description +CRDA acts as the udev helper for communication between the kernel +and userspace for regulatory compliance. It relies on nl80211 +for communication. CRDA is intended to be run only through udev +communication from the kernel. + + +%package devel +Summary: Header files for use with libreg. +Group: Development/System + + +%description devel +Header files to make use of libreg for accessing regulatory info. + + +%prep +%setup -q -c +%setup -q -T -D -a 1 + +%patch0 -p1 -b .setregdomain + +cd crda-%{crda_version} +%patch1 -p1 -b .ldconfig-remove +cd ../wireless-regdb-%{regdb_version} +%patch2 -p2 -b .fwsign + + +%build +export CFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" + +# Build CRDA using the sforshee.key.pub.pem key and regulatory.bin +cd crda-%{crda_version} +cp ../wireless-regdb-%{regdb_version}/sforshee.key.pub.pem pubkeys + +make %{?_smp_mflags} SBINDIR=%{_sbindir}/ LIBDIR=%{_libdir}/ \ + REG_BIN=../wireless-regdb-%{regdb_version}/regulatory.bin + + +%install +rm -rf %{buildroot} + +cd crda-%{crda_version} +cp LICENSE LICENSE.crda +cp README README.crda +make install DESTDIR=%{buildroot} MANDIR=%{_mandir}/ \ + SBINDIR=%{_sbindir}/ LIBDIR=%{_libdir}/ + +cd ../wireless-regdb-%{regdb_version} +cp LICENSE LICENSE.wireless-regdb +cp README README.wireless-regdb +make install DESTDIR=%{buildroot} MANDIR=%{_mandir} \ + FIRMWARE_PATH=%{_firmwarepath} + +install -D -pm 0755 %SOURCE2 %{buildroot}%{_sbindir} +install -D -pm 0644 %SOURCE3 %{buildroot}%{_mandir}/man1/setregdomain.1 + + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{_sbindir}/%{name} +%{_sbindir}/regdbdump +%{_sbindir}/setregdomain +%{_libdir}/libreg.so +/lib/udev/rules.d/85-regulatory.rules +# location of database is hardcoded to /usr/lib/%%{name} +/usr/lib/%{name} +%{_firmwarepath}/regulatory.db +%{_firmwarepath}/regulatory.db.p7s +%{_mandir}/man1/setregdomain.1* +%{_mandir}/man5/regulatory.bin.5* +%{_mandir}/man5/regulatory.db.5* +%{_mandir}/man8/crda.8* +%{_mandir}/man8/regdbdump.8* +%license crda-%{crda_version}/LICENSE.crda +%license wireless-regdb-%{regdb_version}/LICENSE.wireless-regdb +%doc crda-%{crda_version}/LICENSE crda-%{crda_version}/README.crda +%doc wireless-regdb-%{regdb_version}/README.wireless-regdb + + +%files devel +%{_includedir}/reglib/nl80211.h +%{_includedir}/reglib/regdb.h +%{_includedir}/reglib/reglib.h + + +%changelog +* Thu Aug 09 2018 John W. Linville - 3.18_2018.05.31-4 +- Update changelog and bump Release + +* Thu Aug 09 2018 Stanislaw Gruszka - 3.18_2018.05.31-3 +- Update wireless-regdb to version 2018.05.31 + +* Fri Jun 01 2018 John W. Linville - 3.18_2017.12.23-2 +- Update URL in package header + +* Thu May 31 2018 John W. Linville - 3.18_2017.12.23-1 +- Update crda to version 3.18 +- Update wireless-regdb to version 2017.12.23 + +* Tue Feb 09 2016 John W. Linville - 3.13_2016.02.08-1 +- Update crda to version 3.13 +- Update wireless-regdb to version 2016.02.08 + +* Mon Jan 18 2016 John W. Linville - 1.1.3_2015.12.14-1 +- Update wireless-regdb to version 2015.12.14 + +* Tue Apr 21 2015 John W. Linville - 1.1.3_2015.04.06-2 +- Update wireless-regdb to version 2015.04.06 +- Add patch for regdbdump to display DFS region +- Make some improvements to setregdomain and its man page + +* Mon Jul 28 2014 John W. Linville - 1.1.3_2014.06.13-1 +- Update wireless-regdb to version 2014.06.13 +- Add logger commands to setregdomain to make it more communicative + +* Fri Feb 28 2014 John W. Linville - 1.1.3_2013.11.27-5 +- Accomodate relative pathnames in the symlink for /etc/localtime + +* Mon Feb 10 2014 John W. Linville - 1.1.3_2013.11.27-4 +- Correct a typo in setregdomain + +* Fri Jan 24 2014 Daniel Mach - 1.1.3_2013.11.27-3 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 1.1.3_2013.11.27-2 +- Mass rebuild 2013-12-27 + +* Mon Dec 2 2013 John W. Linville - 1.1.3_2013.11.27-1 +- Update wireless-regdb to version 2013.11.27 + +* Fri Nov 22 2013 Xose Vazquez Perez - 1.1.3_2013.02.13-5 +- fixed wrong dates +- link with libnl3 +- new home for sources + +* Sat Aug 03 2013 Fedora Release Engineering - 1.1.3_2013.02.13-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Apr 3 2013 John W. Linville - 1.1.3_2013.02.13-3 +- setregdomain: remove sed and awk calls +- setregdomain: reimplement COUNTRY assignment with shell function + +* Fri Mar 1 2013 John W. Linville - 1.1.3_2013.02.13-2 +- Bump release to prevent upgrade issues from F17...oops! + +* Wed Feb 13 2013 John W. Linville - 1.1.3_2013.02.13-1 +- Update wireless-regdb to version 2013.02.13 + +* Tue Feb 12 2013 John W. Linville - 1.1.3_2013.02.12-1 +- Update wireless-regdb to version 2013.02.12 + +* Fri Jan 25 2013 John W. Linville - 1.1.3_2013.01.11-2 +- Update setregdomain to determine timezone info from /etc/timezone + +* Fri Jan 25 2013 John W. Linville - 1.1.3_2013.01.11-1 +- Update crda to version 1.1.3 +- Update wireless-regdb to version 2013.01.11 + +* Fri Aug 10 2012 John W. Linville +- Add BuildRequires for openssl + +* Wed Jul 18 2012 Fedora Release Engineering - 1.1.2_2011.04.28-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jan 12 2012 Fedora Release Engineering - 1.1.2_2011.04.28-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Aug 11 2011 John W. Linville 1.1.2_2011.04.28-1 +- Update crda to version 1.1.2 +- Update wireless-regdb to version 2011.04.28 +- Fix mis-numbered version comment in changelog for Nov 23 2010 + +* Tue Feb 08 2011 Fedora Release Engineering - 1.1.1_2010.11.22-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Nov 23 2010 John W. Linville 1.1.1_2010.11.22-1 +- Update wireless-regdb to version 2010.11.22 + +* Thu Feb 25 2010 John W. Linville 1.1.1_2009.11.25-3 +- Correct license tag from BSD to ISC +- Comment purpose of regulatory-rules-setregdomain.patch +- Add copyright and license statement to setregdomain +- Add comment for why /lib is hardcoded in files section +- Reformat Dec 21 2009 changelog entry so rpmlint stops complaining + +* Tue Jan 26 2010 John W. Linville 1.1.1_2009.11.25-2 +- Change RPM_OPT_FLAGS to optflags +- Leave man page compression to rpmbuild +- Correct date in previous changelog entry + +* Tue Jan 26 2010 John W. Linville 1.1.1_2009.11.25-1 +- Update for crda version 1.1.1 + +* Mon Dec 21 2009 John W. Linville 1.1.0_2009.11.25-5 +- Remove unnecessary explicit Requries for libgcrypt and libnl -- oops! + +* Mon Dec 21 2009 John W. Linville 1.1.0_2009.11.25-4 +- Add libgcrypt and libnl to Requires + +* Mon Dec 21 2009 John W. Linville 1.1.0_2009.11.25-3 +- Add man page for setregdomain (from Andrew Hecox ) +- Change $RPM_BUILD_ROOT to buildroot + +* Fri Dec 18 2009 John W. Linville 1.1.0_2009.11.25-2 +- Specify path to iw in setregdomain + +* Wed Dec 2 2009 John W. Linville 1.1.0_2009.11.25-1 +- Update wireless-regdb to version 2009.11.25 + +* Wed Nov 11 2009 John W. Linville 1.1.0_2009.11.10-1 +- Update wireless-regdb to version 2009.11.10 + +* Thu Oct 1 2009 John W. Linville 1.1.0_2009.09.08-3 +- Move regdb to /lib/crda to facilitate /usr mounted over wireless network + +* Wed Sep 9 2009 John W. Linville 1.1.0_2009.09.08-2 +- Use kernel-headers instead of kernel-devel + +* Wed Sep 9 2009 John W. Linville 1.1.0_2009.09.08-1 +- Update wireless-regdb to version 2009.09.08 +- Start resetting release number with version updates + +* Fri Jul 24 2009 Fedora Release Engineering - 1.1.0_2009.04.17-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed May 13 2009 John W. Linville 1.1.0_2009.04.17-11 +- Update crda version to version 1.1.0 +- Update wireless-regdb to version 2009.04.17 + +* Fri Apr 17 2009 John W. Linville 1.0.1_2009.04.16-10 +- Update wireless-regdb version to pick-up recent updates and fixes (#496392) + +* Tue Mar 31 2009 John W. Linville 1.0.1_2009.03.09-9 +- Add Requires line for iw package (#492762) +- Update setregdomain script to correctly check if COUNTRY is set + +* Thu Mar 19 2009 John W. Linville 1.0.1_2009.03.09-8 +- Add setregdomain script to set regulatory domain based on timezone +- Expand 85-regulatory.rules to invoke setregdomain script on device add + +* Tue Mar 10 2009 John W. Linville 1.0.1_2009.03.09-7 +- Update wireless-regdb version to pick-up recent updates and fixes (#489560) + +* Tue Feb 24 2009 Fedora Release Engineering - 1.0.1_2009.01.30-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 16 2009 John W. Linville 1.0.1_2009.01.30-5 +- Recognize regulatory.bin files signed with the upstream key (#484982) + +* Tue Feb 03 2009 John W. Linville 1.0.1_2009.01.30-4 +- Change version to reflect new wireless-regdb upstream release practices +- Update wireless-regdb version to pick-up recent updates and fixes (#483816) + +* Tue Jan 27 2009 John W. Linville 1.0.1_2009_01_15-3 +- Update for CRDA verion 1.0.1 +- Account for lack of "v" in upstream release tarball naming +- Add patch to let wireless-regdb install w/o being root + +* Thu Jan 22 2009 John W. Linville v0.9.5_2009_01_15-2 +- Revamp based on package review comments + +* Tue Jan 20 2009 John W. Linville v0.9.5_2009_01_15-1 +- Initial build