Skip to contentSkip to conversation

usbmount: stop using blkid, use udev environment variables instead

PATCH New Sven Neumann 3 participants 11 messages Jun 19, 2013 – Jun 20, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

The blkid binary is not any longer installed when libblkid from util-linux is selected. udev has a builtin blkid command though and already detects all values that we are interested in. Change the usbmount script to use the environment variables set by udev instead of calling blkid directly.

---
 package/usbmount/Config.in                         |  2 -
 ...unt-use-udev-environment-instead-of-blkid.patch | 65 ++++++++++++++++++++++
 package/usbmount/usbmount.mk                       |  2 +-
 3 files changed, 66 insertions(+), 3 deletions(-)
 create mode 100644 package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch
package/usbmount/Config.in +0 -2
index 30c7b5a..0fb491c 100644
@@ -4,8 +4,6 @@ config BR2_PACKAGE_USBMOUNT
 	depends on BR2_USE_WCHAR # util-linux
 	depends on BR2_PACKAGE_UDEV
 	select BR2_PACKAGE_LOCKFILE_PROGS
-	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.
package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch new file +65 -0

65 lines not on this page · raw message

package/usbmount/usbmount.mk +1 -1
index 69262a6..de87009 100644
@@ -7,7 +7,7 @@
 USBMOUNT_VERSION = 0.0.22
 USBMOUNT_SOURCE = usbmount_$(USBMOUNT_VERSION).tar.gz
 USBMOUNT_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/u/usbmount
-USBMOUNT_DEPENDENCIES = udev lockfile-progs util-linux
+USBMOUNT_DEPENDENCIES = udev lockfile-progs
 
 define USBMOUNT_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0755 -D $(@D)/usbmount $(TARGET_DIR)/usr/share/usbmount/usbmount
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Dear Sven Neumann,

package/usbmount/Config.in config BR2_PACKAGE_USBMOUNT · line 4

Quoted 2 lines · Sven Neumann
package/usbmount/Config.in +0 -0
@@ -4,8 +4,6 @@ config BR2_PACKAGE_USBMOUNT
 	depends on BR2_USE_WCHAR # util-linux

If this dependency is only for util-linux and you remove the select BR2_PACKAGE_UTIL_LINUX below, you could get rid of this dependency.

Quoted 13 lines
package/usbmount/Config.in +0 -2
 	depends on BR2_PACKAGE_UDEV
 	select BR2_PACKAGE_LOCKFILE_PROGS
-	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.
package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch new file +0 -0
new file mode 100644
index 0000000..0f0968b

package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch line 2

Quoted 2 lines
package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch new file +2 -0
@@ -0,0 +1,65 @@
+--- usbmount-0.0.22/usbmount.orig	2013-06-18 14:44:40.143096147 +0200
++++ usbmount-0.0.22/usbmount	2013-06-19 16:13:09.882434896 +0200

Patch should have a description and Signed-off-by.

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
#2 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Hi Thomas,

thanks for the quick review.

Quoted 7 lines · Thomas Petazzoni

package/usbmount/Config.in config BR2_PACKAGE_USBMOUNT · line 4

Quoted 2 lines · Sven Neumann
package/usbmount/Config.in +0 -0
@@ -4,8 +4,6 @@ config BR2_PACKAGE_USBMOUNT
 	depends on BR2_USE_WCHAR # util-linux

If this dependency is only for util-linux and you remove the select BR2_PACKAGE_UTIL_LINUX below, you could get rid of this dependency.

Well, in fact the dependency still exists as usbmount needs udev and udev needs libblkid from util-linux. So perhaps udev should have a dependency on BR2_LARGEFILE && BR2_USE_WCHAR ?!

Regards,
Sven

#3 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Dear Sven Neumann,

Quoted 6 lines · Sven Neumann
Quoted 2 lines

If this dependency is only for util-linux and you remove the select BR2_PACKAGE_UTIL_LINUX below, you could get rid of this dependency.

Well, in fact the dependency still exists as usbmount needs udev and udev needs libblkid from util-linux. So perhaps udev should have a dependency on BR2_LARGEFILE && BR2_USE_WCHAR ?!

No, because usbmount has a *depends on* udev. So until udev is enabled, you can't enable usbmount.

The propagation of "depends on" is needed when a package *selects* another package.

Best regards,

Thomas

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

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Hi,

Quoted 9 lines · Thomas Petazzoni
Quoted 6 lines · Sven Neumann
Quoted 2 lines

If this dependency is only for util-linux and you remove the select BR2_PACKAGE_UTIL_LINUX below, you could get rid of this dependency.

Well, in fact the dependency still exists as usbmount needs udev and udev needs libblkid from util-linux. So perhaps udev should have a dependency on BR2_LARGEFILE && BR2_USE_WCHAR ?!

Quoted 5 lines

No, because usbmount has a *depends on* udev. So until udev is enabled, you can't enable usbmount.

The propagation of "depends on" is needed when a package *selects* another package.

Well, udev selects util-linux (for libblkid), and util-linux requires a toolchain with LARGEFILE + WCHAR support. So as far as I can see this util-linux dependency needs to be propagated to udev (but can be dropped from usbmount).

Regards,
Sven

#5 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Dear Sven Neumann,

Quoted 4 lines · Sven Neumann

Well, udev selects util-linux (for libblkid), and util-linux requires a toolchain with LARGEFILE + WCHAR support. So as far as I can see this util-linux dependency needs to be propagated to udev (but can be dropped from usbmount).

This dependency already exists in udev:

config BR2_PACKAGE_UDEV
bool "udev"
depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV depends on BR2_LARGEFILE # util-linux depends on BR2_USE_WCHAR # util-linux select BR2_PACKAGE_UTIL_LINUX
select BR2_PACKAGE_UTIL_LINUX_LIBBLKID select BR2_PACKAGE_KMOD

My point was really about util-linux itself.

Thomas

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

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Quoted 11 lines · Thomas Petazzoni

This dependency already exists in udev:

config BR2_PACKAGE_UDEV
bool "udev"
depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV depends on BR2_LARGEFILE # util-linux depends on BR2_USE_WCHAR # util-linux select BR2_PACKAGE_UTIL_LINUX
select BR2_PACKAGE_UTIL_LINUX_LIBBLKID select BR2_PACKAGE_KMOD

Quoted 1 line

My point was really about util-linux itself.

My point was really about *usbmount* itself.

Thomas

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

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

In reply to Thomas Petazzoni

Hi,

Quoted 9 lines · Thomas Petazzoni
Quoted 4 lines · Sven Neumann

Well, udev selects util-linux (for libblkid), and util-linux requires a toolchain with LARGEFILE + WCHAR support. So as far as I can see this util-linux dependency needs to be propagated to udev (but can be dropped from usbmount).

This dependency already exists in udev:

Quoted 8 lines

config BR2_PACKAGE_UDEV
bool "udev"
depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV depends on BR2_LARGEFILE # util-linux depends on BR2_USE_WCHAR # util-linux select BR2_PACKAGE_UTIL_LINUX
select BR2_PACKAGE_UTIL_LINUX_LIBBLKID select BR2_PACKAGE_KMOD

Oh, I missed that as I was only looking at the dependency of the comment at the bottom of package/udev/Config.in.

Regards,
Sven

#8 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

In reply to Thomas Petazzoni

The blkid binary is not any longer installed when libblkid from util-linux is selected. udev has a builtin blkid command though and already detects all values that we are interested in. Change the usbmount script to use the environment variables set by udev instead of calling blkid directly.

---
 package/usbmount/Config.in                         |  8 +--
 ...unt-use-udev-environment-instead-of-blkid.patch | 71 ++++++++++++++++++++++
 package/usbmount/usbmount.mk                       |  2 +-
 3 files changed, 74 insertions(+), 7 deletions(-)
 create mode 100644 package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch
package/usbmount/Config.in +2 -6
index 30c7b5a..2583e7c 100644
@@ -1,16 +1,12 @@
 config BR2_PACKAGE_USBMOUNT
 	bool "usbmount"
-	depends on BR2_LARGEFILE # util-linux
-	depends on BR2_USE_WCHAR # util-linux
 	depends on BR2_PACKAGE_UDEV
 	select BR2_PACKAGE_LOCKFILE_PROGS
-	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) && BR2_PACKAGE_UDEV
+comment "usbmount requires udev to be enabled"
+	depends on !BR2_PACKAGE_UDEV
package/usbmount/usbmount-use-udev-environment-instead-of-blkid.patch new file +71 -0

71 lines not on this page · raw message

package/usbmount/usbmount.mk +1 -1
index 69262a6..de87009 100644
@@ -7,7 +7,7 @@
 USBMOUNT_VERSION = 0.0.22
 USBMOUNT_SOURCE = usbmount_$(USBMOUNT_VERSION).tar.gz
 USBMOUNT_SITE = $(BR2_DEBIAN_MIRROR)/debian/pool/main/u/usbmount
-USBMOUNT_DEPENDENCIES = udev lockfile-progs util-linux
+USBMOUNT_DEPENDENCIES = udev lockfile-progs
 
 define USBMOUNT_INSTALL_TARGET_CMDS
 	$(INSTALL) -m 0755 -D $(@D)/usbmount $(TARGET_DIR)/usr/share/usbmount/usbmount
Signature · 1 line
1.8.1.2
#9 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Sven> The blkid binary is not any longer installed when libblkid from Sven> util-linux is selected. udev has a builtin blkid command though Sven> and already detects all values that we are interested in. Change Sven> the usbmount script to use the environment variables set by udev Sven> instead of calling blkid directly.

Sven> Signed-off-by: Sven Neumann <[email protected]>

Committed, thanks. Please don't forget to send the patch upstream as well.

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

PATCH 1/1 usbmount: stop using blkid, use udev environment variables instead

Hello Peter,

Quoted 8 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Sven" == Sven Neumann <[email protected]> writes:

Sven> The blkid binary is not any longer installed when libblkid from Sven> util-linux is selected. udev has a builtin blkid command though Sven> and already detects all values that we are interested in. Change Sven> the usbmount script to use the environment variables set by udev Sven> instead of calling blkid directly.

Quoted 4 lines

Sven> Signed-off-by: Sven Neumann <[email protected]>

Committed, thanks. Please don't forget to send the patch upstream as well.

Well, I can try, but I am afraid that usbmount is not any longer maintained. The project page doesn't indicate any activity for year and the last commits in their SVN repository date back to 2009 (after the package has been officially orphaned in 2007).

Regards,
Sven