[svn-commits] tzafrir: branch tools/tzafrir/sysfs r6105 - /tools/team/tzafrir/sysfs/xpp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 6 16:52:18 CST 2009


Author: tzafrir
Date: Fri Mar  6 16:52:15 2009
New Revision: 6105

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6105
Log:
dahdi_genconf -n: configure a span passed as a sysfs node

This commit readds an option to configure a single span provided as a
sysfs node (directory). However now that we have getopts in
dahdi_genconf it gets its own command-line option.

Note that this means that the command-line interface to dahdi_genconf as
used in the sample hook script in the dahdi-linux sysfs branch needs to
be adjusted as well.

Modified:
    tools/team/tzafrir/sysfs/xpp/dahdi_genconf

Modified: tools/team/tzafrir/sysfs/xpp/dahdi_genconf
URL: http://svn.digium.com/svn-view/dahdi/tools/team/tzafrir/sysfs/xpp/dahdi_genconf?view=diff&rev=6105&r1=6104&r2=6105
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/dahdi_genconf (original)
+++ tools/team/tzafrir/sysfs/xpp/dahdi_genconf Fri Mar  6 16:52:15 2009
@@ -93,7 +93,7 @@
 	}
 }
 
-getopts('vVF', \%opts) || die "$0: Bad option\n";
+getopts('n:vVF', \%opts) || die "$0: Bad option\n";
 if($opts{'V'}) {
 	my $revstr = $revision;
 	$revstr =~ s/[^$]*\$[^:]+:\s*//;
@@ -102,8 +102,19 @@
 	exit 0;
 }
 
+my @spans;
+if (! exists $opts{'n'}) {
+	@spans = Dahdi::spans();
+} else {
+	my $node = $opts{'n'};
+	if (! -d $node) {
+		print STDERR "$0: parameter for -n must be a sysfs node (directory)\n";
+		exit 1;
+	}
+	my @spans = (Dahdi::span_of_node($node) );
+}
+
 my $gconfig = set_defaults;
-my @spans = Dahdi::spans();
 spans_prep($gconfig, @spans);
 generate_files($gconfig, @spans);
 
@@ -161,6 +172,13 @@
 =item -v
 
 Verbose -- sets the C<'verbose'> option for all generators.
+
+=item -n NODE
+
+Span from SysFS Node. Only generate configuration for channels of a 
+single span. The span is reffered to as a SysFS node. This can be useful
+for handling various udev events. The default (if this parameter is not
+provided) id to generate configuration for all spans.
 
 =item -F
 




More information about the svn-commits mailing list