summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorFlorian Pelz <pelzflorian@pelzflorian.de>2019-06-12 14:05:44 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-13 00:44:01 +0200
commitbd9b15fb31f36f0d592b777bc95205eb0b037035 (patch)
tree893901eebdf6310b7916e88a7e0c8f5ace4f0b90 /gnu/packages/patches
parentf0de9544a3f19b65e80a7cbfafd0dbe268d92ee2 (diff)
downloadguix-bd9b15fb31f36f0d592b777bc95205eb0b037035.tar.gz
gnu: Add USB_ModeSwitch.
* gnu/packages/usb-modeswitch.scm: New file.
* gnu/packages/patches/usb-modeswitch-accept-config-arg.patch: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add package.
  (dist_patch_DATA): Add patch.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/usb-modeswitch-accept-config-arg.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/gnu/packages/patches/usb-modeswitch-accept-config-arg.patch b/gnu/packages/patches/usb-modeswitch-accept-config-arg.patch
new file mode 100644
index 0000000000..9c050f7ee6
--- /dev/null
+++ b/gnu/packages/patches/usb-modeswitch-accept-config-arg.patch
@@ -0,0 +1,42 @@
+--- old/usb_modeswitch.tcl	1970-01-01 01:00:00.000000000 +0100
++++ usb_modeswitch.tcl	2019-06-12 08:39:42.140000000 +0200
+@@ -41,7 +41,7 @@
+ global scsi usb config match device flags setup devdir loginit
+ 
+ set flags(config) ""
+-Log "[ParseGlobalConfig]"
++Log "[ParseGlobalConfig $argv]"
+ 
+ if {$flags(stordelay) > 0} {
+ 	SetStorageDelay $flags(stordelay)
+@@ -496,9 +496,21 @@
+ # end of proc {MatchDevice}
+ 
+ 
+-proc {ParseGlobalConfig} {} {
++proc {ParseGlobalConfig} {argv} {
+ 
+ global flags
++
++set configFileParam ""
++for {set i 0} {$i < [llength $argv]} {incr i} {
++	switch -glob -- [set v [lindex $argv $i]] {
++		--config-file=* {
++			set configFileParam $v
++		}
++	}
++}
++if {$configFileParam != ""} {
++	set configFile [string range $configFileParam [string length "--config-file="] end]
++} else {
+ set configFile ""
+ set places [list /etc/usb_modeswitch.conf /etc/sysconfig/usb_modeswitch /etc/default/usb_modeswitch]
+ foreach cfg $places {
+@@ -507,6 +519,7 @@
+ 		break
+ 	}
+ }
++}
+ if {$configFile == ""} {return}
+ 
+ set rc [open $configFile r]