From 0631ace813d8c1b1ab7cdeff0af72c4b52425049 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 03 2020 06:11:27 +0000 Subject: Add sources defined in the spec file --- diff --git a/SPECS/85-regulatory.rules b/SPECS/85-regulatory.rules new file mode 100644 index 0000000..705e765 --- /dev/null +++ b/SPECS/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/SPECS/setregdomain b/SPECS/setregdomain new file mode 100755 index 0000000..74d885a --- /dev/null +++ b/SPECS/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/SPECS/setregdomain.1 b/SPECS/setregdomain.1 new file mode 100644 index 0000000..e246275 --- /dev/null +++ b/SPECS/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-2020.04.29.tar.xz b/SPECS/wireless-regdb-2020.04.29.tar.xz new file mode 100644 index 0000000..afa4a2d Binary files /dev/null and b/SPECS/wireless-regdb-2020.04.29.tar.xz differ