aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/multipath-tools/files
diff options
context:
space:
mode:
authorJoe Slater <jslater@windriver.com>2014-09-22 17:22:32 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2014-09-26 05:41:54 +0200
commit48e5c5ef39d70c3b00f755d09811f497e6d23f53 (patch)
tree595d81d3ee1e3bc91f1949c5a05f060fa9216712 /meta-oe/recipes-support/multipath-tools/files
parent0a67b9f3fd164b808c66286ff0435c65421e5352 (diff)
downloadmeta-openembedded-contrib-48e5c5ef39d70c3b00f755d09811f497e6d23f53.tar.gz
multipath-tools: update to version 0.5.0+
SCRREV includes patches up to 9/12/2014. Modify upstream source to be better set up for cross compilation. Signed-off-by: Joe Slater <jslater@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/multipath-tools/files')
-rw-r--r--meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch29
-rw-r--r--meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch44
-rw-r--r--meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch36
-rwxr-xr-xmeta-oe/recipes-support/multipath-tools/files/multipathd.oe146
4 files changed, 255 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch b/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
new file mode 100644
index 0000000000..a16a854052
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
@@ -0,0 +1,29 @@
+Always use devmapper for kpartx
+
+Do not try to compute the LIBDM_API_COOKIE make variable
+from host information when cross-compiling.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/kpartx/Makefile b/kpartx/Makefile
+index 2a07334..24bdabc 100644
+--- a/kpartx/Makefile
++++ b/kpartx/Makefile
+@@ -4,13 +4,7 @@
+ #
+ include ../Makefile.inc
+
+-CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-
+-LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
+-
+-ifneq ($(strip $(LIBDM_API_COOKIE)),0)
+- CFLAGS += -DLIBDM_API_COOKIE
+-endif
++CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLIBDM_API_COOKIE
+
+ LDFLAGS = -ldevmapper
+ OBJS = bsd.o dos.o kpartx.o solaris.o unixware.o dasd.o sun.o \
diff --git a/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch b/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
new file mode 100644
index 0000000000..89d2352dab
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
@@ -0,0 +1,44 @@
+Always use devmapper
+
+Do not try to compute several _API_ make variables
+from host information when cross-compiling.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+diff --git a/libmultipath/Makefile b/libmultipath/Makefile
+index e5b06b3..efd6cf6 100644
+--- a/libmultipath/Makefile
++++ b/libmultipath/Makefile
+@@ -17,23 +17,18 @@ OBJS = memory.o parser.o vector.o devmapper.o \
+ log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \
+ lock.o waiter.o file.o wwids.o
+
+-LIBDM_API_FLUSH = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_no_flush' /usr/include/libdevmapper.h)
+
+-ifneq ($(strip $(LIBDM_API_FLUSH)),0)
++#ifneq ($(strip $(LIBDM_API_FLUSH)),0)
+ CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
+-endif
++#endif
+
+-LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
+-
+-ifneq ($(strip $(LIBDM_API_COOKIE)),0)
++#ifneq ($(strip $(LIBDM_API_COOKIE)),0)
+ CFLAGS += -DLIBDM_API_COOKIE
+-endif
+-
+-LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_resolve_buffer_size' /usr/include/libudev.h)
++#endif
+
+-ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
++#ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
+ CFLAGS += -DLIBUDEV_API_RECVBUF
+-endif
++#endif
+
+
+ all: $(LIBS)
diff --git a/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch b/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
new file mode 100644
index 0000000000..ff71f39675
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
@@ -0,0 +1,36 @@
+multipath-tools: modify Makefile.inc for cross-compilation
+
+Do not look for systemd info on the host, and allow us to pass in CFLAGS
+using the OPTFLAGS variable.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -21,12 +21,6 @@ ifndef LIB
+ endif
+ endif
+
+-ifndef SYSTEMD
+- ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1)
+- SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p')
+- endif
+-endif
+-
+ prefix =
+ exec_prefix = $(prefix)
+ bindir = $(exec_prefix)/sbin
+@@ -49,7 +43,10 @@ ifndef RPM_OPT_FLAGS
+ RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
+ endif
+
++ifndef OPTFLAGS
+ OPTFLAGS = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
++endif
++
+ CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
+ SHARED_FLAGS = -shared
+
diff --git a/meta-oe/recipes-support/multipath-tools/files/multipathd.oe b/meta-oe/recipes-support/multipath-tools/files/multipathd.oe
new file mode 100755
index 0000000000..3bdf875e3c
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/multipathd.oe
@@ -0,0 +1,146 @@
+#!/bin/bash
+#
+# multipathd Starts the multipath daemon
+#
+# chkconfig: - 06 87
+# description: Manages device-mapper multipath devices
+
+### BEGIN INIT INFO
+# Provides: multipathd
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:
+# Short-Description: Control multipathd
+# Description: This service monitors and manages
+# device-mapper multipath devices
+### END INIT INFO
+
+DAEMON=/sbin/multipathd
+prog=`basename $DAEMON`
+initdir=/etc/init.d
+lockdir=/var/lock/subsys
+sysconfig=/etc/sysconfig
+syspath=/sys/block
+
+RETVAL=0
+
+teardown_slaves()
+{
+pushd $1 > /dev/null
+if [ -d "slaves" ]; then
+for slave in slaves/*;
+do
+ if [ "$slave" = "slaves/*" ]; then
+ read dev < $1/dev
+ tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
+ if ! [ -z $tablename ]; then
+ echo "Root is on a multipathed device, multipathd can not be stopped"
+ exit 1
+ fi
+ else
+ local_slave=`readlink -f $slave`;
+ teardown_slaves $local_slave;
+ fi
+ done
+
+else
+ read dev < $1/dev
+ tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
+ if ! [ -z $tablename ]; then
+ echo "Root is on a multipathed device, multipathd can not be stopped"
+ exit 1
+ fi
+fi
+popd > /dev/null
+}
+
+#
+# See how we were called.
+#
+
+start() {
+ test -x $DAEMON || exit 5
+ echo -n $"Starting $prog daemon: "
+ start-stop-daemon --start --quiet --exec $DAEMON
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch $lockdir/$prog
+ echo
+}
+
+force_stop() {
+ echo -n $"Stopping $prog daemon: "
+ killall $DAEMON
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f $lockdir/$prog
+ echo
+}
+
+stop() {
+ root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
+ dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null`
+ if [ $? -eq 0 ]; then
+ root_dm_device="dm-$dm_num"
+ [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
+ fi
+
+ force_stop
+}
+
+restart() {
+ stop
+ start
+}
+
+force_restart() {
+ force_stop
+ start
+}
+
+reload() {
+ echo -n "Reloading $prog: "
+ trap "" SIGHUP
+ killall $DAEMON -s SIGHUP -v
+ RETVAL=$?
+ echo
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+force-stop)
+ force_stop
+ ;;
+force-reload|reload)
+ reload
+ ;;
+restart)
+ restart
+ ;;
+force-restart)
+ force_restart
+ ;;
+condrestart|try-restart)
+ if [ -f $lockdir/$prog ]; then
+ restart
+ fi
+ ;;
+status)
+ if pidof -o %PPID $DAEMON > /dev/null; then
+ echo "Running"
+ RETVAL=0
+ else
+ echo "Not running"
+ RETVAL=1
+ fi
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|force-stop|status|restart|force-restart|condrestart|reload}"
+ RETVAL=2
+esac
+
+exit $RETVAL