usbmount fixes
authorYegor Yefremov <yegor_sub1@visionsystems.de>
Fri, 22 Jul 2011 14:58:19 +0000 (16:58 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 27 Jul 2011 19:07:54 +0000 (21:07 +0200)
- create mounting points
- fix dependencies
- fix udev rules
- fix fs type detection

[Peter: fix Config.in deps, create usb7, only remove /media/usb?]
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/usbmount/Config.in
package/usbmount/usbmount-fstype-detection-fix.patch [new file with mode: 0644]
package/usbmount/usbmount-rules-fix.patch [new file with mode: 0644]
package/usbmount/usbmount.mk

index 33e1f05f9036c152f964d30fe369094b01eab4f6..dbbc72d0a91ebb859b4d763675e8023e91cfeda2 100644 (file)
@@ -1,9 +1,17 @@
 config BR2_PACKAGE_USBMOUNT
        bool "usbmount"
+       depends on BR2_LARGEFILE # util-linux
+       depends on BR2_USE_WCHAR # util-linux
        select BR2_PACKAGE_UDEV
        select BR2_PACKAGE_LOCKFILE_PROGS
+       select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # util-linux
+       select BR2_PACKAGE_UTIL_LINUX
+       select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
        help
          The usbmount package automatically mounts USB mass storage devices
          when they are plugged in, and unmounts them when they are removed.
 
          http://usbmount.alioth.debian.org/
+
+comment "usbmount requires a toolchain with LARGEFILE + WCHAR support"
+       depends on !(BR2_LARGEFILE && BR2_USE_WCHAR)
diff --git a/package/usbmount/usbmount-fstype-detection-fix.patch b/package/usbmount/usbmount-fstype-detection-fix.patch
new file mode 100644 (file)
index 0000000..a3686f1
--- /dev/null
@@ -0,0 +1,25 @@
+newer blkid version shows two parameter with TYPE within:
+
+/dev/sda1: VERSION="0.0" TYPE="ext2" USAGE="filesystem" PART_ENTRY_SCHEME="dos"
+PART_ENTRY_TYPE="0xc" PART_ENTRY_FLAGS="0x80" PART_ENTRY_NUMBER="1"
+
+change regular expression to take " TYPE" only
+
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ usbmount |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: b/usbmount
+===================================================================
+--- a/usbmount
++++ b/usbmount
+@@ -88,7 +88,7 @@
+     #   FIXME: improvement: implement mounting by label (notice that labels
+     #   can contain spaces, which makes things a little bit less comfortable).
+     DEVINFO=$(/sbin/blkid -p $DEVNAME)
+-    FSTYPE=$(echo "$DEVINFO" | sed 's/.*TYPE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')
++    FSTYPE=$(echo "$DEVINFO" | sed 's/.* TYPE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')
+     UUID=$(echo "$DEVINFO"   | sed 's/.*UUID="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')
+     USAGE=$(echo "$DEVINFO"  | sed 's/.*USAGE="\([^"]*\)".*/\1/g; s/[[:blank:]]*//g;')
+
diff --git a/package/usbmount/usbmount-rules-fix.patch b/package/usbmount/usbmount-rules-fix.patch
new file mode 100644 (file)
index 0000000..c71b613
--- /dev/null
@@ -0,0 +1,19 @@
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ usbmount.rules |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: b/usbmount.rules
+===================================================================
+--- a/usbmount.rules
++++ b/usbmount.rules
+@@ -1,7 +1,7 @@
+ # Rules for USBmount -*- conf -*-
+
+ KERNEL=="sd*", DRIVERS=="sbp2",               ACTION=="add",  RUN+="/usr/share/usbmount/usbmount add"
+-KERNEL=="sd*", SUBSYSTEMS=="usb",     ACTION=="add",  RUN+="/usr/share/usbmount/usbmount add"
+-KERNEL=="ub*", SUBSYSTEMS=="usb",     ACTION=="add",  RUN+="/usr/share/usbmount/usbmount add"
++KERNEL=="sd*", SUBSYSTEM=="block",    ACTION=="add",  RUN+="/usr/share/usbmount/usbmount add"
++KERNEL=="ub*", SUBSYSTEM=="block",    ACTION=="add",  RUN+="/usr/share/usbmount/usbmount add"
+ KERNEL=="sd*",                                ACTION=="remove",       RUN+="/usr/share/usbmount/usbmount remove"
+ KERNEL=="ub*",                                ACTION=="remove",       RUN+="/usr/share/usbmount/usbmount remove"
index abe349dcfcd9fb59c8e2a8e956d3cce20395b844..0f93e5babfe149d87691b418ad513d486abdd6ca 100644 (file)
@@ -6,20 +6,29 @@
 USBMOUNT_VERSION = 0.0.21
 USBMOUNT_SOURCE = usbmount_$(USBMOUNT_VERSION).tar.gz
 USBMOUNT_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/u/usbmount
-USBMOUNT_DEPENDENCIES = udev lockfile-progs
+USBMOUNT_DEPENDENCIES = udev lockfile-progs util-linux
 
 define USBMOUNT_INSTALL_TARGET_CMDS
        $(INSTALL) -m 0755 -D $(@D)/usbmount $(TARGET_DIR)/usr/share/usbmount/usbmount
+
+       $(INSTALL) -m 0755 -D $(@D)/00_create_model_symlink     \
+               $(TARGET_DIR)/etc/usbmount/usbmount.d/00_create_model_symlink
+       $(INSTALL) -m 0755 -D $(@D)/00_remove_model_symlink     \
+               $(TARGET_DIR)/etc/usbmount/usbmount.d/00_remove_model_symlink
+
        $(INSTALL) -m 0644 -D $(@D)/usbmount.rules $(TARGET_DIR)/lib/udev/rules.d/usbmount.rules
        @if [ ! -f $(TARGET_DIR)/etc/usbmount/usbmount.conf ]; then \
                $(INSTALL) -m 0644 -D $(@D)/usbmount.conf $(TARGET_DIR)/etc/usbmount/usbmount.conf; \
        fi
+
+       mkdir -p $(addprefix $(TARGET_DIR)/media/usb,0 1 2 3 4 5 6 7)
 endef
 
 define USBMOUNT_UNINSTALL_TARGET_CMDS
-       rm -rf $(TARGET_DIR)/etc/usbmount \
-              $(TARGET_DIR)/usr/share/usbmount/usbmount \
-              $(TARGET_DIR)/lib/udev/rules.d/usbmount.rules
+       rm -rf $(TARGET_DIR)/etc/usbmount                       \
+               $(TARGET_DIR)/usr/share/usbmount/usbmount       \
+               $(TARGET_DIR)/lib/udev/rules.d/usbmount.rules   \
+               $(TARGET_DIR)/media/usb?
 endef
 
 $(eval $(call GENTARGETS,package,usbmount))