OBS User unknown 2007-09-20 12:15:32 +00:00 committed by Git OBS Bridge
parent 50b66891a4
commit 72e9d4e81b
3 changed files with 28 additions and 15 deletions

View File

@ -27,10 +27,10 @@ index d970d29..e6a7296 100644
rm -f core *.o $(EXEC)
diff --git a/kpartx/activate_dm_linear b/kpartx/activate_dm_linear
new file mode 100644
index 0000000..ee5c9ed
index 0000000..7481bd4
--- /dev/null
+++ b/kpartx/activate_dm_linear
@@ -0,0 +1,69 @@
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# activate_dm_linear
@ -80,14 +80,15 @@ index 0000000..ee5c9ed
+ ;;
+ esac
+done
+if [ "$scsilink" ] ; then
+ serial="$scsilink"
+ bus="scsi"
+fi
+if [ "$atalink" ] ; then
+ serial="$atalink"
+ bus="ata"
+fi
+if [ "$scsilink" ] ; then
+ unset atalink
+ serial="$scsilink"
+ bus="scsi"
+fi
+if [ "$serial" ]; then
+ # Remove existing rules
+ echo "/$serial/d
@ -96,13 +97,19 @@ index 0000000..ee5c9ed
+" | ed $RULE > /dev/null 2>&1
+ [ "$remove_only" = 1 ] && exit 0
+ # And create a new one
+ cat >> $RULE <<EOF
+ACTION=="add", KERNEL=="sd*[!0-9]", ID_BUS=="$bus", ID_SERIAL=="$serial", RUN+="/lib/udev/dm_linear \$kernel $blksize $bus-$serial"
+ if [ "$atalink" ] ; then
+ cat >> $RULE <<EOF
+ACTION=="add", KERNEL=="sd*[!0-9]", ENV{ID_VENDOR}=="ATA", ENV{ID_ATA_COMPAT}=="$serial", RUN+="dm_linear /dev/\$kernel $blksize ata-\$env{ID_ATA_COMPAT}"
+EOF
+ else
+ cat >> $RULE <<EOF
+ACTION=="add", KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="$bus", ENV{ID_SERIAL}=="$serial", RUN+="dm_linear \$kernel /dev/$blksize \$env{ID_BUS}-\$env{ID_SERIAL}"
+EOF
+ fi
+fi
diff --git a/kpartx/dm_linear b/kpartx/dm_linear
new file mode 100755
index 0000000..162cb60
index 0000000..d1de7e4
--- /dev/null
+++ b/kpartx/dm_linear
@@ -0,0 +1,27 @@
@ -129,7 +136,7 @@ index 0000000..162cb60
+ exit 4
+fi
+
+echo 0 $2 linear $1 0 | /sbin/dmsetup create "linear-$3" -u "linear-$3"
+echo 0 $2 linear $1 0 | /sbin/dmsetup create "$3" -u "linear-$3"
+
+exit $?
+
@ -148,7 +155,7 @@ index 9ab9a49..2746eff 100644
# Create persistent links for partitions
ENV{DM_PART}=="?*", \
SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_NAME}-part$env{DM_PART}"
@@ -30,6 +34,8 @@ ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="
@@ -30,6 +34,8 @@ ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="mpath-*", \
RUN+="/sbin/kpartx -a -p _part /dev/$kernel"
ENV{DM_STATE}=="ACTIVE", ENV{DM_UUID}=="dmraid-*", \
RUN+="/sbin/kpartx -a -p _part /dev/$kernel"

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Sep 19 15:30:41 CEST 2007 - hare@suse.de
- Fixup generated dm_linear udev rules (#218122)
-------------------------------------------------------------------
Thu Aug 30 09:24:27 CEST 2007 - hare@suse.de

View File

@ -12,14 +12,14 @@
Name: multipath-tools
BuildRequires: device-mapper-devel libaio-devel readline-devel
URL: http://christophe.varoqui.free.fr/
Url: http://christophe.varoqui.free.fr/
License: BSD 3-Clause, GPL v2 or later
Group: System/Base
Requires: device-mapper kpartx
PreReq: %insserv_prereq
Autoreqprov: on
AutoReqProv: on
Version: 0.4.7
Release: 74
Release: 77
Summary: Tools to Manage Multipathed Devices with the device-mapper
Source: multipath-tools-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -132,8 +132,9 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/multipath/
/lib/udev/kpartx_id
/lib/udev/dm_linear
%{_mandir}/man8/kpartx.8*
%changelog
* Wed Sep 19 2007 - hare@suse.de
- Fixup generated dm_linear udev rules (#218122)
* Thu Aug 30 2007 - hare@suse.de
- Rework dm_linear; udev rules should only be
created if the feature was activated (#302422)