summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-fs/lvm2/ChangeLog9
-rw-r--r--sys-fs/lvm2/Manifest7
-rw-r--r--sys-fs/lvm2/files/lvm.conf-2.02.56.patch48
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch288
-rw-r--r--sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch12
-rw-r--r--sys-fs/lvm2/lvm2-2.02.56.ebuild215
6 files changed, 577 insertions, 2 deletions
diff --git a/sys-fs/lvm2/ChangeLog b/sys-fs/lvm2/ChangeLog
index 2429644acbf4..b39131b50dbe 100644
--- a/sys-fs/lvm2/ChangeLog
+++ b/sys-fs/lvm2/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-fs/lvm2
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.185 2009/11/29 23:44:24 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.186 2009/11/30 00:33:13 robbat2 Exp $
+
+*lvm2-2.02.56 (30 Nov 2009)
+
+ 30 Nov 2009; Robin H. Johnson <robbat2@gentoo.org> +lvm2-2.02.56.ebuild,
+ +files/lvm2-2.02.56-device-mapper-export-format.patch,
+ +files/lvm2-2.02.56-dmeventd.patch, +files/lvm.conf-2.02.56.patch:
+ Bug #294983: version bump.
*lvm2-2.02.51-r3 (29 Nov 2009)
diff --git a/sys-fs/lvm2/Manifest b/sys-fs/lvm2/Manifest
index 9b7b21cca3f1..0f0000ec7a8f 100644
--- a/sys-fs/lvm2/Manifest
+++ b/sys-fs/lvm2/Manifest
@@ -13,6 +13,7 @@ AUX lvm.conf-2.02.33.patch 3136 RMD160 c0292c39db064f0a4151ffccdc441be2fa78f8cf
AUX lvm.conf-2.02.36.patch 3118 RMD160 b19039d550cd81d46f77d493cb6c5507a3fd66ee SHA1 dd4f4892c4b423348a764c1373ed81959ca0772b SHA256 85abba15c2dc52af9d518140e210abba852df83deb7740a19be3987a64f677f9
AUX lvm.conf-2.02.45.patch 2657 RMD160 9f74ca92257162c978a690209878691fe13456b5 SHA1 9beccaa7933b9e53651b155bf6262229306e010f SHA256 f45a4ea427c38ca001ffd83eb73008b486d87ad8bf409d1e102a1eac386148d1
AUX lvm.conf-2.02.51.patch 2690 RMD160 1aa597d10ee928d4c209fe5beb01dd1ab4b99b35 SHA1 697407509b408d91af2dc3f98a9d9dcc82abe81d SHA256 c163e64d1b0914154b72730f67b1face04802e6e89534766eb79d72a34ef5e67
+AUX lvm.conf-2.02.56.patch 1697 RMD160 159030156098e4aa5bc141a5a04f9ba60f5b430c SHA1 d37ee83b1c74043d413b99d52bf3c652cebc2eb3 SHA256 76dd9c5932b4c8c0d51eeb357e91c5e2af87dd180e3ca76940e3a7ad4de5f2e6
AUX lvm.confd-2.02.28-r2 173 RMD160 cf554372fa11df056e3757e5139fad6c7606a696 SHA1 e8186ebb91d12247d0865285dc62346d1cbc207a SHA256 28370c089c39c248d7ded0960b8d8a9256bada44d44c22ce3cec87d512ef6844
AUX lvm.rc-2.02.28-r2 661 RMD160 3b267ab500785de249101548a15792708d3adc55 SHA1 b014a0d4344c58c963db20cefeb726dfd66d1b1a SHA256 962d9e8baa06a617671701d21f8a2849b45ab9baa6684b2e99b2b03192c9e66a
AUX lvm.rc-2.02.51-r2 759 RMD160 23d931309ed71df30f17f0656c4d3ea5fd3f5564 SHA1 bd4a7e91e900715f5046669a7622925ad1556bc8 SHA256 d1ed3ffd62aca317608e15f25b6d4cc0fee61a880d61f7933aa9d5c46ce551fd
@@ -27,6 +28,8 @@ AUX lvm2-2.02.51-device-mapper-export-format.patch 11318 RMD160 f194ef2dd9105ba3
AUX lvm2-2.02.51-dmsetup-selinux-linking-fix-r3.patch 809 RMD160 4d8f2486426f0feba9cf44f55e7beb9eb6fbed7a SHA1 f9526d90f386ed4d0476b315dd9690d5d87c1f5d SHA256 8668fe3acf35390a06bc0aaf83b874f6e763b2c56edf0a2dcdea789031ede595
AUX lvm2-2.02.51-dmsetup-selinux-linking-fix.patch 651 RMD160 34198b5959435ff37e6e0971737ee3e07a8b73b5 SHA1 ef46356219a4cc5d650846a45402b2dbf67d80a7 SHA256 5644b786cda599da2b3522d95d476ab105cee37e9418e43fbeb6dc029b300e9b
AUX lvm2-2.02.51-fix-pvcreate.patch 3140 RMD160 c707cc280a893350a90c1258b0d73c154283738c SHA1 34c16b3a930ae2ab66ca3ea5b47ce19317de51d7 SHA256 7564a9ac374f53e3991f76967f1462709afa9661de4d2c6ff232f71d3d7b446f
+AUX lvm2-2.02.56-device-mapper-export-format.patch 10774 RMD160 0e7c4d0b955e73663941f707315f18cfdccdb343 SHA1 e5247915cb3a6c49b3a5b04cb16e3c97531e51b2 SHA256 dd3cd1417bd8eef8da65d993c0178861265c14a166edde4f83c4ea18e7fa71c9
+AUX lvm2-2.02.56-dmeventd.patch 539 RMD160 8fbdf28707ae18ac8e2f45aabfbf10b8b89aa76b SHA1 6e61c3aa6be93b9cc90504e70959d02d0a165fdd SHA256 c70b96d7c3d9fbd78d00c8711a4243d1a874745dcb175b63620015301ee99c10
AUX lvm2-start.sh 1025 RMD160 fa27385e4640d59c33f2ca42db9d38f80def3977 SHA1 83a86ff292192b3f62e4686b70bbbfcc39158b53 SHA256 8c7da13b6326a383888110b25f53a4902cbec7d0dace274b9c5f1d6b0a775039
AUX lvm2-start.sh-2.02.28-r2 1180 RMD160 3ec85899a19c56d4d49e4654e1b05f53bc7d9c93 SHA1 80fce53cc1925990fbb103e57314b3c1740de6ed SHA256 a891855ed04d4c59f17fc0b19dc61813a4ca3cc183166867606d92cb58498460
AUX lvm2-start.sh-2.02.49-r1 1200 RMD160 b88e37e7e228fecdedf359c1132723077a3d4c94 SHA1 85eb83a83c598b3ea405ec4c597a9c77364e7fb4 SHA256 94d15b5dbeabb275b4d91b284b3113cd812b7e7c90ec3018693803b3e91d9535
@@ -46,6 +49,7 @@ DIST LVM2.2.02.45.tgz 740347 RMD160 18af03dac08d6bb96bba1614365a772e5b550fbc SHA
DIST LVM2.2.02.48.tgz 762435 RMD160 2ae5061c408db553f8b8af954552916c3d768130 SHA1 8a6f29f08f731caffa09f52e5ca41bcce80ff3b9 SHA256 32e0365ada6e18e16bfc2e6e1e5fb019f8c36de7476d87c4bf6613ee9cf024ad
DIST LVM2.2.02.49.tgz 766327 RMD160 e5ef6d165e37c3d2534c612bbfd861f114e6e6aa SHA1 178eecfaeaef2dea67c76c0878be1e69b3a6ea37 SHA256 718f082f51bdd6474bb61a743acef269f2c77b8e2d19e7ddc463f2dd91fb9dd7
DIST LVM2.2.02.51.tgz 790458 RMD160 7ca55e29c6d780b4b052b07eeabbd731a034721f SHA1 307281dfced6b5ab5904761a41c6a6775a511172 SHA256 7d88ebb1e74e46617f226c1ca987e337aa30c3f637c7a502e8f355096f36a4df
+DIST LVM2.2.02.56.tgz 822318 RMD160 b9bb04df127fe58d2b483035b2c17e2b049695d3 SHA1 1a70cb4d4fe7566aace9d38ee18413c79e91b684 SHA256 9c96ef2cb4a9606cb6a4af795cbb5503b04d676179b0c70a9883593992622f43
EBUILD lvm2-2.01.13.ebuild 1470 RMD160 125ecf8a32609d67876e16afa155aa256bdc22ee SHA1 95c96a2158c40bc325da6eeaded050e9e426a0e5 SHA256 b3ee4c923da035604cdf69673c12824c7b74a1716550496ce38d9281d39fa6ef
EBUILD lvm2-2.02.33-r1.ebuild 4527 RMD160 d7c43a570f25beaf431634f43b6558c2bcd428d7 SHA1 cbedf70a586f9243306d11892e053c657c71c65b SHA256 76653135b9146bd626e590088d699cbfdf03f1eb6564679749d6f6443f4c2b61
EBUILD lvm2-2.02.33.ebuild 4498 RMD160 300f760b96ffa1edf4a66d5fb7c5aabdbd4d72db SHA1 38347fcebff8361fae71c3dac14be67b7b9840db SHA256 d68b8b39547a132b639a4e55df9aec29a5bd46038c3d65e5114cfcfb7c2e3783
@@ -67,5 +71,6 @@ EBUILD lvm2-2.02.51-r1.ebuild 6600 RMD160 ef590b3250a7e1da698236a66f2d75c57ee1c3
EBUILD lvm2-2.02.51-r2.ebuild 6724 RMD160 025b636bad7edf3b1239b429ce3c53a379e5c88a SHA1 ee91101f583985cb8a6ebf77de5f59adcb84cbdf SHA256 61e8b1fc73c6b0690b0ec0c5cf6109db8beb009439fc29a8bc0c85dbe184b9fe
EBUILD lvm2-2.02.51-r3.ebuild 6381 RMD160 694702042529c6647bf20c74c1c1dcb32c9a7ec8 SHA1 c555a3c074dda5c7992ef40c46052d0f7f6357b8 SHA256 535196ee48cc1063972ce6f1c97c5fe3ed516d743a274ef503c8997f02dffddc
EBUILD lvm2-2.02.51.ebuild 6374 RMD160 d78f74edba8bcd89132674476865ff5aebdf0727 SHA1 0841e2a6941720864cb2400a539055ea00b4daca SHA256 d06c72cf94bffdad5df089d214f1a288de2d1d8c709ddf53b353660a221fa847
-MISC ChangeLog 32041 RMD160 f29a8768c9ef912e89b4e84a46f9c212ff773c12 SHA1 23ee491ade51063c50741d76ea9a315460a11c39 SHA256 0bb6ebdc58d6c6541f534b9fa8cb065e68bc25c2d499942c2c4147ce263b560e
+EBUILD lvm2-2.02.56.ebuild 6473 RMD160 57bc44e020b40b4241d9b249c69174309cb8245a SHA1 f1eddcd9197a1ba2256c33f03bbcbd4c2089f5df SHA256 5ad81d6d8719dbdb17d57518c1e8bf99d7a36b7335d09b340dc9d58a04abfa4b
+MISC ChangeLog 32301 RMD160 f385cf326c7f11937e3ec0e31cae7f0f28e8a6ca SHA1 7f05f3f370a02b411e891fe782536502c339a396 SHA256 abad5d7f6820e8ebc20f62bcc849c657036806d67e6185c99eeaa18d171ba945
MISC metadata.xml 792 RMD160 f60db9169ee273ca2f97fa5e69d4e5329e988164 SHA1 42f85f30477c65a164a11e172db7e250f442dca5 SHA256 87ced5a3a6102985f7c2a619dd52f65e62ae916f8921c8e7115a25452cd44b7f
diff --git a/sys-fs/lvm2/files/lvm.conf-2.02.56.patch b/sys-fs/lvm2/files/lvm.conf-2.02.56.patch
new file mode 100644
index 000000000000..5f2abd531763
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.conf-2.02.56.patch
@@ -0,0 +1,48 @@
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/doc/example.conf LVM2.2.02.56/doc/example.conf
+--- LVM2.2.02.56.orig/doc/example.conf 2009-10-05 12:44:21.000000000 +0000
++++ LVM2.2.02.56/doc/example.conf 2009-11-29 23:53:00.123882589 +0000
+@@ -50,7 +50,9 @@
+
+
+ # By default we accept every block device:
+- filter = [ "a/.*/" ]
++ # Gentoo: we exclude /dev/nbd by default, because it makes a lot of kernel
++ # noise when you probed while not available.
++ filter = [ "r|/dev/nbd.*|", "a/.*/" ]
+
+ # Exclude the cdrom drive
+ # filter = [ "r|/dev/cdrom|" ]
+@@ -259,6 +261,8 @@
+ # the new lvm2 on-disk metadata format.
+ # The default value is set when the tools are built.
+ # fallback_to_lvm1 = 0
++ # Gentoo: the LVM tools are a seperate package.
++ fallback_to_lvm1 = 0
+
+ # The default metadata format that commands should use - "lvm1" or "lvm2".
+ # The command line override is -M1 or -M2.
+@@ -411,12 +415,12 @@
+
+ # Metadata settings
+ #
+-# metadata {
++metadata {
+ # Default number of copies of metadata to hold on each PV. 0, 1 or 2.
+ # You might want to override it from the command line with 0
+ # when running pvcreate on new PVs which are to be added to large VGs.
+-
+- # pvmetadatacopies = 1
++ # Gentoo: enable for data safety, but PV resize is then disabled.
++ #pvmetadatacopies = 2
+
+ # Approximate default size of on-disk metadata areas in sectors.
+ # You should increase this if you have large volume groups or
+@@ -438,7 +442,7 @@
+ # the supplied toolset to make changes (e.g. vgcfgrestore).
+
+ # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ]
+-#}
++}
+
+ # Event daemon
+ #
diff --git a/sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch b/sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch
new file mode 100644
index 000000000000..28692ee3d77c
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.56-device-mapper-export-format.patch
@@ -0,0 +1,288 @@
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/libdm/libdevmapper.h LVM2.2.02.56/libdm/libdevmapper.h
+--- LVM2.2.02.56.orig/libdm/libdevmapper.h 2009-11-13 12:43:21.000000000 +0000
++++ LVM2.2.02.56/libdm/libdevmapper.h 2009-11-29 23:56:16.410529643 +0000
+@@ -982,6 +982,7 @@
+ #define DM_REPORT_OUTPUT_FIELD_NAME_PREFIX 0x00000008
+ #define DM_REPORT_OUTPUT_FIELD_UNQUOTED 0x00000010
+ #define DM_REPORT_OUTPUT_COLUMNS_AS_ROWS 0x00000020
++#define DM_REPORT_OUTPUT_EXPORT 0x00000040
+
+ struct dm_report *dm_report_init(uint32_t *report_types,
+ const struct dm_report_object_type *types,
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/libdm/libdm-report.c LVM2.2.02.56/libdm/libdm-report.c
+--- LVM2.2.02.56.orig/libdm/libdm-report.c 2009-02-09 09:45:49.000000000 +0000
++++ LVM2.2.02.56/libdm/libdm-report.c 2009-11-29 23:56:16.410529643 +0000
+@@ -891,6 +891,8 @@
+ uint32_t align;
+ const char *repstr;
+ char buf[4096];
++ const char *fname;
++ char tmp_char;
+
+ if (rh->flags & DM_REPORT_OUTPUT_FIELD_NAME_PREFIX) {
+ if (!(field_id = strdup(rh->fields[field->props->field_num].id))) {
+@@ -921,6 +923,25 @@
+ return 0;
+ }
+ }
++ if (rh->flags & DM_REPORT_OUTPUT_EXPORT) {
++ fname = rh->fields[field->props->field_num].id;
++ if (!dm_pool_grow_object(rh->mem, "DM_", strlen("DM_"))) {
++ log_error("dm_report: Unable to extend output line");
++ return 0;
++ }
++ while (fname && fname[0]) {
++ tmp_char = toupper(fname[0]);
++ if (!dm_pool_grow_object(rh->mem, &tmp_char, 1)) {
++ log_error("dm_report: Unable to extend output line");
++ return 0;
++ }
++ fname++;
++ }
++ if (!dm_pool_grow_object(rh->mem, "=", strlen("="))) {
++ log_error("dm_report: Unable to extend output line");
++ return 0;
++ }
++ }
+
+ repstr = field->report_string;
+ width = field->props->width;
+diff -Nuar --exclude '*.orig' --exclude '*.rej' LVM2.2.02.56.orig/tools/dmsetup.c LVM2.2.02.56/tools/dmsetup.c
+--- LVM2.2.02.56.orig/tools/dmsetup.c 2009-11-13 12:43:22.000000000 +0000
++++ LVM2.2.02.56/tools/dmsetup.c 2009-11-29 23:59:32.047603270 +0000
+@@ -114,6 +114,7 @@
+ enum {
+ READ_ONLY = 0,
+ COLS_ARG,
++ EXPORT_ARG,
+ EXEC_ARG,
+ FORCE_ARG,
+ GID_ARG,
+@@ -152,7 +153,8 @@
+ DR_INFO = 2,
+ DR_DEPS = 4,
+ DR_TREE = 8, /* Complete dependency tree required */
+- DR_NAME = 16
++ DR_NAME = 16,
++ DR_TABLE = 0x20, /* table is required, not just info */
+ } report_type_t;
+
+ static int _switches[NUM_SWITCHES];
+@@ -1491,8 +1493,13 @@
+ name = argv[1];
+ }
+
+- if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
+- return 0;
++ if (_report_type & DR_TABLE ) {
++ if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
++ return 0;
++ } else {
++ if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
++ return 0;
++ }
+
+ if (!_set_task_device(dmt, name, 0))
+ goto out;
+@@ -1962,6 +1969,16 @@
+ return dm_report_field_uint32(rh, field, &value);
+ }
+
++static int _int_disp(struct dm_report *rh,
++ struct dm_pool *mem __attribute((unused)),
++ struct dm_report_field *field, const void *data,
++ void *private __attribute((unused)))
++{
++ const int value = *(const int *)data;
++
++ return dm_report_field_int(rh, field, &value);
++}
++
+ static int _dm_name_disp(struct dm_report *rh,
+ struct dm_pool *mem __attribute((unused)),
+ struct dm_report_field *field, const void *data,
+@@ -2073,6 +2090,66 @@
+ }
+
+
++static int _dm_info_cleartext_status_disp(struct dm_report *rh,
++ struct dm_pool *mem __attribute((unused)),
++ struct dm_report_field *field, const void *data,
++ void *private __attribute((unused)))
++{
++ const char *buf = "NOTPRESENT";
++ const struct dm_info *info = data;
++
++ if (info->exists) {
++ if (info->suspended)
++ buf = "SUSPENDED";
++ else
++ buf = info->read_only ? " READONLY" : "ACTIVE";
++ }
++
++ return dm_report_field_string(rh, field, &buf);
++}
++
++static int _dm_info_target_types_disp(struct dm_report *rh,
++ struct dm_pool *mem __attribute((unused)),
++ struct dm_report_field *field, const void *data,
++ void *private __attribute((unused)))
++{
++ char buf[1024];
++ char *dest = buf;
++ int remains = sizeof(buf);
++ int written;
++ const char *s = buf;
++ struct dm_task *dmt = (struct dm_task *) data;
++ void *next = NULL;
++ uint64_t start, length;
++ char *target_type = NULL;
++ char *params;
++
++
++ buf[0] = '\0';
++
++ next = dm_get_next_target(dmt, next, &start, &length,
++ &target_type, &params);
++ if (target_type) {
++ written = snprintf(dest, remains, "%s", target_type);
++ dest += written;
++ remains -= written;
++
++ while (remains > 0 && next) {
++ next = dm_get_next_target(dmt, next, &start, &length,
++ &target_type, &params);
++ if (target_type) {
++ written = snprintf(dest, remains, ",%s", target_type);
++ dest += written;
++ remains -= written;
++ }
++ }
++ }
++
++ buf[sizeof(buf)-1] = '\0';
++
++ return dm_report_field_string(rh, field, &s);
++}
++
+ static int _dm_info_devno_disp(struct dm_report *rh, struct dm_pool *mem,
+ struct dm_report_field *field, const void *data,
+ void *private)
+@@ -2337,6 +2414,7 @@
+ { DR_DEPS, "Mapped Device Relationship Information", "", _deps_get_obj },
+ { DR_TREE, "Mapped Device Relationship Information", "", _tree_get_obj },
+ { DR_NAME, "Mapped Device Name Components", "", _split_name_get_obj },
++ { DR_TABLE, "Mapped Device Table", "", _task_get_obj },
+ { 0, "", "", NULL },
+ };
+
+@@ -2356,6 +2434,7 @@
+ FIELD_F(TASK, NUM, "RAhead", 6, dm_read_ahead, "read_ahead", "Read ahead in sectors.")
+
+ FIELD_F(INFO, STR, "Stat", 4, dm_info_status, "attr", "(L)ive, (I)nactive, (s)uspended, (r)ead-only, read-(w)rite.")
++FIELD_F(INFO, STR, "State", 1, dm_info_cleartext_status, "status", "State as cleartext.")
+ FIELD_F(INFO, STR, "Tables", 6, dm_info_table_loaded, "tables_loaded", "Which of the live and inactive table slots are filled.")
+ FIELD_F(INFO, STR, "Suspended", 9, dm_info_suspended, "suspended", "Whether the device is suspended.")
+ FIELD_F(INFO, STR, "Read-only", 9, dm_info_read_only, "readonly", "Whether the device is read-only or writeable.")
+@@ -2366,6 +2445,11 @@
+ FIELD_O(INFO, dm_info, NUM, "Targ", target_count, 4, int32, "segments", "Number of segments in live table, if present.")
+ FIELD_O(INFO, dm_info, NUM, "Event", event_nr, 6, uint32, "events", "Number of most recent event.")
+
++FIELD_O(INFO, dm_info, NUM, "RO", read_only, 2, int, "read_only", "Read only.")
++FIELD_O(INFO, dm_info, NUM, "Ex", exists, 2, int, "exists", "Exists.")
++FIELD_O(INFO, dm_info, NUM, "Susp", suspended, 4, int, "suspended", "Suspended.")
++FIELD_O(INFO, dm_info, NUM, "tab_live", live_table, 8, int, "table_live", "Live table.")
++FIELD_O(INFO, dm_info, NUM, "tab_inact", inactive_table, 9, int, "table_inactive", "Inactive table.")
+ FIELD_O(DEPS, dm_deps, NUM, "#Devs", count, 5, int32, "device_count", "Number of devices used by this one.")
+ FIELD_F(TREE, STR, "DevNames", 8, dm_deps_names, "devs_used", "List of names of mapped devices used by this one.")
+ FIELD_F(DEPS, STR, "DevNos", 6, dm_deps, "devnos_used", "List of device numbers of devices used by this one.")
+@@ -2373,6 +2457,7 @@
+ FIELD_F(TREE, NUM, "#Refs", 5, dm_tree_parents_count, "device_ref_count", "Number of mapped devices referencing this one.")
+ FIELD_F(TREE, STR, "RefNames", 8, dm_tree_parents_names, "names_using_dev", "List of names of mapped devices using this one.")
+ FIELD_F(TREE, STR, "RefDevNos", 9, dm_tree_parents_devs, "devnos_using_dev", "List of device numbers of mapped devices using this one.")
++FIELD_F(TABLE, STR, "Targettypes", 32, dm_info_target_types, "target_types", "Used target types.")
+
+ FIELD_O(NAME, dm_split_name, STR, "Subsys", subsystem, 6, dm_subsystem, "subsystem", "Userspace subsystem responsible for this device.")
+ FIELD_O(NAME, dm_split_name, STR, "VG", vg_name, 4, dm_vg_name, "vg_name", "LVM Volume Group name.")
+@@ -2389,14 +2474,16 @@
+ #undef FIELD_F
+
+ static const char *default_report_options = "name,major,minor,attr,open,segments,events,uuid";
++static const char *default_export_options = "name,major,minor,status,read_only,exists,suspended,table_live,table_inactive,open,segments,events,uuid,target_types";
+ static const char *splitname_report_options = "vg_name,lv_name,lv_layer";
+
+ static int _report_init(struct command *c)
+ {
+- char *options = (char *) default_report_options;
++ char *default_options = (char *) default_report_options;
++ char *options;
+ const char *keys = "";
+ const char *separator = " ";
+- int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0;
++ int aligned = 1, headings = 1, buffered = 1, field_prefixes = 0, export = 0;
+ int quoted = 1, columns_as_rows = 0;
+ uint32_t flags = 0;
+ size_t len = 0;
+@@ -2426,6 +2513,15 @@
+ field_prefixes = 1;
+ }
+
++ if (_switches[EXPORT_ARG]) {
++ default_options = (char *) default_export_options;
++ separator = "\n";
++ aligned = 0;
++ headings = 0;
++ export = 1;
++ }
++
++ options = default_options;
+ if (_switches[OPTIONS_ARG] && _string_args[OPTIONS_ARG]) {
+ if (*_string_args[OPTIONS_ARG] != '+')
+ options = _string_args[OPTIONS_ARG];
+@@ -2477,6 +2573,9 @@
+ if (columns_as_rows)
+ flags |= DM_REPORT_OUTPUT_COLUMNS_AS_ROWS;
+
++ if (export)
++ flags |= DM_REPORT_OUTPUT_EXPORT;
++
+ if (!(_report = dm_report_init(&_report_type,
+ _report_types, _report_fields,
+ options, separator, flags, keys, NULL)))
+@@ -2561,7 +2660,9 @@
+ " [-r|--readonly] [--noopencount] [--nolockfs] [--inactive]\n"
+ " [--noudevsync] [-y|--yes] [--readahead [+]<sectors>|auto|none]\n"
+ " [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]\n"
+- " [--nameprefixes] [--noheadings] [--separator <separator>]\n\n");
++ " [--nameprefixes] [--noheadings] [--separator <separator>]\n"
++ " [-e|--export]\n"
++ "\n");
+ for (i = 0; _commands[i].name; i++)
+ fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help);
+ fprintf(out, "\n<device> may be device name or -u <uuid> or "
+@@ -2911,6 +3012,7 @@
+ static struct option long_options[] = {
+ {"readonly", 0, &ind, READ_ONLY},
+ {"columns", 0, &ind, COLS_ARG},
++ {"export", 0, &ind, EXPORT_ARG},
+ {"exec", 1, &ind, EXEC_ARG},
+ {"force", 0, &ind, FORCE_ARG},
+ {"gid", 1, &ind, GID_ARG},
+@@ -2996,12 +3098,16 @@
+
+ optarg = 0;
+ optind = OPTIND_INIT;
+- while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCfG:j:m:M:no:O:ru:U:vy",
++ while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCefG:j:m:M:no:O:ru:U:vy",
+ long_options, NULL)) != -1) {
+ if (c == ':' || c == '?')
+ return 0;
+ if (c == 'c' || c == 'C' || ind == COLS_ARG)
+ _switches[COLS_ARG]++;
++ if (c == 'e' || ind == EXPORT_ARG) {
++ _switches[EXPORT_ARG]++;
++ _switches[COLS_ARG]++;
++ }
+ if (c == 'f' || ind == FORCE_ARG)
+ _switches[FORCE_ARG]++;
+ if (c == 'r' || ind == READ_ONLY)
diff --git a/sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch b/sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch
new file mode 100644
index 000000000000..7d1e338adbbe
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm2-2.02.56-dmeventd.patch
@@ -0,0 +1,12 @@
+diff -Nuar LVM2.2.02.56.orig/daemons/dmeventd/Makefile.in LVM2.2.02.56/daemons/dmeventd/Makefile.in
+--- LVM2.2.02.56.orig/daemons/dmeventd/Makefile.in 2009-11-13 12:48:01.000000000 +0000
++++ LVM2.2.02.56/daemons/dmeventd/Makefile.in 2009-11-29 23:50:22.873898621 +0000
+@@ -60,7 +60,7 @@
+ $(RM) -f $@
+ $(LN_S) $(LIB_SHARED) $@
+
+-dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o
++dmeventd: $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB) dmeventd.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ dmeventd.o \
+ $(LVMLIBS) $(LIBS) -rdynamic
+
diff --git a/sys-fs/lvm2/lvm2-2.02.56.ebuild b/sys-fs/lvm2/lvm2-2.02.56.ebuild
new file mode 100644
index 000000000000..a6f0dce6deda
--- /dev/null
+++ b/sys-fs/lvm2/lvm2-2.02.56.ebuild
@@ -0,0 +1,215 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/lvm2-2.02.56.ebuild,v 1.1 2009/11/30 00:33:13 robbat2 Exp $
+
+EAPI=2
+inherit eutils multilib toolchain-funcs autotools
+
+DESCRIPTION="User-land utilities for LVM2 (device-mapper) software."
+HOMEPAGE="http://sources.redhat.com/lvm2/"
+SRC_URI="ftp://sources.redhat.com/pub/lvm2/${PN/lvm/LVM}.${PV}.tgz
+ ftp://sources.redhat.com/pub/lvm2/old/${PN/lvm/LVM}.${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+
+IUSE="readline +static clvm cman +lvm1 selinux"
+
+DEPEND="!!sys-fs/device-mapper
+ clvm? ( =sys-cluster/dlm-2*
+ cman? ( =sys-cluster/cman-2* ) )"
+
+RDEPEND="${DEPEND}
+ !<sys-apps/openrc-0.4
+ !!sys-fs/lvm-user
+ !!sys-fs/clvm
+ >=sys-apps/util-linux-2.16"
+
+S="${WORKDIR}/${PN/lvm/LVM}.${PV}"
+
+pkg_setup() {
+ # 1. Genkernel no longer copies /sbin/lvm blindly.
+ # 2. There are no longer any linking deps in /usr.
+ if use static; then
+ elog "Warning, we no longer overwrite /sbin/lvm and /sbin/dmsetup with"
+ elog "their static versions. If you need the static binaries,"
+ elog "you must append .static the filename!"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.02.56-dmeventd.patch
+ epatch "${FILESDIR}"/lvm.conf-2.02.56.patch
+ epatch "${FILESDIR}"/${PN}-2.02.56-device-mapper-export-format.patch
+ # Merged upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.51-as-needed.patch
+ # Merged upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.48-fix-pkgconfig.patch
+ # Merged upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.51-fix-pvcreate.patch
+ # Fixed differently upstream:
+ #epatch "${FILESDIR}"/${PN}-2.02.51-dmsetup-selinux-linking-fix-r3.patch
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ local buildmode
+
+ myconf="${myconf} --enable-dmeventd"
+ myconf="${myconf} --enable-cmdlib"
+ myconf="${myconf} --enable-applib"
+ myconf="${myconf} --enable-fsadm"
+
+ # Most of this package does weird stuff.
+ # The build options are tristate, and --without is NOT supported
+ # options: 'none', 'internal', 'shared'
+ if use static ; then
+ einfo "Building static LVM, for usage inside genkernel"
+ buildmode="internal"
+ # This only causes the .static versions to become available
+ # For recent systems, there are no linkages against anything in /usr anyway.
+ # We explicitly provide the .static versions so that they can be included in
+ # initramfs environments.
+ myconf="${myconf} --enable-static_link"
+ else
+ ewarn "Building shared LVM, it will not work inside genkernel!"
+ buildmode="shared"
+ fi
+
+ # dmeventd requires mirrors to be internal, and snapshot available
+ # so we cannot disable them
+ myconf="${myconf} --with-mirrors=internal"
+ myconf="${myconf} --with-snapshots=internal"
+
+ if use lvm1 ; then
+ myconf="${myconf} --with-lvm1=${buildmode}"
+ else
+ myconf="${myconf} --with-lvm1=none"
+ fi
+
+ # disable O_DIRECT support on hppa, breaks pv detection (#99532)
+ use hppa && myconf="${myconf} --disable-o_direct"
+
+ if use clvm; then
+ myconf="${myconf} --with-cluster=${buildmode}"
+ # 4-state! Make sure we get it right, per bug 210879
+ # Valid options are: none, cman, gulm, all
+ #
+ # 2009/02:
+ # gulm is removed now, now dual-state:
+ # cman, none
+ # all still exists, but is not needed
+ #
+ # 2009/07:
+ # TODO: add corosync and re-enable ALL
+ local clvmd=""
+ use cman && clvmd="cman"
+ #clvmd="${clvmd/cmangulm/all}"
+ [ -z "${clvmd}" ] && clvmd="none"
+ myconf="${myconf} --with-clvmd=${clvmd}"
+ myconf="${myconf} --with-pool=${buildmode}"
+ else
+ myconf="${myconf} --with-clvmd=none --with-cluster=none"
+ fi
+
+ myconf="${myconf} --sbindir=/sbin --with-staticdir=/sbin"
+ econf $(use_enable readline) \
+ $(use_enable selinux) \
+ --enable-pkgconfig \
+ --libdir=/usr/$(get_libdir) \
+ ${myconf} \
+ CLDFLAGS="${LDFLAGS}" || die
+}
+
+src_compile() {
+ einfo "Doing symlinks"
+ pushd include
+ emake || die "Failed to prepare symlinks"
+ popd
+
+ einfo "Starting main build"
+ emake || die "compile fail"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodir /$(get_libdir)
+ # Put these in root so we can reach before /usr is up
+ for i in \
+ libdevmapper-event{,-lvm2{mirror,snapshot}} \
+ libdevmapper \
+ liblvm2{format1,snapshot,cmd} \
+ ; do
+ b="${D}"/usr/$(get_libdir)/${i}
+ if [ -f "${b}".so ]; then
+ mv -f "${b}".so* "${D}"/$(get_libdir) || die
+ gen_usr_ldscript ${i}.so || die
+ fi
+ done
+
+ dodoc README VERSION WHATS_NEW doc/*.{conf,c,txt}
+ insinto /$(get_libdir)/rcscripts/addons
+ newins "${FILESDIR}"/lvm2-start.sh-2.02.49-r3 lvm-start.sh || die
+ newins "${FILESDIR}"/lvm2-stop.sh-2.02.49-r3 lvm-stop.sh || die
+ newinitd "${FILESDIR}"/lvm.rc-2.02.51-r2 lvm || die
+ newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm || die
+ if use clvm; then
+ newinitd "${FILESDIR}"/clvmd.rc-2.02.39 clvmd || die
+ newconfd "${FILESDIR}"/clvmd.confd-2.02.39 clvmd || die
+ fi
+
+ # move shared libs to /lib(64)
+ if use static; then
+ dolib.a libdm/ioctl/libdevmapper.a || die "dolib.a libdevmapper.a"
+ fi
+ #gen_usr_ldscript libdevmapper.so
+
+ insinto /etc
+ doins "${FILESDIR}"/dmtab
+ insinto /$(get_libdir)/rcscripts/addons
+ doins "${FILESDIR}"/dm-start.sh
+
+ # Device mapper stuff
+ newinitd "${FILESDIR}"/device-mapper.rc-1.02.51-r2 device-mapper || die
+ newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper || die
+
+ newinitd "${FILESDIR}"/1.02.22-dmeventd.initd dmeventd || die
+ if use static; then
+ dolib.a daemons/dmeventd/libdevmapper-event.a \
+ || die "dolib.a libdevmapper-event.a"
+ fi
+ #gen_usr_ldscript libdevmapper-event.so
+
+ insinto /etc/udev/rules.d/
+ newins "${FILESDIR}"/64-device-mapper.rules-1.02.49-r2 64-device-mapper.rules || die
+
+ # do not rely on /lib -> /libXX link
+ sed -e "s-/lib/rcscripts/-/$(get_libdir)/rcscripts/-" -i "${D}"/etc/init.d/*
+
+ elog "USE flag nocman is deprecated and replaced"
+ elog "with the cman USE flag."
+ elog ""
+ elog "USE flags clvm and cman are masked"
+ elog "by default and need to be unmasked to use them"
+ elog ""
+ elog "Rebuild your genkernel initramfs if you are using lvm"
+}
+
+pkg_postinst() {
+ elog "lvm volumes are no longer automatically created for"
+ elog "baselayout-2 users. If you are using baselayout-2, be sure to"
+ elog "run: # rc-update add lvm boot"
+ elog "Do NOT add it if you are using baselayout-1 still."
+}
+
+src_test() {
+ einfo "Testcases disabled because of device-node mucking"
+ einfo "If you want them, compile the package and see ${S}/tests"
+}