usbmount fixes
- 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>
This commit is contained in:
parent
4ee9d569f9
commit
1f2879ccb7
@ -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)
|
||||
|
25
package/usbmount/usbmount-fstype-detection-fix.patch
Normal file
25
package/usbmount/usbmount-fstype-detection-fix.patch
Normal file
@ -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;')
|
||||
|
19
package/usbmount/usbmount-rules-fix.patch
Normal file
19
package/usbmount/usbmount-rules-fix.patch
Normal file
@ -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"
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user