[pkg-wpa-devel] r1409 - in /crda/trunk/debian: control crda.default crda.install crda.postinst crda.triggers install patches/disable_gcrypt.patch patches/disable_verification.patch patches/series rules setregdomain

kelmo-guest at users.alioth.debian.org kelmo-guest at users.alioth.debian.org
Sat Aug 15 15:09:50 UTC 2009


Author: kelmo-guest
Date: Sat Aug 15 15:09:50 2009
New Revision: 1409

URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1409
Log:
Add trigger support to update country code mapping from zone.tab. Drop iw to recommends. Add upstream patch for disabling regulatory.bin verification.

Added:
    crda/trunk/debian/crda.install
      - copied unchanged from r1380, crda/trunk/debian/install
    crda/trunk/debian/crda.postinst
    crda/trunk/debian/crda.triggers
    crda/trunk/debian/patches/disable_verification.patch
Removed:
    crda/trunk/debian/install
Modified:
    crda/trunk/debian/control
    crda/trunk/debian/crda.default
    crda/trunk/debian/patches/disable_gcrypt.patch
    crda/trunk/debian/patches/series
    crda/trunk/debian/rules
    crda/trunk/debian/setregdomain

Modified: crda/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/control?rev=1409&op=diff
==============================================================================
--- crda/trunk/debian/control (original)
+++ crda/trunk/debian/control Sat Aug 15 15:09:50 2009
@@ -14,7 +14,8 @@
 
 Package: crda
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, wireless-regdb, iw
+Depends: ${shlibs:Depends}, ${misc:Depends}, wireless-regdb
+Recommends: iw
 Description: wireless Central Regulatory Domain Agent
  This package provides a Central Regulatory Domain Agent (CRDA) to be used by
  the Linux kernel cf80211 wireless subsystem to query and apply the regulatory

Modified: crda/trunk/debian/crda.default
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/crda.default?rev=1409&op=diff
==============================================================================
--- crda/trunk/debian/crda.default (original)
+++ crda/trunk/debian/crda.default Sat Aug 15 15:09:50 2009
@@ -8,9 +8,8 @@
 # legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
 # descriptions containing ISO/IEC 3166-1 alpha2 country codes.
 #
-# If left blank, a country code will be selected based on the timezone
-# configuration of the system by finding a country code in
-# `/usr/share/zoneinfo/zone.tab' which matches up with the timezone name
-# in `/etc/timezone', if configured.
+# If left unset, a country code will be selected based on the timezone
+# configuration of the system.
 
 REGDOMAIN=
+

Added: crda/trunk/debian/crda.postinst
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/crda.postinst?rev=1409&op=file
==============================================================================
--- crda/trunk/debian/crda.postinst (added)
+++ crda/trunk/debian/crda.postinst Sat Aug 15 15:09:50 2009
@@ -1,0 +1,86 @@
+#!/bin/sh
+
+set -e
+
+# This script can be called in the following ways:
+#
+# After the package was installed:
+#       <postinst> configure <old-version>
+#
+#
+# If prerm fails during upgrade or fails on failed upgrade:
+#       <old-postinst> abort-upgrade <new-version>
+#
+# If prerm fails during deconfiguration of a package:
+#       <postinst> abort-deconfigure in-favour <new-package> <version>
+#                  removing <old-package> <version>
+#
+# If prerm fails during replacement due to conflict:
+#       <postinst> abort-remove in-favour <new-package> <version>
+
+create_regdomain_matrix()
+{
+	[ -w /etc/default/crda ] || return 0
+
+	# Path to timezone configuration file
+	TZCONF=/etc/timezone
+
+	# Markers used to flag autogenerated section of /etc/default/crda
+	START='### START AUTOGENERATED REGDOMAIN MATRIX'
+	END='### END AUTOGENERATED REGDOMAIN MATRIX'
+
+	# Remove old autogenerated section
+	sed -i "/^$START/,/^$END/d" /etc/default/crda
+
+	# Append new autogenerated section. Parse tzdata's zone.tab and
+	# output something which can be sourced by a shell script. This is
+	# done here to avoid overhead at crda udev agent runtime and to
+	# allow data to be available in early boot.
+	awk -v start="$START" -v end="$END" -v tzconf="$TZCONF" '
+	BEGIN {
+		printf("%s\n", start)
+		printf("#\n")
+		printf("# Lines between the AUTOGENERATED markers are managed by crda maintainer\n")
+		printf("# scripts. Do not edit between the markers, all changes will be lost.\n")
+		printf("#\n")
+		printf("if [ -z \"$REGDOMAIN\" ]; then\n")
+		printf("\tTIMEZONE=$(sed \"s# #_#g\" %s 2>/dev/null)\n", tzconf)
+		printf("\tcase \"$TIMEZONE\" in\n")
+	}
+	$1 ~ /^[A-Z][A-Z]$/ {
+		printf("\t\t\"%s\")\n", $3)
+		printf("\t\t\tREGDOMAIN=%s\n", $1)
+		printf("\t\t\t;;\n")
+	}
+	END {
+		printf("\tesac\n")
+		printf("fi\n")
+		printf("%s\n", end)
+
+	}
+	' "$1" >> /etc/default/crda
+}
+
+case "$1" in
+	configure)
+		ZONE_TAB=/usr/share/zoneinfo/zone.tab
+		if [ -s "$ZONE_TAB" ]; then
+			create_regdomain_matrix "$ZONE_TAB"
+		fi
+		;;
+	triggered)
+		if [ -s "$2" ]; then
+			create_regdomain_matrix "$2"
+		fi
+		;;
+	abort-upgrade|abort-deconfigure|abort-remove)
+		;;
+	*)
+		echo "$0 called with unknown argument \`$1'" 1>&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0

Added: crda/trunk/debian/crda.triggers
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/crda.triggers?rev=1409&op=file
==============================================================================
--- crda/trunk/debian/crda.triggers (added)
+++ crda/trunk/debian/crda.triggers Sat Aug 15 15:09:50 2009
@@ -1,0 +1,1 @@
+interest /usr/share/zoneinfo/zone.tab

Modified: crda/trunk/debian/patches/disable_gcrypt.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/patches/disable_gcrypt.patch?rev=1409&op=diff
==============================================================================
--- crda/trunk/debian/patches/disable_gcrypt.patch (original)
+++ crda/trunk/debian/patches/disable_gcrypt.patch Sat Aug 15 15:09:50 2009
@@ -2,16 +2,7 @@
 ---
 --- a/Makefile
 +++ b/Makefile
-@@ -24,7 +24,7 @@ PUBKEY_DIR?=pubkeys
- 
- CFLAGS += -Wall -g
- 
--all: $(REG_BIN) crda intersect verify
-+all: crda intersect regdbdump
- 
- ifeq ($(USE_OPENSSL),1)
- CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl`
-@@ -33,12 +33,14 @@ LDLIBS += `pkg-config --libs openssl`
+@@ -35,12 +35,14 @@ LDLIBS += `pkg-config --libs openssl`
  reglib.o: keys-ssl.c
  
  else

Added: crda/trunk/debian/patches/disable_verification.patch
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/patches/disable_verification.patch?rev=1409&op=file
==============================================================================
--- crda/trunk/debian/patches/disable_verification.patch (added)
+++ crda/trunk/debian/patches/disable_verification.patch Sat Aug 15 15:09:50 2009
@@ -1,0 +1,57 @@
+From: Pavel Roskin <proski at gnu.org>
+Date: Thu, 6 Aug 2009 17:45:07 +0000 (-0400)
+Subject: CRDA and cross-compilation
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fmcgrof%2Fcrda.git;a=commitdiff_plain;h=c49eb5d1a93314b6a965ce90282f6a5ce7d0e5f6
+
+CRDA and cross-compilation
+
+On Thu, 2009-08-06 at 09:56 -0700, Luis R. Rodriguez wrote:
+
+> ACK, is it possible to make it simpler?
+
+OK, here's my take.
+
+We only need a native compiler to verify regulatory.bin.  I believe it's
+orthogonal to building CRDA.
+
+For someone doing a cross-compilation, it makes no sense to verify the
+installed regulatory.bin.  Thus, the verification should be optional.
+
+But the compilation of regdbdump shouldn't be.  Firstly, it's installed
+by "make install".  Secondly, somebody may want to verify regulatory.bin
+on the target system.
+
+Here's the patch:
+
+crda: make it possible to disable verification
+
+Signed-off-by: Pavel Roskin <proski at gnu.org>
+---
+
+--- a/Makefile
++++ b/Makefile
+@@ -24,7 +24,9 @@ PUBKEY_DIR?=pubkeys
+ 
+ CFLAGS += -Wall -g
+ 
+-all: $(REG_BIN) crda intersect verify
++all: all_noverify verify
++
++all_noverify: crda intersect regdbdump
+ 
+ ifeq ($(USE_OPENSSL),1)
+ CFLAGS += -DUSE_OPENSSL `pkg-config --cflags openssl`
+@@ -74,11 +76,12 @@ $(REG_BIN):
+ 	$(NQ) '  EXIST ' $(REG_BIN)
+ 	$(NQ)
+ 	$(NQ) ERROR: The file: $(REG_BIN) is missing. You need this in place in order
+-	$(NQ) to build CRDA. You can get it from:
++	$(NQ) to verify CRDA. You can get it from:
+ 	$(NQ)
+ 	$(NQ) $(REG_GIT)
+ 	$(NQ)
+ 	$(NQ) "Once cloned (no need to build) cp regulatory.bin to $(REG_BIN)"
++	$(NQ) "Use \"make noverify\" to disable verification"
+ 	$(NQ)
+ 	$(Q) exit 1
+ 

Modified: crda/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/patches/series?rev=1409&op=diff
==============================================================================
--- crda/trunk/debian/patches/series (original)
+++ crda/trunk/debian/patches/series Sat Aug 15 15:09:50 2009
@@ -1,2 +1,3 @@
+disable_verification.patch
 disable_gcrypt.patch
 regulatory_rules_setregdomain.patch

Modified: crda/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/rules?rev=1409&op=diff
==============================================================================
--- crda/trunk/debian/rules (original)
+++ crda/trunk/debian/rules Sat Aug 15 15:09:50 2009
@@ -2,6 +2,9 @@
 %:
 	dh --with quilt $@
 
+override_dh_auto_build:
+	$(MAKE) all_noverify
+
 override_dh_fixperms:
 	dh_fixperms
 	chmod 755 debian/crda/lib/crda/setregdomain

Modified: crda/trunk/debian/setregdomain
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/setregdomain?rev=1409&op=diff
==============================================================================
--- crda/trunk/debian/setregdomain (original)
+++ crda/trunk/debian/setregdomain Sat Aug 15 15:09:50 2009
@@ -1,55 +1,24 @@
 #!/bin/sh
 
-REGDOM_CONFIG=/etc/default/crda
-TZDATA_CONFIG=/etc/timezone
-TZDATA_MATRIX=/usr/share/zoneinfo/zone.tab
+set -e
 
 REGDOMAIN=
-TIME_ZONE=
-ZONE_CODE=
+REGDOMAIN_CONF=/etc/default/crda
 
-setreg_err()
-{
-	echo "setregdomain: Unable to set initial regulatory domain!"
-	echo "setregdomain: $@."
-	echo "setregdomain: Read $REGDOM_CONFIG for more information"
-	exit 1
-}
-
-setreg_ftw()
-{
-	iw reg set "$1"
-	IWRETV=$?
-
-	if [ "$IWRETV" -ne 0 ]; then
-		echo "setregdomain: Failed to set regulatory domain to:" \
-		     "$1 ($2)."
-	else
-		echo "setregdomain: Regulatory domain set to: $1 ($2)."
-	fi
-
-	return "$IWRETV"
-}
-
-if [ -s "$REGDOM_CONFIG" ]; then
-	. $REGDOM_CONFIG
-	if [ -n "$REGDOMAIN" ]; then
-		setreg_ftw "$REGDOMAIN" "$REGDOM_CONFIG"
-		exit
-	fi
+if [ -s "$REGDOMAIN_CONF" ]; then
+	. "$REGDOMAIN_CONF"
 fi
 
-if [ -s "$TZDATA_CONFIG" ] && [ -s "$TZDATA_MATRIX" ]; then
-	TIME_ZONE="$(cat $TZDATA_CONFIG)"
-	_TIMEZONE="$(echo $TIME_ZONE | sed -e 's# #_#g' -e 's#/#\\\\/#g')"
-	ZONE_CODE="$(sed -r -n '/'$_TIMEZONE'/s/^([A-Z]{2})\s+.*/\1/p' \
-		     $TZDATA_MATRIX)"
-	if [ -n "$ZONE_CODE" ]; then
-		setreg_ftw "$ZONE_CODE" "$TZDATA_CONFIG - $TIME_ZONE"
-	else
-		setreg_err "Domain could not be determined from timezone" \
-			   "information in $TZDATA_CONFIG."
-	fi
+if [ -z "$REGDOMAIN" ]; then
+	exit 0
 fi
 
-setreg_err "Failed to guess regulatory domain settings"
+# In the future, iw may be moved to / filesystem
+[ -x /bin/iw ] && exec /bin/iw reg set "$REGDOMAIN"
+
+# Wait for /usr, it may not be mounted yet
+(
+	. /lib/udev/hotplug.functions
+	wait_for_file /usr/bin/iw
+	exec /usr/bin/iw reg set "$REGDOMAIN"
+) &




More information about the Pkg-wpa-devel mailing list