diff options
author | Darik Horn <[email protected]> | 2011-12-04 13:10:46 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-12-05 09:46:48 -0800 |
commit | 9c8254f6f95b2b08e2031b2682a632e0df45cefb (patch) | |
tree | 360c43cd5b3b9da9b61e2d64a9a622a43e8728a7 /cmd | |
parent | 590338f63ee0db6f1fc7e6b5b23744d3944777b2 (diff) |
Support path_id changes in udev 174.
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 <[email protected]>
Closes: #429
Diffstat (limited to 'cmd')
-rwxr-xr-x | cmd/zpool_id/zpool_id | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/zpool_id/zpool_id b/cmd/zpool_id/zpool_id index 9d2a84549..a67beaca0 100755 --- a/cmd/zpool_id/zpool_id +++ b/cmd/zpool_id/zpool_id @@ -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 |