Bug #398467: Update dmraid. Also add other patches from Portage tree.
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 12 Feb 2012 01:21:47 +0000 (17:21 -0800)
committerRobin H. Johnson <robbat2@gentoo.org>
Sun, 12 Feb 2012 01:21:47 +0000 (17:21 -0800)
ChangeLog
genkernel.conf
patches/dmraid/dmraid-1.0.0.rc16-3-staticlink.patch [new file with mode: 0644]
patches/dmraid/dmraid-1.0.0_rc16-as-needed2.patch [new file with mode: 0644]
patches/dmraid/dmraid-1.0.0_rc16-return-all-sets.patch [new file with mode: 0644]
patches/dmraid/dmraid-1.0.0_rc16-static-build-fixes.patch [new file with mode: 0644]
patches/dmraid/dmraid-1.0.0_rc16-undo-p-rename.patch [new file with mode: 0644]

index b77d111246af6f48a875129b6fa3499330a2f040..17cc4bd3e761b1ec916ee2c350a7e6d54a7df37e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,14 @@
 # Distributed under the GPL v2
 # $Id$
 
+  12 Feb 2012; Robin H. Johnson <robbat2@gentoo.org>
+  +patches/dmraid/dmraid-1.0.0_rc16-as-needed2.patch,
+  +patches/dmraid/dmraid-1.0.0_rc16-return-all-sets.patch,
+  +patches/dmraid/dmraid-1.0.0_rc16-static-build-fixes.patch,
+  +patches/dmraid/dmraid-1.0.0_rc16-undo-p-rename.patch,
+  +patches/dmraid/dmraid-1.0.0.rc16-3-staticlink.patch, genkernel.conf:
+  Bug #398467: Update dmraid. Also add other patches from Portage tree.
+
   12 Feb 2012; Robin H. Johnson <robbat2@gentoo.org> gen_cmdline.sh,
   gen_compile.sh, gen_determineargs.sh, gen_funcs.sh, genkernel.conf:
   device-mapper "update". It was merged into LVM2-2.02.67 upstream in 2010.
index 1e4bb314679542371233cd5a8b8992cca284b200..0d14271fbc9f2206be408363ce0caf35ee1e3b09 100644 (file)
@@ -216,7 +216,7 @@ MDADM_SRCTAR="${DISTDIR}/mdadm-${MDADM_VER}.tar.bz2"
 MDADM_BINCACHE="%%CACHE%%/mdadm-${MDADM_VER}-%%ARCH%%.tar.bz2"
 
 DMRAID_VER="VERSION_DMRAID"
-DMRAID_DIR="dmraid/${DMRAID_VER}"
+DMRAID_DIR="dmraid/${DMRAID_VER}/dmraid"
 DMRAID_SRCTAR="${DISTDIR}/dmraid-${DMRAID_VER}.tar.bz2"
 DMRAID_BINCACHE="%%CACHE%%/dmraid-${DMRAID_VER}-%%ARCH%%.tar.bz2"
 
diff --git a/patches/dmraid/dmraid-1.0.0.rc16-3-staticlink.patch b/patches/dmraid/dmraid-1.0.0.rc16-3-staticlink.patch
new file mode 100644 (file)
index 0000000..a80870f
--- /dev/null
@@ -0,0 +1,18 @@
+diff -ruN dmraid-vanilla/1.0.0.rc16-3/dmraid/tools/Makefile.in dmraid/1.0.0.rc16-3/dmraid/tools/Makefile.in
+--- dmraid-vanilla/1.0.0.rc16-3/dmraid/tools/Makefile.in       2010-05-31 13:18:31.000000000 +0200
++++ dmraid/1.0.0.rc16-3/dmraid/tools/Makefile.in       2012-01-03 10:14:01.665000034 +0100
+@@ -46,10 +46,10 @@
+                       DMEVENTTOOLLIBS = -ldevmapper-event_dietc
+               endif
+       else
+-#             DMRAIDLIBS += -ldevmapper
+-#             ifeq ("@STATIC_LINK@", "no")
+-#                     DMEVENTTOOLLIBS = -ldevmapper-event
+-#             endif
++              DMRAIDLIBS += -ldevmapper
++              ifeq ("@STATIC_LINK@", "no")
++                      DMEVENTTOOLLIBS = -ldevmapper-event
++              endif
+       endif
+ #     DMRAIDLIBS += -lselinux
diff --git a/patches/dmraid/dmraid-1.0.0_rc16-as-needed2.patch b/patches/dmraid/dmraid-1.0.0_rc16-as-needed2.patch
new file mode 100644 (file)
index 0000000..cf30188
--- /dev/null
@@ -0,0 +1,11 @@
+--- 1.0.0.rc16/make.tmpl.in    2010-08-16 10:22:32.000000000 -0400
++++ 1.0.0.rc16/make.tmpl.in    2010-08-16 10:42:49.000000000 -0400
+@@ -136,7 +136,7 @@
+ %.so: $(OBJECTS)
+       $(CC) -shared -Wl,-soname,$(notdir $@).$(DMRAID_LIB_VERSION) \
+-      -Wl,--version-script,.export.sym $(OBJECTS) -o $@ -ldevmapper-event
++      $(LDFLAGS) -Wl,--version-script,.export.sym $(OBJECTS) -o $@ -ldevmapper-event -ldl
+ $(LIB_STATIC): $(OBJECTS)
+       $(RM) $@
diff --git a/patches/dmraid/dmraid-1.0.0_rc16-return-all-sets.patch b/patches/dmraid/dmraid-1.0.0_rc16-return-all-sets.patch
new file mode 100644 (file)
index 0000000..1e6c713
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/1.0.0.rc16/lib/metadata/metadata.c       2009-11-27 21:57:50.182129589 -0800
++++ b/1.0.0.rc16/lib/metadata/metadata.c       2009-11-27 21:57:58.950964293 -0800
+@@ -839,7 +839,7 @@
+                */
+               if (T_GROUP(rs)) {
+                       _discover_partitions(lc, &rs->sets);
+-                      return;
++                      continue;
+               }
+               /*
diff --git a/patches/dmraid/dmraid-1.0.0_rc16-static-build-fixes.patch b/patches/dmraid/dmraid-1.0.0_rc16-static-build-fixes.patch
new file mode 100644 (file)
index 0000000..2988117
--- /dev/null
@@ -0,0 +1,110 @@
+--- tools/Makefile.in.old      2010-05-31 07:18:31.000000000 -0400
++++ tools/Makefile.in  2010-12-13 13:15:22.000000000 -0500
+@@ -60,17 +60,23 @@
+ ifeq ("@KLIBC@", "no")
+       ifeq ("@STATIC_LINK@", "no")
+               LDFLAGS += -rdynamic
++              MYLIBOBJ=$(top_builddir)/lib/libdmraid.so
+       else
+               LDFLAGS += -static
++              MYLIBOBJ=$(top_builddir)/lib/libdmraid.a
++              DMRAIDLIBS += \
++                      $(DEVMAPPEREVENT_LIBS) \
++                      $(DEVMAPPER_LIBS) \
++                      $(DL_LIBS)
+       endif
+ endif
+ .PHONY: install_dmraid_tools
+-dmraid: $(OBJECTS) $(top_builddir)/lib/libdmraid.a
++dmraid: $(OBJECTS) $(MYLIBOBJ)
+       $(CC) -o $@ $(OBJECTS) $(LDFLAGS) -L$(top_builddir)/lib $(DMRAIDLIBS) $(LIBS)
+-dmevent_tool: $(OBJECTS2) $(top_builddir)/lib/libdmraid.a
++dmevent_tool: $(OBJECTS2) $(MYLIBOBJ)
+       $(CC) -o $@ $(OBJECTS2) $(INCLUDES) $(LDFLAGS) -L$(top_builddir)/lib \
+               $(DMEVENTTOOLLIBS) $(DMRAIDLIBS) $(LIBS)
+--- lib/Makefile.in.old        2010-10-27 07:31:46.000000000 -0400
++++ lib/Makefile.in    2010-12-13 13:04:16.000000000 -0500
+@@ -60,11 +60,11 @@
+ USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \
+   $(AWK) -f $(top_srcdir)/tools/relpath.awk)
+-TARGETS = $(LIB_STATIC)
++TARGETS = $(LIB_STATIC) $(LIB_SHARED) $(LIB_EVENTS_SHARED)
+ ifeq ("@KLIBC@", "no")
+       ifeq ("@STATIC_LINK@", "no")
+-              TARGETS += $(LIB_SHARED) $(LIB_EVENTS_SHARED)
++              TARGETS = $(LIB_SHARED) $(LIB_EVENTS_SHARED)
+       endif
+ endif
+--- configure.in       2010-05-31 07:18:30.000000000 -0400
++++ configure.in.new   2010-12-07 13:30:40.000000000 -0500
+@@ -155,6 +155,15 @@
+     Default is dynamic linking]),
+   [STATIC_LINK=$enableval], [STATIC_LINK=no])
++if test "x$STATIC_LINK" != "xno"; then
++  if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
++        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
++  fi
++  PKG_CONFIG="${PKG_CONFIG} --static"
++  ac_cv_env_PKG_CONFIG_set=set
++fi
++PKG_PROG_PKG_CONFIG([0.2])
++
+ dnl Enables shared libdmraid
+ AC_ARG_ENABLE(shared_lib,
+   AC_HELP_STRING([--enable-shared_lib], [Use this to generate shared
+@@ -248,23 +257,31 @@
+       AC_HELP_STRING([--with-devmapper-prefix=PFX],
+               [Where is devmapper library installed]),
+       [DEVMAPPER_LIBS="-L$withval/lib"
+-       DEVMAPPER_CFLAGS="-I$withval/include"],
++       DEVMAPPER_CFLAGS="-I$withval/include"
++       dmprefix=$withval],
+       [DEVMAPPER_LIBS=
+-       DEVMAPPER_CFLAGS=])
+-save_LDFLAGS=$LDFLAGS
+-save_CPPFLAGS=$CPPFLAGS
+-LDFLAGS="$LDFLAGS $DEVMAPPER_LIBS"
+-CPPFLAGS="$CPPFLAGS $DEVMAPPER_CFLAGS"
+-AC_CHECK_LIB(devmapper-event, dm_event_handler_create,
+-      [DEVMAPPEREVENT_LIBS="$DEVMAPPER_LIBS -ldevmapper-event"],
+-      [AC_MSG_ERROR([device-mapper-event library is either missing or is too old and badly linked])])
+-AC_CHECK_LIB(devmapper, dm_task_set_name,
+-      [DEVMAPPER_LIBS="$DEVMAPPER_LIBS -ldevmapper"],
+-      [AC_MSG_ERROR([device-mapper library is missing])])
+-AC_CHECK_HEADERS(libdevmapper.h libdevmapper-event.h,,
+-      [AC_MSG_ERROR([Missing headers device-mapper headers])])
+-CPPFLAGS=$save_CPPFLAGS
+-LDFLAGS=$save_LDFLAGS
++       DEVMAPPER_CFLAGS=
++       dmprefix=no])
++if test "x$dmprefix" = xno ; then
++      PKG_CHECK_MODULES([DEVMAPPER],[devmapper],
++              [PKG_CHECK_MODULES([DEVMAPPEREVENT],[devmapper-event])
++              ])
++else
++      save_LDFLAGS=$LDFLAGS
++      save_CPPFLAGS=$CPPFLAGS
++      LDFLAGS="$LDFLAGS $DEVMAPPER_LIBS"
++      CPPFLAGS="$CPPFLAGS $DEVMAPPER_CFLAGS"
++      AC_CHECK_LIB(devmapper-event, dm_event_handler_create,
++              [DEVMAPPEREVENT_LIBS="$DEVMAPPER_LIBS -ldevmapper-event"],
++              [AC_MSG_ERROR([device-mapper-event library is either missing or is too old and badly linked])])
++      AC_CHECK_LIB(devmapper, dm_task_set_name,
++              [DEVMAPPER_LIBS="$DEVMAPPER_LIBS -ldevmapper"],
++              [AC_MSG_ERROR([device-mapper library is missing])])
++      AC_CHECK_HEADERS(libdevmapper.h libdevmapper-event.h,,
++              [AC_MSG_ERROR([Missing headers device-mapper headers])])
++      CPPFLAGS=$save_CPPFLAGS
++      LDFLAGS=$save_LDFLAGS
++fi
+ VERSION=$srcdir/tools/VERSION
+ DMRAID_LIB_MAJOR=$(cut -d. -f1 $VERSION)
\ No newline at end of file
diff --git a/patches/dmraid/dmraid-1.0.0_rc16-undo-p-rename.patch b/patches/dmraid/dmraid-1.0.0_rc16-undo-p-rename.patch
new file mode 100644 (file)
index 0000000..6636b05
--- /dev/null
@@ -0,0 +1,13 @@
+Author: Giuseppe Iuculano <giuseppe@iuculano.it>
+Description: Removed "p" from device name. A proper upgrade script is needed before using it.
+--- a/1.0.0.rc15/lib/format/partition/dos.c
++++ b/1.0.0.rc15/lib/format/partition/dos.c
+@@ -31,7 +31,7 @@ _name(struct lib_context *lc, struct rai
+ {
+       const char *base = get_basename(lc, rd->di->path);
+-      return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc),
++      return type ? snprintf(str, len, "%s%u", base,
+                              partition) : snprintf(str, len, "%s", base);
+ }