summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/multipath-tools
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-08 22:51:41 +0200
commit1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch)
treea21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-oe/recipes-support/multipath-tools
downloadmeta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-support/multipath-tools')
-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
-rw-r--r--meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb70
5 files changed, 325 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 000000000..a16a85405
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper-kpartx.patch
@@ -0,0 +1,29 @@
1Always use devmapper for kpartx
2
3Do not try to compute the LIBDM_API_COOKIE make variable
4from host information when cross-compiling.
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
9Signed-off-by: Joe Slater <joe.slater@windriver.com>
10
11diff --git a/kpartx/Makefile b/kpartx/Makefile
12index 2a07334..24bdabc 100644
13--- a/kpartx/Makefile
14+++ b/kpartx/Makefile
15@@ -4,13 +4,7 @@
16 #
17 include ../Makefile.inc
18
19-CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
20-
21-LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
22-
23-ifneq ($(strip $(LIBDM_API_COOKIE)),0)
24- CFLAGS += -DLIBDM_API_COOKIE
25-endif
26+CFLAGS += -I. -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLIBDM_API_COOKIE
27
28 LDFLAGS = -ldevmapper
29 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 000000000..89d2352da
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/always-use-libdevmapper.patch
@@ -0,0 +1,44 @@
1Always use devmapper
2
3Do not try to compute several _API_ make variables
4from host information when cross-compiling.
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
9Signed-off-by: Joe Slater <joe.slater@windriver.com>
10
11diff --git a/libmultipath/Makefile b/libmultipath/Makefile
12index e5b06b3..efd6cf6 100644
13--- a/libmultipath/Makefile
14+++ b/libmultipath/Makefile
15@@ -17,23 +17,18 @@ OBJS = memory.o parser.o vector.o devmapper.o \
16 log.o configure.o structs_vec.o sysfs.o prio.o checkers.o \
17 lock.o waiter.o file.o wwids.o
18
19-LIBDM_API_FLUSH = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_no_flush' /usr/include/libdevmapper.h)
20
21-ifneq ($(strip $(LIBDM_API_FLUSH)),0)
22+#ifneq ($(strip $(LIBDM_API_FLUSH)),0)
23 CFLAGS += -DLIBDM_API_FLUSH -D_GNU_SOURCE
24-endif
25+#endif
26
27-LIBDM_API_COOKIE = $(shell grep -Ecs '^[a-z]*[[:space:]]+dm_task_set_cookie' /usr/include/libdevmapper.h)
28-
29-ifneq ($(strip $(LIBDM_API_COOKIE)),0)
30+#ifneq ($(strip $(LIBDM_API_COOKIE)),0)
31 CFLAGS += -DLIBDM_API_COOKIE
32-endif
33-
34-LIBUDEV_API_RECVBUF = $(shell grep -Ecs '^[a-z]*[[:space:]]+udev_monitor_set_resolve_buffer_size' /usr/include/libudev.h)
35+#endif
36
37-ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
38+#ifneq ($(strip $(LIBUDEV_API_RECVBUF)),0)
39 CFLAGS += -DLIBUDEV_API_RECVBUF
40-endif
41+#endif
42
43
44 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 000000000..ff71f3967
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/makefile_inc.patch
@@ -0,0 +1,36 @@
1multipath-tools: modify Makefile.inc for cross-compilation
2
3Do not look for systemd info on the host, and allow us to pass in CFLAGS
4using the OPTFLAGS variable.
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-off-by: Joe Slater <joe.slater@windriver.com>
9
10
11--- a/Makefile.inc
12+++ b/Makefile.inc
13@@ -21,12 +21,6 @@ ifndef LIB
14 endif
15 endif
16
17-ifndef SYSTEMD
18- ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1)
19- SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p')
20- endif
21-endif
22-
23 prefix =
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/sbin
26@@ -49,7 +43,10 @@ ifndef RPM_OPT_FLAGS
27 RPM_OPT_FLAGS = -O2 -g -pipe -Wformat-security -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4
28 endif
29
30+ifndef OPTFLAGS
31 OPTFLAGS = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes
32+endif
33+
34 CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\"
35 SHARED_FLAGS = -shared
36
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 000000000..3bdf875e3
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/files/multipathd.oe
@@ -0,0 +1,146 @@
1#!/bin/bash
2#
3# multipathd Starts the multipath daemon
4#
5# chkconfig: - 06 87
6# description: Manages device-mapper multipath devices
7
8### BEGIN INIT INFO
9# Provides: multipathd
10# Required-Start:
11# Required-Stop:
12# Default-Start:
13# Default-Stop:
14# Short-Description: Control multipathd
15# Description: This service monitors and manages
16# device-mapper multipath devices
17### END INIT INFO
18
19DAEMON=/sbin/multipathd
20prog=`basename $DAEMON`
21initdir=/etc/init.d
22lockdir=/var/lock/subsys
23sysconfig=/etc/sysconfig
24syspath=/sys/block
25
26RETVAL=0
27
28teardown_slaves()
29{
30pushd $1 > /dev/null
31if [ -d "slaves" ]; then
32for slave in slaves/*;
33do
34 if [ "$slave" = "slaves/*" ]; then
35 read dev < $1/dev
36 tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
37 if ! [ -z $tablename ]; then
38 echo "Root is on a multipathed device, multipathd can not be stopped"
39 exit 1
40 fi
41 else
42 local_slave=`readlink -f $slave`;
43 teardown_slaves $local_slave;
44 fi
45 done
46
47else
48 read dev < $1/dev
49 tablename=`dmsetup table --target multipath | sed -n "s/\(.*\): .* $dev .*/\1/p"`
50 if ! [ -z $tablename ]; then
51 echo "Root is on a multipathed device, multipathd can not be stopped"
52 exit 1
53 fi
54fi
55popd > /dev/null
56}
57
58#
59# See how we were called.
60#
61
62start() {
63 test -x $DAEMON || exit 5
64 echo -n $"Starting $prog daemon: "
65 start-stop-daemon --start --quiet --exec $DAEMON
66 RETVAL=$?
67 [ $RETVAL -eq 0 ] && touch $lockdir/$prog
68 echo
69}
70
71force_stop() {
72 echo -n $"Stopping $prog daemon: "
73 killall $DAEMON
74 RETVAL=$?
75 [ $RETVAL -eq 0 ] && rm -f $lockdir/$prog
76 echo
77}
78
79stop() {
80 root_dev=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $1; }}' /etc/mtab)
81 dm_num=`dmsetup info -c --noheadings -o minor $root_dev 2> /dev/null`
82 if [ $? -eq 0 ]; then
83 root_dm_device="dm-$dm_num"
84 [ -d $syspath/$root_dm_device ] && teardown_slaves $syspath/$root_dm_device
85 fi
86
87 force_stop
88}
89
90restart() {
91 stop
92 start
93}
94
95force_restart() {
96 force_stop
97 start
98}
99
100reload() {
101 echo -n "Reloading $prog: "
102 trap "" SIGHUP
103 killall $DAEMON -s SIGHUP -v
104 RETVAL=$?
105 echo
106}
107
108case "$1" in
109start)
110 start
111 ;;
112stop)
113 stop
114 ;;
115force-stop)
116 force_stop
117 ;;
118force-reload|reload)
119 reload
120 ;;
121restart)
122 restart
123 ;;
124force-restart)
125 force_restart
126 ;;
127condrestart|try-restart)
128 if [ -f $lockdir/$prog ]; then
129 restart
130 fi
131 ;;
132status)
133 if pidof -o %PPID $DAEMON > /dev/null; then
134 echo "Running"
135 RETVAL=0
136 else
137 echo "Not running"
138 RETVAL=1
139 fi
140 ;;
141*)
142 echo $"Usage: $0 {start|stop|force-stop|status|restart|force-restart|condrestart|reload}"
143 RETVAL=2
144esac
145
146exit $RETVAL
diff --git a/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb b/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
new file mode 100644
index 000000000..055cfe64c
--- /dev/null
+++ b/meta-oe/recipes-support/multipath-tools/multipath-tools_git.bb
@@ -0,0 +1,70 @@
1SUMMARY = "The upstream project used to drive the Device Mapper multipathing driver"
2
3DEPENDS = "lvm2 libaio readline udev"
4
5LICENSE = "LGPLv2"
6
7SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \
8 file://multipathd.oe \
9 file://makefile_inc.patch \
10 file://always-use-libdevmapper.patch \
11 file://always-use-libdevmapper-kpartx.patch \
12 "
13# 0.5.0
14#
15#SRCREV = "82f391e787dc02e9d9294aa391137ab424bb83c4"
16#LIC_FILES_CHKSUM = "file://COPYING;md5=7be2873b6270e45abacc503abbe2aa3d"
17
18# 0.5.0 + commits thru 7/18/2014
19#
20#SRCREV = "0d72f46c12207a6b7b89f5ef4f5ab5f87ed8bc90"
21#LIC_FILES_CHKSUM = "file://COPYING;md5=b06690e7a95c166eefe0199b39118eb1"
22
23# 0.5.0 + commits thru 9/12/2014
24#
25# includes important systemd related structure size fix
26#
27SRCREV = "aec68ab217fd2956443b27ceeb97dd6475267789"
28LIC_FILES_CHKSUM = "file://COPYING;md5=b06690e7a95c166eefe0199b39118eb1"
29
30inherit systemd
31
32
33S = "${WORKDIR}/git"
34
35PV = "0.5.0+git${@'${SRCPV}'.split('+')[-1]}"
36
37# The exact version of SYSTEMD does not matter but should be greater than 209.
38#
39EXTRA_OEMAKE = 'MULTIPATH_VERSION=${PV} DESTDIR=${D} syslibdir=${base_libdir} \
40 OPTFLAGS="${CFLAGS}" \
41 LIB=${base_libdir} libdir=${base_libdir}/multipath \
42 unitdir=/lib/systemd/system \
43 ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "SYSTEMD=216", "", d)} \
44 '
45
46do_install() {
47 oe_runmake install
48
49 # Copy a sample conf file, but do not rename it multipath.conf.
50 #
51 cp multipath.conf.defaults ${D}${sysconfdir}
52
53 # We copy an initscript, but do not start multipathd at init time.
54 #
55 cp ${WORKDIR}/multipathd.oe ${D}${sysconfdir}/init.d/multipathd
56
57}
58
59FILES_${PN}-dbg += "${base_libdir}/multipath/.debug"
60
61# systemd and udev stuff always goes under /lib!
62#
63FILES_${PN} += "${base_libdir}/multipath \
64 /lib/systemd"
65
66PACKAGES =+ "kpartx"
67FILES_kpartx = "${base_sbindir}/kpartx \
68 /lib/udev/kpartx_id"
69
70RDEPENDS_${PN} += "kpartx"