Skip to contentSkip to conversation

Call /lib/udev/scsi_id instead of /sbin/scsi_id

PATCH New Guido Guenther 1 participant 4 messages Jun 16, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Call /lib/udev/scsi_id instead of /sbin/scsi_id

libmultipath/defaults.h +1 -1
index 8deeb0f..df7d971 100644
@@ -1,4 +1,4 @@
-#define DEFAULT_GETUID		"/sbin/scsi_id -g -u -s /block/%n"
+#define DEFAULT_GETUID		"/lib/udev/scsi_id -g -u -s /block/%n"
 #define DEFAULT_UDEVDIR		"/dev"
 #define DEFAULT_SELECTOR	"round-robin 0"
 #define DEFAULT_FEATURES	"0"
libmultipath/hwtable.c +1 -1
index 2a5f2d5..c7bcf3d 100644
@@ -183,7 +183,7 @@ static struct hwentry default_hw[] = {
 	{
 		.vendor        = "EMC",
 		.product       = "SYMMETRIX",
-		.getuid        = "/sbin/scsi_id -g -u -ppre-spc3-83 -s /block/%n",
+		.getuid        = "/lib/udev/scsi_id -g -u -ppre-spc3-83 -s /block/%n",
 		.getprio       = NULL,
 		.features      = DEFAULT_FEATURES,
 		.hwhandler     = DEFAULT_HWHANDLER,
multipath.conf.annotated +5 -5
index 649ff8c..edb6628 100644
@@ -11,7 +11,7 @@
 #	#
 #	# name    : udev_dir
 #	# desc    : directory where udev creates its device nodes
-#	# default : /udev
+#	# default : /dev
 #	#
 #	udev_dir	/dev
 #
@@ -47,9 +47,9 @@
 #	# scope   : multipath
 #	# desc    : the default program and args to callout to obtain a unique 
 #	#           path identifier. Absolute path required
-#	# default : /sbin/scsi_id -g -u -s
+#	# default : /lib/udev/scsi_id -g -u -s
 #	#
-#	getuid_callout	"/sbin/scsi_id -g -u -s /block/%n"
+#	getuid_callout	"/lib/udev/scsi_id -g -u -s /block/%n"
 #
 #	#
 #	# name    : prio_callout
@@ -291,9 +291,9 @@
 #		# scope   : multipath
 #		# desc    : the program and args to callout to obtain a unique 
 #		#           path identifier. Absolute path required
-#		# default : /sbin/scsi_id -g -u -s
+#		# default : /lib/udev/scsi_id -g -u -s
 #		#
-#		getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
+#		getuid_callout          "/lib/udev/scsi_id -g -u -s /block/%n"
 #
 #		#
 #		# name    : prio_callout
multipath.conf.synthetic +2 -2
index e5e6cd0..1250c63 100644
@@ -7,7 +7,7 @@
 #	polling_interval 	10
 #	selector		"round-robin 0"
 #	path_grouping_policy	multibus
-#	getuid_callout		"/sbin/scsi_id -g -u -s /block/%n"
+#	getuid_callout		"/lib/udev/scsi_id -g -u -s /block/%n"
 #	prio_callout		/bin/true
 #	path_checker		readsector0
 #	rr_min_io		100
@@ -52,7 +52,7 @@
 #		vendor			"COMPAQ  "
 #		product			"HSV110 (C)COMPAQ"
 #		path_grouping_policy	multibus
-#		getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
+#		getuid_callout          "/lib/udev/scsi_id -g -u -s /block/%n"
 #		path_checker		readsector0
 #		path_selector		"round-robin 0"
 #		hardware_handler	"0"
multipath/02_multipath +2 -2
index 1a5d5a1..067c582 100755
@@ -12,10 +12,10 @@ cp /sbin/kpartx $INITRDDIR/sbin
 # feed the dependencies too
 # scsi_id is dynamicaly linked, so store the libs too
 #
-cp /sbin/scsi_id $INITRDDIR/sbin
+cp /lib/udev/scsi_id $INITRDDIR/lib/udev/
 cp /bin/mountpoint $INITRDDIR/bin
 
-PROGS="/sbin/scsi_id /bin/mountpoint"
+PROGS="/lib/udev/scsi_id /bin/mountpoint"
 LIBS=`ldd $PROGS | grep -v linux-gate.so | sort -u | \
 awk '{print $3}'` 
 for i in $LIBS
multipath/multipath.conf.5 +1 -1
index 1c1c0db..905cb65 100644
@@ -109,7 +109,7 @@ Default value is \fImultibus\fR.
 The default program and args to callout to obtain a unique path
 identifier. Should be specified with an absolute path. Default value
 is
-.I /sbin/scsi_id -g -u -s
+.I /lib/udev/scsi_id -g -u -s
 .TP
 .B prio_callout
 The default program and args to callout to obtain a path priority
path_priority/pp_hds_modular/pp_hds_modular.c +1 -1
index f38ebcf..e93ea8d 100644
@@ -56,7 +56,7 @@
  *                path_grouping_policy    group_by_prio
  *                prio_callout            "/sbin/pp_hds_modular %d"
  *                path_checker            readsector0
- *                getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
+ *                getuid_callout          "/lib/udev/scsi_id -g -u -s /block/%n"
  *                failback                immediate
  *        }
  *        device {
Signature · 1 line
1.5.2.1
#1 lore raw

PATCH 2/3 move kpartx_id to /lib/udev

Makefile.inc +1 -0
index 7eb3dfb..6a9dcc1 100644
@@ -22,6 +22,7 @@ endif
 prefix      = 
 exec_prefix = $(prefix)
 bindir      = $(exec_prefix)/sbin
+libudevdir  = ${prefix}/lib/udev
 checkersdir = $(TOPDIR)/libcheckers
 multipathdir = $(TOPDIR)/libmultipath
 mandir      = $(prefix)/usr/share/man/man8
kpartx/Makefile +2 -1
index f829055..082d15f 100644
@@ -39,7 +39,8 @@ $(MULTIPATHLIB)-$(BUILD).a:
 install: $(EXEC) $(EXEC).8
 	install -d $(DESTDIR)$(bindir)
 	install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)
-	install -m 755 kpartx_id $(DESTDIR)$(bindir)
+	install -d $(DESTDIR)$(libudevdir)
+	install -m 755 kpartx_id $(DESTDIR)$(libudevdir)
 	install -d $(DESTDIR)/etc/udev/rules.d
 	install -m 644 kpartx.rules $(DESTDIR)/etc/udev/rules.d/
 	install -d $(DESTDIR)$(mandir)
kpartx/kpartx.rules +1 -1
index 9bd7db7..f32c718 100644
@@ -9,7 +9,7 @@ ACTION=="remove", GOTO="kpartx_end"
 
 ENV{DM_TABLE_STATE}!="LIVE", GOTO="kpartx_end"
 
-ENV{DM_UUID}=="?*", IMPORT{program}=="/sbin/kpartx_id %M %m $env{DM_UUID}"
+ENV{DM_UUID}=="?*", IMPORT{program}=="/lib/udev/kpartx_id %M %m $env{DM_UUID}"
 
 OPTIONS="link_priority=50"
 
Signature · 1 line
1.5.2.1
#2 lore raw

PATCH 3/3 remove bashisms from kpartx_id

kpartx/kpartx_id +5 -5
index e876b98..81f32bf 100644
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # kpartx_id
 #
@@ -43,7 +43,7 @@ dmuuid=${UUID#*-}
 dmtbl=${UUID%%-*}
 dmpart=${dmtbl#part}
 # kpartx types are 'part<num>'
-if [ "$dmpart" == "$dmtbl" ] ; then
+if [ "$dmpart" = "$dmtbl" ] ; then
     dmpart=
 else
     dmtbl=part
@@ -51,7 +51,7 @@ fi
 
 # Set the name of the table. We're only interested in dmraid,
 # multipath, and kpartx tables; everything else is ignored.
-if [ "$dmtbl" == "part" ] ; then
+if [ "$dmtbl" = "part" ] ; then
     # The name of the kpartx table is the name of the parent table
     dmname=$($DMSETUP info  -c --noheadings -o name -u $dmuuid)
     echo "DM_NAME=$dmname"
@@ -62,11 +62,11 @@ if [ "$dmtbl" == "part" ] ; then
 	    dmdeps=$($DMSETUP deps -u $dmuuid)
 	    ;;
     esac
-elif [ "$dmtbl" == "mpath" ] ; then
+elif [ "$dmtbl" = "mpath" ] ; then
     dmname=$tblname
     # We need the dependencies of the table to figure out the type
     dmdeps=$($DMSETUP deps -u $UUID)
-elif [ "$dmtbl" == "dmraid" ] ; then
+elif [ "$dmtbl" = "dmraid" ] ; then
     dmname=$tblname
 fi
 
Signature · 1 line
1.5.2.1