OBS User unknown 2007-05-17 09:47:22 +00:00 committed by Git OBS Bridge
parent 5c5ecaa98d
commit e7e18dce4a
14 changed files with 8414 additions and 1083 deletions

View File

@ -1,25 +0,0 @@
#
# persistent links for device-mapper devices
# only hardware-backed device-mapper devices (ie multipath, dmraid,
# and kpartx) have meaningful persistent device names
#
KERNEL!="dm-*", GOTO="multipath_end"
ACTION=="add|remove", GOTO="multipath_end"
ACTION=="change", IMPORT{program}=="/sbin/kpartx_id %M %m"
# Create persistent links for tables
ACTION=="change", ENV{ID_DM_TABLE}=="mpath|dmraid", ENV{ID_DM_TYPE}=="?*", \
SYMLINK+="disk/by-id/$env{ID_DM_TYPE}-$env{ID_DM_NAME}"
# Create dm tables for partitions
ACTION=="change", ENV{ID_DM_TABLE}=="mpath|dmraid", \
RUN+="/sbin/kpartx -a -p _part /dev/mapper/$env{ID_DM_NAME}"
# Create persistent links for partitions
ACTION=="change", ENV{ID_DM_TABLE}=="part", ENV{ID_DM_TYPE}=="?*", \
SYMLINK+="disk/by-id/$env{ID_DM_TYPE}-$env{ID_DM_NAME}-part$env{ID_DM_PART}"
LABEL="multipath_end"

View File

@ -1,10 +0,0 @@
#
# SLES9 compability symlinks for multipathed devices
#
# Devices
ENV{ID_DMTYPE}=="multipath", ENV{ID_MPATH}=="?*", \
SYMLINK+="disk/by-name/$env{ID_MPATH}"
# Partitions
ENV{ID_DMTYPE}=="linear", ENV{ID_MPATH}=="?*", \
SYMLINK+="disk/by-name/$env{ID_MPATH}"

View File

@ -1,104 +0,0 @@
#! /bin/sh
# Copyright (c) 2005 SuSE GmbH Nuernberg, Germany.
#
# Author: Hannes Reinecke <feedback@suse.de>
#
# init.d/boot.multipath
#
### BEGIN INIT INFO
# Provides: boot.multipath
# Required-Start: boot.device-mapper boot.udev
# Required-Stop:
# Default-Start: B
# Default-Stop:
# Description: Create multipath device targets
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PROGRAM=/sbin/multipath
# Set the maximum number of open files
MAX_OPEN_FDS=4096
test -x $PROGRAM || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - misc error
# 2 - invalid or excess args
# 3 - unimplemented feature (e.g. reload)
# 4 - insufficient privilege
# 5 - program not installed
# 6 - program not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Creating multipath targets"
# Check whether multipath daemon is already running
if /sbin/multipathd -k"list paths" > /dev/null 2>&1 ; then
echo -n " (multipathd running)"
rc_status -v
rc_exit
fi
# Load prerequisite module
modprobe dm-multipath
# Be a chicken and flush all existing maps
$PROGRAM -F
# Clear /dev/disk/by-name/ prior to start-up; multipath will
# recreate them.
rm -f /dev/disk/by-name/* 2>&1 >/dev/null
# Set the maximum number of open files
if [ -n "$MAX_OPEN_FDS" ] ; then
ulimit -n $MAX_OPEN_FDS
fi
# Start the program directly as checkproc doesn't work here
$PROGRAM -v 0
# Create all partitions which might have been missing
/sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p -part"
# Remember status and be verbose
rc_status -v
sleep 1
;;
stop)
# Remove all partition mappings
if dmsetup ls | grep -q -- -part; then
/sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -d -p -part"
fi
# And remove the multipath mappings themselves
for map in $(/sbin/dmsetup ls --target multipath | cut -f 1); do
/sbin/dmsetup remove $map
done
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
rc_exit

110
kpartx_id
View File

@ -1,110 +0,0 @@
#!/bin/bash
#
# kpartx_id
#
# Generates ID information for device-mapper tables.
#
# Copyright (C) 2006 SUSE Linux Products GmbH
# Author:
# Hannes Reinecke <hare@suse.de>
#
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation version 2 of the License.
#
# This script generates ID information used to generate persistent symlinks.
# It relies on the UUID strings generated by the various programs; the name
# of the tables are of no consequence.
#
# Please note that dmraid does not provide the UUIDs (yet); a patch has been
# sent upstream but has not been accepted yet.
#
DMSETUP=/sbin/dmsetup
MAJOR=$1
MINOR=$2
if [ -z "$MAJOR" -o -z "$MINOR" ]; then
echo "usage: $0 major minor"
exit 1;
fi
# Device-mapper not installed; not an error
if [ ! -x $DMSETUP ] ; then
exit 0
fi
# Get the table info
tblinfo=$($DMSETUP info -c --noheadings -o name,uuid -j $MAJOR -m $MINOR)
if [ $? -ne 0 ] || [ -z "$tblinfo" ]; then
exit $?
fi
set -- $(IFS=":"; echo $tblinfo)
tblname=$1
tbluuid=$2
if [ -z "$tbluuid" ] ; then
exit 0
fi
# Table UUIDs are always '<type>-<uuid>'.
dmuuid=${tbluuid#*-}
dmtbl=${tbluuid%%-*}
dmpart=${dmtbl#part}
# kpartx types are 'part<num>'
if [ "$dmpart" == "$dmtbl" ] ; then
dmpart=
else
dmtbl=part
fi
# Set the name of the table. We're only interested in dmraid,
# multipath, and kparts tables; everything else is ignored.
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)
# We need the dependencies of the parent table to figure out
# the type if the parent is a multipath table
case "$dmparent" in
mpath-*)
dmdeps=$($DMSETUP deps -u $dmuuid)
;;
esac
elif [ "$dmtbl" == "mpath" ] ; then
dmname=$tblname
# We need the dependencies of the table to figure out the type
dmdeps=$($DMSETUP deps -u $tbluuid)
elif [ "$dmtbl" == "dmraid" ] ; then
dmname=$tblname
fi
if [ -z "$dmname" ] ; then
exit 0
fi
echo "ID_DM_TABLE=$dmtbl"
echo "ID_DM_NAME=$dmname"
[ -n "$dmpart" ] && echo "ID_DM_PART=$dmpart"
# Figure out the type of the map. For non-multipath maps it's
# always 'raid'.
if [ -n "$dmdeps" ] ; then
case "$dmdeps" in
*\(94,*)
echo "ID_DM_TYPE=dasd"
;;
*\(9*)
echo "ID_DM_TYPE=raid"
;;
*)
echo "ID_DM_TYPE=scsi"
;;
esac
else
echo "ID_DM_TYPE=raid"
fi
exit 0

View File

@ -1,19 +0,0 @@
#!/bin/sh
major=$1
minor=$2
mpstatus=$(/sbin/dmsetup status -j $major -m $minor --target multipath)
if [ -z "$mpstatus" ]; then
exit 1
fi
mpid=$(/sbin/dmsetup info -c --noopencount --noheadings -o name -j $major -m $minor)
if [ -z "$mpid" ]; then
exit 1
fi
echo ID_MPATH=\"$mpid\"
exit 0

File diff suppressed because it is too large Load Diff

2036
multipath-tools-local-fixes Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,140 +0,0 @@
diff --git a/devmap_name/Makefile b/devmap_name/Makefile
index 380c85b..5551c9b 100644
--- a/devmap_name/Makefile
+++ b/devmap_name/Makefile
@@ -22,21 +22,19 @@ prepare:
glibc: prepare $(OBJS)
$(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
klibc: prepare $(OBJS)
$(CC) -static -o $(EXEC) $(OBJS)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
install:
install -d $(DESTDIR)$(bindir)
install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/
install -d $(DESTDIR)$(mandir)
- install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
+ install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
- rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
+ rm $(DESTDIR)$(mandir)/$(EXEC).8
clean:
rm -f core *.o $(EXEC) *.gz
diff --git a/kpartx/Makefile b/kpartx/Makefile
index bf6e6c1..691ecbe 100644
--- a/kpartx/Makefile
+++ b/kpartx/Makefile
@@ -27,11 +27,9 @@ prepare:
glibc: prepare $(OBJS)
$(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
-
+
klibc: prepare $(OBJS)
$(CC) -static -o $(EXEC) $(CRT0) $(OBJS) $(KLIBC) $(LIBGCC)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
$(MULTIPATHLIB)-$(BUILD).a:
make -C $(multipathdir) BUILD=$(BUILD)
@@ -40,7 +38,7 @@ install:
install -d $(DESTDIR)$(bindir)
install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(mandir)
- install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
+ install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
uninstall:
rm -f $(DESTDIR)$(bindir)/$(EXEC)
diff --git a/multipath/Makefile b/multipath/Makefile
index 646dfc2..add1972 100644
--- a/multipath/Makefile
+++ b/multipath/Makefile
@@ -25,11 +25,9 @@ prepare:
glibc: prepare $(OBJS)
$(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
klibc: prepare $(OBJS)
$(CC) -static -o $(EXEC) $(CRT0) $(OBJS) $(KLIBC) $(LIBGCC)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
$(CHECKERSLIB)-$(BUILD).a:
make -C $(checkersdir) BUILD=$(BUILD) $(BUILD)
@@ -43,12 +41,12 @@ install:
install -d $(DESTDIR)/etc/udev/rules.d
install -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
install -d $(DESTDIR)$(mandir)
- install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
+ install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
uninstall:
rm $(DESTDIR)/etc/udev/rules.d/multipath.rules
rm $(DESTDIR)$(bindir)/$(EXEC)
- rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
+ rm $(DESTDIR)$(mandir)/$(EXEC).8
clean:
rm -f core *.o $(EXEC) *.gz
diff --git a/multipathd/Makefile b/multipathd/Makefile
index 8ad25ee..da351dc 100644
--- a/multipathd/Makefile
+++ b/multipathd/Makefile
@@ -35,7 +35,6 @@ klibc:
$(EXEC): clean $(OBJS)
$(CC) $(OBJS) -o $(EXEC) $(LDFLAGS)
- $(GZIP) $(EXEC).8 > $(EXEC).8.gz
$(CHECKERSLIB)-glibc.a:
$(MAKE) -C $(checkersdir) BUILD=glibc glibc
@@ -48,12 +47,12 @@ install:
install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(rcdir)
install -d $(DESTDIR)$(mandir)
- install -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)
+ install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
uninstall:
rm -f $(DESTDIR)$(bindir)/$(EXEC)
rm -f $(DESTDIR)$(rcdir)/$(EXEC)
- rm -f $(DESTDIR)$(mandir)/$(EXEC).8.gz
+ rm -f $(DESTDIR)$(mandir)/$(EXEC).8
clean:
$(MAKE) -C $(multipathdir) prepare DAEMON=1
diff --git a/path_priority/pp_alua/Makefile b/path_priority/pp_alua/Makefile
index 983ffe3..c38990e 100644
--- a/path_priority/pp_alua/Makefile
+++ b/path_priority/pp_alua/Makefile
@@ -35,20 +35,17 @@ glibc: $(OBJS)
klibc: $(OBJS)
$(CC) -static -o $(EXEC) $(OBJS)
-install: $(BUILD) $(EXEC).8.gz
+install: $(BUILD) $(EXEC).8
$(INSTALL) -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
- $(INSTALL) -m 644 $(EXEC).8.gz $(DESTDIR)$(mandir)/$(EXEC).8.gz
+ $(INSTALL) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)/$(EXEC).8
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
- rm $(DESTDIR)$(mandir)/$(EXEC).8.gz
+ rm $(DESTDIR)$(mandir)/$(EXEC).8
clean:
rm -f *.o *.gz $(EXEC)
-$(EXEC).8.gz: $(EXEC).8
- $(GZIP) $< >$@
-
main.o: main.c rtpg.h spc3.h
rtpg.o: rtpg.c rtpg.h spc3.h

View File

@ -1,107 +0,0 @@
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -209,6 +209,44 @@ sysfs_get_size (char * sysfs_path, char
return 0;
}
+int
+sysfs_get_online (char * sysfs_path, char * dev)
+{
+ char attr_path[SYSFS_PATH_SIZE];
+ char attr_buff[SYSFS_PATH_SIZE];
+ long r;
+ char *p;
+
+ if (safe_sprintf(attr_path, "%s/block/%s/online", sysfs_path, dev))
+ return -1;
+
+ if (0 > sysfs_read_attribute_value(attr_path, attr_buff, sizeof(attr_buff)))
+ return -1;
+
+ r = strtol(attr_buff,&p, 10);
+
+ if (attr_buff != p && r > 0)
+ return 1;
+
+ return 0;
+}
+
+int writeattr (char *path, const char *value)
+{
+ struct sysfs_attribute *attr;
+ int retval;
+
+ attr = sysfs_open_attribute(path);
+ if (!attr)
+ return -1;
+
+ retval = sysfs_write_attribute(attr, value, strlen(value));
+
+ sysfs_close_attribute(attr);
+
+ return retval > 0? -1 : 0;
+}
+
/*
* udev might be slow creating node files : wait
*/
@@ -565,6 +603,30 @@ sysfs_pathinfo(struct path * curpath)
return 0;
}
+extern int
+online_device(struct path *curpath)
+{
+ int online;
+ char attr_path[FILE_NAME_SIZE];
+
+ online = sysfs_get_online(sysfs_path, curpath->dev);
+ if (online > 0)
+ return 0;
+ else if(online < 0)
+ return 1;
+
+ if(safe_sprintf(attr_path, "%s/block/%s/device/online",
+ sysfs_path, curpath->dev)) {
+ condlog(0, "attr_path too small");
+ return 1;
+ }
+
+ condlog(1,"%s: setting device online", curpath->dev);
+ writeattr(attr_path, "1");
+
+ return 0;
+}
+
static int
apply_format (char * string, char * cmd, struct path * pp)
{
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
--- a/libmultipath/discovery.h
+++ b/libmultipath/discovery.h
@@ -28,6 +28,7 @@ int sysfs_get_dev (char * sysfs_path, ch
int sysfs_get_size (char * sysfs_path, char * dev, unsigned long long *);
int path_discovery (vector pathvec, struct config * conf, int flag);
+int online_device (struct path *curpath);
void basename (char *, char *);
int get_serial (char * buff, int fd);
diff --git a/multipathd/main.c b/multipathd/main.c
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1185,6 +1185,13 @@ checkerloop (void *ap)
condlog(0, "%s: checkfn is void", pp->dev);
continue;
}
+
+ /*
+ * Set the device online for checkers
+ * to run successfully
+ */
+ online_device(pp);
+
newstate = pp->checkfn(pp->fd, checker_msg,
&pp->checker_context);

View File

@ -1,121 +0,0 @@
--- devmap_name/Makefile
+++ devmap_name/Makefile
@@ -28,7 +28,7 @@
install:
install -d $(DESTDIR)$(bindir)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/
install -d $(DESTDIR)$(mandir)
install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
--- kpartx/Makefile
+++ kpartx/Makefile
@@ -36,7 +36,7 @@
install:
install -d $(DESTDIR)$(bindir)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(mandir)
install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
--- multipath/Makefile
+++ multipath/Makefile
@@ -37,7 +37,7 @@
install:
install -d $(DESTDIR)$(bindir)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/
install -d $(DESTDIR)/etc/udev/rules.d
install -m 644 multipath.rules $(DESTDIR)/etc/udev/rules.d/
install -d $(DESTDIR)$(mandir)
--- multipathd/Makefile
+++ multipathd/Makefile
@@ -44,7 +44,7 @@
install:
install -d $(DESTDIR)$(bindir)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)
install -d $(DESTDIR)$(rcdir)
install -d $(DESTDIR)$(mandir)
install -m 644 $(EXEC).8 $(DESTDIR)$(mandir)
--- path_priority/pp_alua/Makefile
+++ path_priority/pp_alua/Makefile
@@ -36,7 +36,7 @@
$(CC) -static -o $(EXEC) $(OBJS)
install: $(BUILD) $(EXEC).8
- $(INSTALL) -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+ $(INSTALL) -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
$(INSTALL) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)/$(EXEC).8
uninstall:
--- path_priority/pp_balance_units/Makefile
+++ path_priority/pp_balance_units/Makefile
@@ -35,7 +35,7 @@
install:
install -d $(DESTDIR)$(bindir)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
--- path_priority/pp_emc/Makefile
+++ path_priority/pp_emc/Makefile
@@ -14,7 +14,7 @@
$(CC) -static -o $(EXEC) $(OBJS)
install: $(EXEC)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
--- path_priority/pp_hds_modular/Makefile
+++ path_priority/pp_hds_modular/Makefile
@@ -14,7 +14,7 @@
$(CC) -static -o $(EXEC) $(OBJS)
install: $(EXEC)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
--- path_priority/pp_netapp/Makefile
+++ path_priority/pp_netapp/Makefile
@@ -14,7 +14,7 @@
$(CC) -static -o $(EXEC) $(OBJS)
install: $(EXEC)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
--- path_priority/pp_random/Makefile
+++ path_priority/pp_random/Makefile
@@ -14,7 +14,7 @@
$(CC) -static -o $(EXEC) $(OBJS)
install: $(EXEC)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)
--- path_priority/pp_tpc/Makefile
+++ path_priority/pp_tpc/Makefile
@@ -14,7 +14,7 @@
$(CC) -static -o $(EXEC) $(OBJS)
install: $(EXEC)
- install -s -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
+ install -m 755 $(EXEC) $(DESTDIR)$(bindir)/$(EXEC)
uninstall:
rm $(DESTDIR)$(bindir)/$(EXEC)

3096
multipath-tools-suse-update Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon May 14 16:20:55 CEST 2007 - hare@suse.de
- Merge in latest fixes from upstream
- Add all SuSE specific files to git repository.
-------------------------------------------------------------------
Fri May 11 16:06:16 CEST 2007 - hare@suse.de
- Include latest changes from upstream
- Remove libsysfs (242766)
- Handle extended partitions for kpartx
-------------------------------------------------------------------
Mon Dec 4 16:51:13 CET 2006 - dmueller@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package multipath-tools (Version 0.4.7)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@ -11,7 +11,7 @@
# norootforbuild
Name: multipath-tools
BuildRequires: device-mapper-devel readline-devel sysfsutils
BuildRequires: device-mapper-devel readline-devel
URL: http://christophe.varoqui.free.fr/
License: BSD License and BSD-like, GNU General Public License (GPL)
Group: System/Base
@ -21,20 +21,13 @@ PreReq: %insserv_prereq
%endif
Autoreqprov: on
Version: 0.4.7
Release: 29
Release: 48
Summary: Tools to Manage Multipathed Devices with the device-mapper
Source: multipath-tools-%{version}.tar.bz2
Source1: multipathd
Source3: 71-multipath.rules
Source4: boot.multipath
Source5: mpath_id
Source6: kpartx_id
Source7: 72-multipath-compat.rules
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Patch0: %{name}-git-update.patch
Patch10: %{name}-online-device.patch
Patch11: %{name}-no-gz-for-manpage
Patch15: %{name}-strip.patch
Patch1: %{name}-local-fixes
Patch10: %{name}-suse-update
%description
This package provides the tools to manage multipathed devices by
@ -60,8 +53,8 @@ Authors:
%prep
%setup -n multipath-tools-%{version}
%patch0 -p1
%patch11 -p1
%patch15
%patch1 -p1
%patch10 -p1
%build
make OPTFLAGS="$RPM_OPT_FLAGS" BUILD=glibc
@ -71,13 +64,10 @@ mkdir -p $RPM_BUILD_ROOT/sbin
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
make DESTDIR=$RPM_BUILD_ROOT install
rm $RPM_BUILD_ROOT/etc/udev/rules.d/multipath.rules
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/udev/rules.d
install -m 644 %{SOURCE7} $RPM_BUILD_ROOT/etc/udev/rules.d
install -m 644 multipathd/71-multipath.rules $RPM_BUILD_ROOT/etc/udev/rules.d
mkdir -p $RPM_BUILD_ROOT/etc/init.d
install -m 744 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d
install -m 744 %{SOURCE4} $RPM_BUILD_ROOT/etc/init.d
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/sbin
install -m 755 %{SOURCE6} $RPM_BUILD_ROOT/sbin
install -m 744 multipath/multipath.init.suse $RPM_BUILD_ROOT/etc/init.d/boot.multipath
install -m 744 multipathd/multipathd.init.suse $RPM_BUILD_ROOT/etc/init.d/multipathd
mkdir -p $RPM_BUILD_ROOT/var/cache/multipath/
%clean
@ -100,7 +90,6 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/multipath/
/sbin/devmap_name
/sbin/multipath
/sbin/kpartx
/sbin/mpath_id
/sbin/kpartx_id
/sbin/multipathd
/sbin/mpath_prio_netapp
@ -110,14 +99,23 @@ mkdir -p $RPM_BUILD_ROOT/var/cache/multipath/
/sbin/mpath_prio_emc
/sbin/mpath_prio_tpc
/sbin/mpath_prio_hds_modular
/sbin/mpath_prio_hp_sw
%attr (0700, root, root) /var/cache/multipath
%{_mandir}/man8/devmap_name.8*
%{_mandir}/man8/multipath.8*
%{_mandir}/man5/multipath.conf.5*
%{_mandir}/man8/kpartx.8*
%{_mandir}/man8/multipathd.8*
%{_mandir}/man8/mpath_prio_alua.8*
%changelog -n multipath-tools
%changelog
* Mon May 14 2007 - hare@suse.de
- Merge in latest fixes from upstream
- Add all SuSE specific files to git repository.
* Fri May 11 2007 - hare@suse.de
- Include latest changes from upstream
- Remove libsysfs (242766)
- Handle extended partitions for kpartx
* Mon Dec 04 2006 - dmueller@suse.de
- don't build as root
* Fri Nov 17 2006 - hare@suse.de

View File

@ -1,155 +0,0 @@
#! /bin/sh
# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.
#
# Author: Thorsten Kukuk <feedback@suse.de>
#
# init.d/routed
#
# and symbolic its link
#
# /usr/sbin/rcrouted
#
### BEGIN INIT INFO
# Provides: multipathd
# Required-Start: $syslog
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 4 6
# Description: Starts multipath daemon
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/sbin/multipathd
PIDFILE=/var/run/multipathd.pid
# Set the maximum number of open files
MAX_OPEN_FDS=4096
test -x $DAEMON || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - misc error
# 2 - invalid or excess args
# 3 - unimplemented feature (e.g. reload)
# 4 - insufficient privilege
# 5 - program not installed
# 6 - program not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting multipathd"
modprobe dm-multipath
# Set the maximum number of open files
if [ -n "$MAX_OPEN_FDS" ] ; then
ulimit -n $MAX_OPEN_FDS
fi
if [ -f $PIDFILE ]; then
PID="$(cat $PIDFILE)"
PROCNAME="$(ps -o cmd --no-headers $PID)"
fi
if [ "$PROCNAME" != "$DAEMON" ]; then
$DAEMON
fi
# Remember status and be verbose
rc_status -v
sleep 1
;;
stop)
echo -n "Shutting down multipathd"
# Because of the way how multipathd sets up its own namespace
# and chroots to it, killproc cannot be used with this process.
# So implement a cruder version:
if [ -f $PIDFILE ]; then
PID="$(cat $PIDFILE)"
PROCNAME="$(ps -o cmd --no-headers $PID)"
fi
if [ "$PROCNAME" == "$DAEMON" ]; then
kill -TERM $PID
fi
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
restart|force-reload)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
reload)
## Like force-reload, but if daemon does not support
## signalling, do nothing (!)
# If it does not support reload:
exit 3
;;
status)
echo -n "Checking for multipathd: "
# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running
if [ -f $PIDFILE ]; then
PID="$(cat $PIDFILE)"
PROCNAME="$(ps -o cmd --no-headers $PID)"
if [ "$PROCNAME" == "$DAEMON" ]; then
(exit 0)
else
(exit 1)
fi
else
(exit 3)
fi
rc_status -v
;;
probe)
## Optional: Probe for the necessity of a reload,
## give out the argument which is required for a reload.
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit