Skip to contentSkip to conversation

usb_modeswitch update and add data

PATCH New J.C. Woltz 4 participants 8 messages Mar 18, 2012 – Aug 12, 2012

lore
Share & tools
lore

J.C. Woltz

author
#0 lore raw

v5 cover usb_modeswitch update and add data

These two patches update usb_modeswitch to the latest version and add the data files in a separate package.

The first patch updates usb_modeswitch to version 1.2.3. usb_modeswitch itself includes bug fixes and a few new device additions.

The second patch is an addition for buildroot. It adds the usb_modeswicth_data which is very helpful. It contains rules for many devices. On most systems, these two programs are installed together. This data package contains udev rules to automatically switch the device on detection.

The second patch also depends on the tcl patch sent in. This way usb_modeswitch_data can select tclsh in order to get tcl.

J.C. Woltz (2):
usb_modeswitch: update to 1.2.3
new program: usb_modeswitch_data

 package/Config.in                                  |    1 +
 .../usb_modeswitch/usb_modeswitch-makefile.patch   |   43 ++++++++++----------
 package/usb_modeswitch/usb_modeswitch.mk           |   20 ++++++---
 package/usb_modeswitch_data/Config.in              |   11 +++++
 .../usb_modeswitch_data-makefile.patch             |   27 ++++++++++++
 package/usb_modeswitch_data/usb_modeswitch_data.mk |   26 ++++++++++++
 6 files changed, 100 insertions(+), 28 deletions(-)
 create mode 100644 package/usb_modeswitch_data/Config.in
 create mode 100644 package/usb_modeswitch_data/usb_modeswitch_data-makefile.patch
 create mode 100644 package/usb_modeswitch_data/usb_modeswitch_data.mk
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH v5 1/2 usb_modeswitch: update to 1.2.3

This patch updates usb_modeswitch to version 1.2.3.
The usb_modeswitch.mk needed to be modified for usb_modeswitch to compile. Also added extra remove section for the added help scripts and files.

---
replace TARGET_MAKE_ENV and add USB_MODESWITCH_UNINSTALL_CMDS as recommended by Arnout Vandecappelle

Other version information has been lost

version 5:
added explanation to patch

 .../usb_modeswitch/usb_modeswitch-makefile.patch   |   43 ++++++++++----------
 package/usb_modeswitch/usb_modeswitch.mk           |   20 ++++++---
 2 files changed, 35 insertions(+), 28 deletions(-)
package/usb_modeswitch/usb_modeswitch-makefile.patch +22 -21
index 918200b..55b0b3d 100644
@@ -1,23 +1,24 @@
-diff -Nura usb-modeswitch-1.1.2.orig/Makefile usb-modeswitch-1.1.2/Makefile
---- usb-modeswitch-1.1.2.orig/Makefile	2010-04-17 15:27:11.000000000 -0300
-+++ usb-modeswitch-1.1.2/Makefile	2010-04-22 15:05:32.363471807 -0300
-@@ -1,6 +1,6 @@
- PROG        = usb_modeswitch
- VERS        = 1.1.2
--CC          = gcc
-+CC          ?= gcc
- CFLAGS      += -Wall -l usb
- RM          = /bin/rm -f
- OBJS        = usb_modeswitch.c
-@@ -23,8 +23,9 @@
- install: all
- 	install -d $(SBINDIR)
- 	install --mode=755 usb_modeswitch $(SBINDIR)/usb_modeswitch
--	install --mode=755 usb_modeswitch.tcl $(UDEVDIR)/usb_modeswitch
--	install --mode=644 usb_modeswitch.conf $(ETCDIR)/usb_modeswitch.conf
-+	#install --mode=755 usb_modeswitch.tcl $(UDEVDIR)/usb_modeswitch
-+	#install --mode=644 usb_modeswitch.conf $(ETCDIR)/usb_modeswitch.conf
-+	install -d $(MANDIR)
- 	install --mode=644 usb_modeswitch.1 $(MANDIR)/usb_modeswitch.1
+Removed the -s from the install command. Without this, usb_modeswitch woulc
+fail to install. 
+
+Signed-off-by: J.C. Woltz <[email protected]>
+--- usb_modeswitch-1.2.3.orig/Makefile.orig	2012-02-06 14:00:15.000000000 -0500
++++ usb_modeswitch-1.2.3/Makefile	2012-02-06 14:01:13.000000000 -0500
+@@ -46,7 +46,7 @@
+ 	cd jim && $(MAKE) distclean
  
+ install-common:
+-	install -D -s --mode=755 usb_modeswitch $(SBINDIR)/usb_modeswitch
++	install -D --mode=755 usb_modeswitch $(SBINDIR)/usb_modeswitch
+ 	install -D --mode=755 usb_modeswitch.sh $(UDEVDIR)/usb_modeswitch
+ 	install -D --mode=644 usb_modeswitch.conf $(ETCDIR)/usb_modeswitch.conf
+ 	install -D --mode=644 usb_modeswitch.1 $(MANDIR)/usb_modeswitch.1
+@@ -65,7 +65,7 @@
+ 	install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher
+ 
+ install-binary:
+-	install -D -s --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher
++	install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher
+ 
+ install: all install-common install-script
  
package/usb_modeswitch/usb_modeswitch.mk +13 -7
index 7b982d8..c8b24db 100644
@@ -4,25 +4,31 @@
 #
 #############################################################
 
-USB_MODESWITCH_VERSION = 1.1.2
+USB_MODESWITCH_VERSION = 1.2.3
 USB_MODESWITCH_SOURCE = usb-modeswitch-$(USB_MODESWITCH_VERSION).tar.bz2
 USB_MODESWITCH_SITE = http://www.draisberghof.de/usb_modeswitch
 USB_MODESWITCH_DEPENDENCIES = libusb-compat
 
 define USB_MODESWITCH_BUILD_CMDS
-	$(TARGET_CONFIGURE_OPTS) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+	$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)
 endef
 
 define USB_MODESWITCH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
-	$(INSTALL) -D $(@D)/usb_modeswitch.setup -m 0644 \
-		$(TARGET_DIR)/etc/usb_modeswitch.setup
 endef
 
+
 define USB_MODESWITCH_CLEAN_CMDS
-	rm -f $(TARGET_DIR)/usr/sbin/usb_modeswitch
-	rm -f $(TARGET_DIR)/etc/usb_modeswitch.setup
-	rm -f $(TARGET_DIR)/usr/share/man/man1/usb_modeswitch.1
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) clean
+endef
+
+define USB_MODESWITCH_UNINSTALL_CMDS
+	$(RM) -f $(TARGET_DIR)/usr/sbin/usb_modeswitch
+	$(RM) -f $(TARGET_DIR)/lib/udev/usb_modeswitch
+	$(RM) -f $(TARGET_DIR)/etc/usb_modeswitch.setup
+	$(RM) -f $(TARGET_DIR)/usr/share/man/man1/usb_modeswitch.1
+	$(RM) -rf $(TARGET_DIR)/var/lib/usb_modeswitch
+	$(RM) -f $(TARGET_DIR)/usr/sbin/usb_modeswitch_dispatcher
 endef
 
 $(eval $(call GENTARGETS))
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH v5 1/2 usb_modeswitch: update to 1.2.3

Hello,

[ Reviving an old thread... ]

Le Sat, 17 Mar 2012 21:30:34 -0400,
"J.C. Woltz" <[email protected]> a ?crit :

Quoted 9 lines

This patch updates usb_modeswitch to version 1.2.3.
The usb_modeswitch.mk needed to be modified for usb_modeswitch to compile. Also added extra remove section for the added help scripts and files.

---
replace TARGET_MAKE_ENV and add USB_MODESWITCH_UNINSTALL_CMDS as recommended by Arnout Vandecappelle

Why do you use TARGET_MAKE_ENV here? It seems much better to use TARGET_CONFIGURE_OPTS as you were doing in previous versions of your patch. Arnout, can you explain why you suggested using TARGET_MAKE_ENV instead of TARGET_CONFIGURE_OPTS?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
author
#3 lore raw

PATCH v5 1/2 usb_modeswitch: update to 1.2.3

Thomas,

I used TARGET_MAKE_ENV for the reason you specified. Arnout (or others) told me to use it.
Also since this is an old thread, I was assuming my patch would not be accepted at this point. I just gave up hope and kept my other packages to myself.

JC

Quoted 23 lines · Thomas Petazzoni

Hello,

[ Reviving an old thread... ]

Le Sat, 17 Mar 2012 21:30:34 -0400,
"J.C. Woltz" <[email protected]> a ?crit :

Quoted 2 lines

This patch updates usb_modeswitch to version 1.2.3.
The usb_modeswitch.mk needed to be modified for usb_modeswitch to

compile.

Quoted 7 lines

Also added extra remove section for the added help scripts and files.

---
replace TARGET_MAKE_ENV and add USB_MODESWITCH_UNINSTALL_CMDS as recommended by Arnout Vandecappelle

Why do you use TARGET_MAKE_ENV here? It seems much better to use TARGET_CONFIGURE_OPTS as you were doing in previous versions of your patch. Arnout, can you explain why you suggested using TARGET_MAKE_ENV instead of TARGET_CONFIGURE_OPTS?

Quoted 9 lines

Thanks!

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120721/aef743a9/attachment.html>

#4 lore raw

PATCH v5 1/2 usb_modeswitch: update to 1.2.3

Quoted 3 lines · J.C. Woltz

Thomas,

I used TARGET_MAKE_ENV for the reason you specified. Arnout (or others) told me to use it.

I checked the first versions of the patch and I _think_ I meant to
say that TARGET_MAKE_ENV should not be removed, not that TARGET_CONFIGURE_OPTS should be removed.

Quoted 2 lines

Also since this is an old thread, I was assuming my patch would not be accepted at this point. I just gave up hope and kept my other packages to myself.

I can imagine that when you create 5 versions of a patch, and after that
it just dies, you give up... Care to create a 6th version, which reinstates TARGET_CONFIGURE_OPTS, like so:

	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)

Regards,
Arnout

[snip]

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
author
#5 lore raw

PATCH v5 2/2 new program: usb_modeswitch_data

In reply to J.C. Woltz

usb_modeswitch_data provides udev rules for usb VID/PID combinations to switch usb deices from their default mode into a more useable mode. The default mode usually is a cdrom with installation software that is of little use in an embedded linux situation

---
version 3:
Fix usb_modeswitch_data to depend usb_modeswitch
add $(TARGET_CONFIGURE_OPTS) to be consistent with usb_modeswitch

version 4:
fix error. change to $(TARGET_MAKE_ENV) from $(TARGET_CONFIGURE_OPTS)

updated to use "select" instead of "depends on" as recommended by Arnout Vandecappelle
Added a select for TCL and BR2_PACKAGE_TCL_TCLSH
This depends on the patch submitted by:
Arnout Vandecappelle

version 5:
Added explanation to patch and a signoff line
This should be final. This includes all changes mentioned by others on the mailing list.

 package/Config.in                                  |    1 +
 package/usb_modeswitch_data/Config.in              |   11 ++++++++
 .../usb_modeswitch_data-makefile.patch             |   27 ++++++++++++++++++++
 package/usb_modeswitch_data/usb_modeswitch_data.mk |   26 +++++++++++++++++++
 4 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 package/usb_modeswitch_data/Config.in
 create mode 100644 package/usb_modeswitch_data/usb_modeswitch_data-makefile.patch
 create mode 100644 package/usb_modeswitch_data/usb_modeswitch_data.mk
package/Config.in +1 -0
index 8a7c9c4..172f7ab 100644
@@ -220,6 +220,7 @@ source "package/uboot-tools/Config.in"
 source "package/udev/Config.in"
 source "package/unionfs/Config.in"
 source "package/usb_modeswitch/Config.in"
+source "package/usb_modeswitch_data/Config.in"
 source "package/usbmount/Config.in"
 source "package/usbutils/Config.in"
 source "package/wipe/Config.in"
package/usb_modeswitch_data/Config.in new file +11 -0
new file mode 100644
index 0000000..d15e6e7
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_USB_MODESWITCH_DATA
+	select BR2_PACKAGE_USB_MODESWITCH
+	select BR2_PACKAGE_TCL
+	select BR2_PACKAGE_TCL_TCLSH
+	bool "usb_modeswitch_data"
+	help
+	  USB mode switch data
+	  Contains udev rules and events to allow usb_modeswitch to
+	  function automatically
+	  
+	  http://www.draisberghof.de/usb_modeswitch/
package/usb_modeswitch_data/usb_modeswitch_data-makefile.patch new file +27 -0
new file mode 100644
index 0000000..769e514
@@ -0,0 +1,27 @@
+Fixed Makefile install sections to not reload udev rules. In a 
+cross-compiler environment, it is not wanted to reload the host udev rules.
+
+Signed-off-by: J.C. Woltz <[email protected]>
+--- usb_modeswitch_data-20120120.orig/Makefile	2012-01-20 17:25:32.000000000 -0500
++++ usb_modeswitch_data-20120120/Makefile	2012-02-06 14:20:47.000000000 -0500
+@@ -12,9 +12,9 @@
+ 
+ clean:
+ 
+-install: files-install db-install rules-reload
++install: files-install db-install
+ 
+-install-packed: files-install db-install-packed rules-reload
++install-packed: files-install db-install-packed
+ 
+ files-install:
+ 	install -d $(PREFIX)/share/usb_modeswitch
+@@ -50,7 +50,7 @@
+ 		fi \
+ 	fi
+ 
+-uninstall: files-uninstall rules-reload
++uninstall: files-uninstall
+ 
+ files-uninstall:
+ 	$(RM) $(RULESDIR)/40-usb_modeswitch.rules
package/usb_modeswitch_data/usb_modeswitch_data.mk new file +26 -0
new file mode 100644
index 0000000..46f5b45
@@ -0,0 +1,26 @@
+#############################################################
+#
+# usb_modeswitch_data
+#
+#############################################################
+
+USB_MODESWITCH_DATA_VERSION = 20120120
+USB_MODESWITCH_DATA_SOURCE = usb-modeswitch-data-$(USB_MODESWITCH_DATA_VERSION).tar.bz2
+USB_MODESWITCH_DATA_SITE = http://www.draisberghof.de/usb_modeswitch
+USB_MODESWITCH_DATA_DEPENDENCIES = usb_modeswitch
+
+define USB_MODESWITCH_DATA_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)
+endef
+
+define USB_MODESWITCH_DATA_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+
+define USB_MODESWITCH_DATA_CLEAN_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) clean
+endef
+
+$(eval $(call GENTARGETS))
+
Signature · 1 line
1.7.5.4
#6 lore raw

PATCH v5 2/2 new program: usb_modeswitch_data

Quoted 130 lines · J.C. Woltz

usb_modeswitch_data provides udev rules for usb VID/PID combinations to switch usb deices from their default mode into a more useable mode. The default mode usually is a cdrom with installation software that is of little use in an embedded linux situation

---
version 3:
Fix usb_modeswitch_data to depend usb_modeswitch
add $(TARGET_CONFIGURE_OPTS) to be consistent with usb_modeswitch

version 4:
fix error. change to $(TARGET_MAKE_ENV) from $(TARGET_CONFIGURE_OPTS)

updated to use "select" instead of "depends on" as recommended by Arnout Vandecappelle
Added a select for TCL and BR2_PACKAGE_TCL_TCLSH
This depends on the patch submitted by:
Arnout Vandecappelle

version 5:
Added explanation to patch and a signoff line
This should be final. This includes all changes mentioned by others on the mailing list.

 package/Config.in                                  |    1 +
 package/usb_modeswitch_data/Config.in              |   11 ++++++++
 .../usb_modeswitch_data-makefile.patch             |   27 ++++++++++++++++++++
 package/usb_modeswitch_data/usb_modeswitch_data.mk |   26 +++++++++++++++++++
 4 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 package/usb_modeswitch_data/Config.in
 create mode 100644 package/usb_modeswitch_data/usb_modeswitch_data-makefile.patch
 create mode 100644 package/usb_modeswitch_data/usb_modeswitch_data.mk
package/Config.in +1 -0
index 8a7c9c4..172f7ab 100644
@@ -220,6 +220,7 @@ source "package/uboot-tools/Config.in"
 source "package/udev/Config.in"
 source "package/unionfs/Config.in"
 source "package/usb_modeswitch/Config.in"
+source "package/usb_modeswitch_data/Config.in"
 source "package/usbmount/Config.in"
 source "package/usbutils/Config.in"
 source "package/wipe/Config.in"
package/usb_modeswitch_data/Config.in new file +11 -0
new file mode 100644
index 0000000..d15e6e7
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_USB_MODESWITCH_DATA
+       select BR2_PACKAGE_USB_MODESWITCH
+       select BR2_PACKAGE_TCL
+       select BR2_PACKAGE_TCL_TCLSH
+       bool "usb_modeswitch_data"
+       help
+         USB mode switch data
+         Contains udev rules and events to allow usb_modeswitch to
+         function automatically
+
+         http://www.draisberghof.de/usb_modeswitch/
package/usb_modeswitch_data/usb_modeswitch_data-makefile.patch new file +27 -0
new file mode 100644
index 0000000..769e514
@@ -0,0 +1,27 @@
+Fixed Makefile install sections to not reload udev rules. In a
+cross-compiler environment, it is not wanted to reload the host udev rules.
+
+Signed-off-by: J.C. Woltz <[email protected]>
+--- usb_modeswitch_data-20120120.orig/Makefile 2012-01-20 17:25:32.000000000 -0500
++++ usb_modeswitch_data-20120120/Makefile      2012-02-06 14:20:47.000000000 -0500
+@@ -12,9 +12,9 @@
+
+ clean:
+
+-install: files-install db-install rules-reload
++install: files-install db-install
+
+-install-packed: files-install db-install-packed rules-reload
++install-packed: files-install db-install-packed
+
+ files-install:
+       install -d $(PREFIX)/share/usb_modeswitch
+@@ -50,7 +50,7 @@
+               fi \
+       fi
+
+-uninstall: files-uninstall rules-reload
++uninstall: files-uninstall
+
+ files-uninstall:
+       $(RM) $(RULESDIR)/40-usb_modeswitch.rules
package/usb_modeswitch_data/usb_modeswitch_data.mk new file +26 -1
new file mode 100644
index 0000000..46f5b45
@@ -0,0 +1,26 @@
+#############################################################
+#
+# usb_modeswitch_data
+#
+#############################################################
+
+USB_MODESWITCH_DATA_VERSION = 20120120
+USB_MODESWITCH_DATA_SOURCE = usb-modeswitch-data-$(USB_MODESWITCH_DATA_VERSION).tar.bz2
+USB_MODESWITCH_DATA_SITE = http://www.draisberghof.de/usb_modeswitch
+USB_MODESWITCH_DATA_DEPENDENCIES = usb_modeswitch
+
+define USB_MODESWITCH_DATA_BUILD_CMDS
+       $(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)
+endef
+
+define USB_MODESWITCH_DATA_INSTALL_TARGET_CMDS
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+
+define USB_MODESWITCH_DATA_CLEAN_CMDS
+       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) clean
+endef
+
+$(eval $(call GENTARGETS))
+
--
Quoted 1 line

1.7.5.4

Any update on this package?

Yegor

#7 lore raw

v5 cover usb_modeswitch update and add data

In reply to J.C. Woltz

Le Sat, 17 Mar 2012 21:30:33 -0400,
"J.C. Woltz" <[email protected]> a ?crit :

Quoted 11 lines

These two patches update usb_modeswitch to the latest version and add the data files in a separate package.

The first patch updates usb_modeswitch to version 1.2.3. usb_modeswitch itself includes bug fixes and a few new device additions.

The second patch is an addition for buildroot. It adds the usb_modeswicth_data which is very helpful. It contains rules for many devices. On most systems, these two programs are installed together. This data package contains udev rules to automatically switch the device on detection.

Quoted 8 lines

The second patch also depends on the tcl patch sent in. This way usb_modeswitch_data can select tclsh in order to get tcl.

J.C. Woltz (2):
usb_modeswitch: update to 1.2.3
new program: usb_modeswitch_data

I guess you won't believe me, but anyway, it's true: I have merged your changes. I did some minor modifications to them (bump usb_modeswitch to 1.2.4, and usb_modeswitch_data to the latest available version, do some minor fixes, add license information, etc.).

I sincerely would like to apologize for the unacceptable delay that you had to wait to see these patches merged. I would however really hope that this will not discourage you from posting more patches to Buildroot in the future, as your contributions are very welcome. You said some time ago that you had more packages to contribute, please don't hesitate to do so, I promise we'll try to be more responsive this time.

Again, thanks a lot for your contributions,

Thomas Petazzoni

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com