]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Support path_id changes in udev 174.
authorDarik Horn <dajhorn@vanadac.com>
Sun, 4 Dec 2011 19:10:46 +0000 (13:10 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 5 Dec 2011 17:46:48 +0000 (09:46 -0800)
The /lib/udev/path_id helper became a builtin command in the udev 174
release, so test whether path_id is external in the zpool_id script.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes: #429
cmd/zpool_id/zpool_id

index 9d2a845497ed452ce56df3ad92f370c72caec4f6..a67beaca026585c8ba623072b28ef21f7c7cec5f 100755 (executable)
@@ -1,9 +1,17 @@
 #!/bin/bash
 
 CONFIG=${CONFIG:-/etc/zfs/zdev.conf}
-PATH_ID=${PATH_ID:-/lib/udev/path_id}
 AWK=${AWK:-/usr/bin/awk}
 
+if [ -z "${PATH_ID}" ]; then
+       # The path_id helper became a builtin command in udev 174.
+       if [ -x '/lib/udev/path_id' ]; then
+               PATH_ID='/lib/udev/path_id'
+       else
+               PATH_ID='udevadm test-builtin path_id'
+       fi
+fi
+
 die() {
        echo "Error: $*"
        exit 1