diff --git a/.crda.metadata b/.crda.metadata index 8c32d2a..95ae12a 100644 --- a/.crda.metadata +++ b/.crda.metadata @@ -1,2 +1,2 @@ 6e0adbfc0f5418a03d7d708bd39d52cd1325b511 SOURCES/crda-1.1.3.tar.bz2 -5ec3ff2ddac5d1f11ede0fa02fd6cbd5716817ae SOURCES/wireless-regdb-2014.06.13.tar.xz +8135d9c68e7c66ebe1f146dfff162402cee89da2 SOURCES/wireless-regdb-2015.04.06.tar.xz diff --git a/.gitignore b/.gitignore index e67a367..f92777a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ SOURCES/crda-1.1.3.tar.bz2 -SOURCES/wireless-regdb-2014.06.13.tar.xz +SOURCES/wireless-regdb-2015.04.06.tar.xz diff --git a/SOURCES/crda-display-DFS-regulatory-domain-in-regdbdump.patch b/SOURCES/crda-display-DFS-regulatory-domain-in-regdbdump.patch new file mode 100644 index 0000000..3ef85c2 --- /dev/null +++ b/SOURCES/crda-display-DFS-regulatory-domain-in-regdbdump.patch @@ -0,0 +1,51 @@ +From d169aaf0290c2a6f8b38769e22ced4d3850da7a9 Mon Sep 17 00:00:00 2001 +From: Zefir Kurtisi +Date: Wed, 3 Apr 2013 15:51:58 +0200 +Subject: [PATCH] crda: display DFS regulatory domain in regdbdump + +Signed-off-by: Zefir Kurtisi +Signed-off-by: Luis R. Rodriguez +--- + print-regdom.c | 19 ++++++++++++++++++- + 1 file changed, 18 insertions(+), 1 deletion(-) + +diff --git a/print-regdom.c b/print-regdom.c +index 075eea890579..9c65872d4775 100644 +--- a/print-regdom.c ++++ b/print-regdom.c +@@ -7,6 +7,22 @@ + + #include "reglib.h" + ++static const char *dfs_domain_name(enum nl80211_dfs_regions region) ++{ ++ switch (region) { ++ case NL80211_DFS_UNSET: ++ return "DFS-UNSET"; ++ case NL80211_DFS_FCC: ++ return "DFS-FCC"; ++ case NL80211_DFS_ETSI: ++ return "DFS-ETSI"; ++ case NL80211_DFS_JP: ++ return "DFS-JP"; ++ default: ++ return "DFS-invalid"; ++ } ++} ++ + static void print_reg_rule(struct ieee80211_reg_rule *rule) + { + struct ieee80211_freq_range *freq; +@@ -57,7 +73,8 @@ static void print_reg_rule(struct ieee80211_reg_rule *rule) + void print_regdom(struct ieee80211_regdomain *rd) + { + unsigned int i; +- printf("country %.2s:\n", rd->alpha2); ++ printf("country %.2s: %s\n", rd->alpha2, ++ dfs_domain_name(rd->dfs_region)); + for (i = 0; i < rd->n_reg_rules; i++) + print_reg_rule(&rd->reg_rules[i]); + printf("\n"); +-- +1.8.1.4 + diff --git a/SOURCES/setregdomain b/SOURCES/setregdomain index 5316d03..572fe06 100755 --- a/SOURCES/setregdomain +++ b/SOURCES/setregdomain @@ -44,18 +44,17 @@ fi if [ -f "$LOCALTIME" ] then - ZONE=$(readlink $LOCALTIME) + ZONE=$(readlink -f $LOCALTIME) ZONE=${ZONE#/usr/share/zoneinfo/} - ZONE=${ZONE#../usr/share/zoneinfo/} else $LOGGER -s "Timezone information not found! Unable to set regulatory domain." - exit + exit 1 fi -if [ -z "$ZONE" ] +if [ -z "$ZONE" -o "$ZONE" = "$LOCALTIME" ] then - $LOGGER -s "Timezone information not set! Unable to set regulatory domain." - exit + $LOGGER -s "Could not determine timezone! Unable to set regulatory domain." + exit 1 fi COUNTRY=$(getcountry) @@ -63,7 +62,7 @@ COUNTRY=$(getcountry) if [ -z "$COUNTRY" ] then $LOGGER -s "Could not determine country! Unable to set regulatory domain." - exit + exit 1 fi $LOGGER "setting regulatory domain to $COUNTRY based on timezone ($ZONE)" diff --git a/SOURCES/setregdomain.1 b/SOURCES/setregdomain.1 index 3ce6d8d..e246275 100644 --- a/SOURCES/setregdomain.1 +++ b/SOURCES/setregdomain.1 @@ -1,12 +1,36 @@ .\" Copyright 2009 Red Hat, Inc. -.TH segregdomain 1 2009-10-16 "CRDA" "User Commands" +.TH segregdomain 1 2014-11-19 "CRDA" "User Commands" .SH NAME -setregdomain \- set regulatory domain based on timezone +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 adminstrator. +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/crda.spec b/SPECS/crda.spec index d736ad6..2f01ba5 100644 --- a/SPECS/crda.spec +++ b/SPECS/crda.spec @@ -1,9 +1,9 @@ %define crda_version 1.1.3 -%define regdb_version 2014.06.13 +%define regdb_version 2015.04.06 Name: crda Version: %{crda_version}_%{regdb_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: Regulatory compliance daemon for 802.11 wireless networking Group: System Environment/Base @@ -27,6 +27,7 @@ Source3: setregdomain.1 # Add udev rule to call setregdomain on wireless device add Patch0: regulatory-rules-setregdomain.patch +Patch1: crda-display-DFS-regulatory-domain-in-regdbdump.patch %description @@ -42,6 +43,9 @@ communication from the kernel. %patch0 -p1 -b .setregdomain +cd crda-%{crda_version} +%patch1 -p1 -b .display-DFS + %build export CFLAGS="%{optflags}" @@ -95,6 +99,11 @@ rm -rf %{buildroot} %changelog +* 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