diff options
author | Caleb Tennis <caleb@gentoo.org> | 2009-04-09 23:00:10 +0000 |
---|---|---|
committer | Caleb Tennis <caleb@gentoo.org> | 2009-04-09 23:00:10 +0000 |
commit | da576c88d33d88cbda0c3dbb78495cd41417fb93 (patch) | |
tree | 23f79a34f7129b84dae5e5f7ecc6d1b6513d4f6a /sys-fs | |
parent | remove mask on postgres 8.3, as I've removed the ebuilds (diff) | |
download | gentoo-2-da576c88d33d88cbda0c3dbb78495cd41417fb93.tar.gz gentoo-2-da576c88d33d88cbda0c3dbb78495cd41417fb93.tar.bz2 gentoo-2-da576c88d33d88cbda0c3dbb78495cd41417fb93.zip |
version bump per bug #263243
(Portage version: 2.1.6.11/cvs/Linux i686)
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/lvm2/ChangeLog | 13 | ||||
-rw-r--r-- | sys-fs/lvm2/files/1.02.22-dmeventd.initd | 21 | ||||
-rw-r--r-- | sys-fs/lvm2/files/64-device-mapper.rules-1.02.22-r5 | 25 | ||||
-rw-r--r-- | sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 | 1 | ||||
-rw-r--r-- | sys-fs/lvm2/files/device-mapper.rc-1.02.22-r3 | 24 | ||||
-rw-r--r-- | sys-fs/lvm2/files/dm-start.sh | 86 | ||||
-rw-r--r-- | sys-fs/lvm2/files/dmtab | 12 | ||||
-rw-r--r-- | sys-fs/lvm2/files/lvm.conf-2.02.45.patch | 79 | ||||
-rw-r--r-- | sys-fs/lvm2/files/lvm2-2.02.45-device-mapper-export-format.patch | 285 | ||||
-rw-r--r-- | sys-fs/lvm2/files/lvm2-2.02.45-dmeventd.patch | 11 | ||||
-rw-r--r-- | sys-fs/lvm2/lvm2-2.02.45.ebuild | 174 |
11 files changed, 730 insertions, 1 deletions
diff --git a/sys-fs/lvm2/ChangeLog b/sys-fs/lvm2/ChangeLog index 9cb56a512e8c..ea15e2f1027e 100644 --- a/sys-fs/lvm2/ChangeLog +++ b/sys-fs/lvm2/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-fs/lvm2 # Copyright 2000-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.151 2009/01/17 22:53:14 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.152 2009/04/09 23:00:10 caleb Exp $ + +*lvm2-2.02.45 (09 Apr 2009) + + 09 Apr 2009; Caleb Tennis <caleb@gentoo.org> + +files/device-mapper.conf-1.02.22-r3, +files/device-mapper.rc-1.02.22-r3, + +files/64-device-mapper.rules-1.02.22-r5, + +files/lvm2-2.02.45-device-mapper-export-format.patch, + +files/1.02.22-dmeventd.initd, +files/lvm2-2.02.45-dmeventd.patch, + +files/lvm.conf-2.02.45.patch, +files/dm-start.sh, +files/dmtab, + +lvm2-2.02.45.ebuild: + Version bump per bug #263243 17 Jan 2009; Robin H. Johnson <robbat2@gentoo.org> files/lvm.rc-2.02.28-r2: diff --git a/sys-fs/lvm2/files/1.02.22-dmeventd.initd b/sys-fs/lvm2/files/1.02.22-dmeventd.initd new file mode 100644 index 000000000000..f29da2e345b7 --- /dev/null +++ b/sys-fs/lvm2/files/1.02.22-dmeventd.initd @@ -0,0 +1,21 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/1.02.22-dmeventd.initd,v 1.1 2009/04/09 23:00:10 caleb Exp $ + +depend() { + before device-mapper +} + +start() { + ebegin "Starting dmeventd" + start-stop-daemon --start --exec /sbin/dmeventd --pidfile /var/run/dmeventd.pid + eend $? +} + +stop() { + ebegin "Stopping dmeventd" + start-stop-daemon --stop --exec /sbin/dmeventd --pidfile /var/run/dmeventd.pid + eend $? +} + diff --git a/sys-fs/lvm2/files/64-device-mapper.rules-1.02.22-r5 b/sys-fs/lvm2/files/64-device-mapper.rules-1.02.22-r5 new file mode 100644 index 000000000000..36c085b56b97 --- /dev/null +++ b/sys-fs/lvm2/files/64-device-mapper.rules-1.02.22-r5 @@ -0,0 +1,25 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="device-mapper", SYMLINK+="mapper/control" + +KERNEL!="dm-*", GOTO="device_mapper_end" +ACTION!="add|change", GOTO="device_mapper_end" + +IMPORT{program}="/sbin/dmsetup info --export -j%M -m%m" +ENV{DM_NAME}!="?*", GOTO="device_mapper_end" +NAME="mapper/$env{DM_NAME}", SYMLINK+="%k" + +SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" +ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" + +ENV{DM_SUSPENDED}=="1", GOTO="device_mapper_end" +ENV{DM_EXISTS}=="0", GOTO="device_mapper_end" +ENV{DM_TARGET_TYPES}=="|*error*", GOTO="device_mapper_end" + +IMPORT{program}="vol_id --export $tempnode" +OPTIONS="link_priority=-100" +ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS="link_priority=-90" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="device_mapper_end" diff --git a/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 b/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 new file mode 100644 index 000000000000..bc7a25158635 --- /dev/null +++ b/sys-fs/lvm2/files/device-mapper.conf-1.02.22-r3 @@ -0,0 +1 @@ +RC_AFTER="lvm" diff --git a/sys-fs/lvm2/files/device-mapper.rc-1.02.22-r3 b/sys-fs/lvm2/files/device-mapper.rc-1.02.22-r3 new file mode 100644 index 000000000000..226ee80e30a3 --- /dev/null +++ b/sys-fs/lvm2/files/device-mapper.rc-1.02.22-r3 @@ -0,0 +1,24 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-1.02.22-r3,v 1.1 2009/04/09 23:00:10 caleb Exp $ + +depend() { + # necessary for services when using baselayout-2 + # but conflict for baselayout-1 + if [ -e /etc/init.d/root ] ; then + after modules + before checkfs fsck + fi +} + +start() { + if [ ! -e /etc/init.d/root ] ; then + eerror "The ${SVCNAME} init script is written for baselayout-2" + eerror "Please do not use it with baselayout-1" + return 1 + fi + + start_addon dm +} + diff --git a/sys-fs/lvm2/files/dm-start.sh b/sys-fs/lvm2/files/dm-start.sh new file mode 100644 index 000000000000..84acfa4aee17 --- /dev/null +++ b/sys-fs/lvm2/files/dm-start.sh @@ -0,0 +1,86 @@ +# /lib/rcscripts/addons/dm-start.sh: Setup DM volumes at boot +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dm-start.sh,v 1.1 2009/04/09 23:00:10 caleb Exp $ + +# char **get_new_dm_volumes(void) +# +# Return dmsetup commands to setup volumes +get_new_dm_volumes() { + local volume params + + # Filter comments and blank lines + grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \ + while read volume params ; do + # If it exists, skip it + dmvolume_exists "${volume%:}" && continue + # Assemble the command to run to create volume + echo "echo ${params} | /sbin/dmsetup create ${volume%:}" + done + + return 0 +} + +# int dmvolume_exists(volume) +# +# Return true if volume exists in DM table +dmvolume_exists() { + local x line volume=$1 + + [ -z "${volume}" ] && return 1 + + /sbin/dmsetup ls 2>/dev/null | \ + while read line ; do + for x in ${line} ; do + # the following conditonal return only breaks out + # of the while loop, as it is running in a pipe. + [ "${x}" = "${volume}" ] && return 1 + # We only want to check the volume name + break + done + done + + # if 1 was returned from the above loop, then indicate that + # volume exists + [ $? = 1 ] && return 0 + + # otherwise the loop exited normally and the volume does not + # exist + return 1 +} + +# int is_empty_dm_volume(volume) +# +# Return true if the volume exists in DM table, but is empty/non-valid +is_empty_dm_volume() { + local table volume=$1 + + set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:") + [ "${volume}" = "$1" -a -z "$2" ] +} + +local x volume + +if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then + [ -n "$(get_new_dm_volumes)" ] && \ + einfo " Setting up device-mapper volumes:" + + get_new_dm_volumes | \ + while read x ; do + [ -n "${x}" ] || continue + + volume="${x##* }" + + ebegin " Creating volume: ${volume}" + if ! eval "${x}" >/dev/null 2>/dev/null ; then + eend 1 " Error creating volume: ${volume}" + # dmsetup still adds an empty volume in some cases, + # so lets remove it + is_empty_dm_volume "${volume}" && \ + /sbin/dmsetup remove "${volume}" 2>/dev/null + else + eend 0 + fi + done +fi + + +# vim:ts=4 diff --git a/sys-fs/lvm2/files/dmtab b/sys-fs/lvm2/files/dmtab new file mode 100644 index 000000000000..5fc1d793b53a --- /dev/null +++ b/sys-fs/lvm2/files/dmtab @@ -0,0 +1,12 @@ +#/etc/dmraid: config file for adding device-mapper volumes at boot +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmtab,v 1.1 2009/04/09 23:00:10 caleb Exp $ + +# Format: <volume name>: <table> +# Example: isw0: 0 312602976 striped 2 128 /dev/sda 0 /dev/sdb 0 +# +# Alternatively you can create all your volumes the first time, and just run: +# +# dmsetup table >> /etc/dmtab +# +# and verify that they are correct. + diff --git a/sys-fs/lvm2/files/lvm.conf-2.02.45.patch b/sys-fs/lvm2/files/lvm.conf-2.02.45.patch new file mode 100644 index 000000000000..0bd98bc675eb --- /dev/null +++ b/sys-fs/lvm2/files/lvm.conf-2.02.45.patch @@ -0,0 +1,79 @@ +--- doc/example.conf.orig 2009-02-22 14:00:26.000000000 -0500 ++++ doc/example.conf 2009-03-22 04:10:05.629026882 -0400 +@@ -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|" ] +@@ -230,12 +232,14 @@ + # e.g. vgscan.lvm1 and they will stop working after you start using + # 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. + # Defaults to "lvm1" if compiled in, else "lvm2". +- # format = "lvm1" ++ # Gentoo: default to LVM2 format ++ format = "lvm2" + + # Location of proc filesystem + proc = "/proc" +@@ -364,12 +368,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: enabled for data safety ++ pvmetadatacopies = 2 + + # Approximate default size of on-disk metadata areas in sectors. + # You should increase this if you have large volume groups or +@@ -391,11 +395,11 @@ + # the supplied toolset to make changes (e.g. vgcfgrestore). + + # dirs = [ "/etc/lvm/metadata", "/mnt/disk2/lvm/metadata2" ] +-#} ++} + + # Event daemon +-# +-# dmeventd { ++# Gentoo: uncommented, since we provide the dmeventd init script ++dmeventd { + # mirror_library is the library used when monitoring a mirror device. + # + # "libdevmapper-event-lvm2mirror.so" attempts to recover from +@@ -403,7 +407,7 @@ + # reconfigures a mirror as necessary. If no mirror library is + # provided, mirrors are not monitored through dmeventd. + +- # mirror_library = "libdevmapper-event-lvm2mirror.so" ++ mirror_library = "libdevmapper-event-lvm2mirror.so" + + # snapshot_library is the library used when monitoring a snapshot device. + # +@@ -412,6 +416,6 @@ + # snapshot exceedes 80%. The warning is repeated when 85%, 90% and + # 95% of the snapshot are filled. + +- # snapshot_library = "libdevmapper-event-lvm2snapshot.so" +-#} ++ snapshot_library = "libdevmapper-event-lvm2snapshot.so" ++} + diff --git a/sys-fs/lvm2/files/lvm2-2.02.45-device-mapper-export-format.patch b/sys-fs/lvm2/files/lvm2-2.02.45-device-mapper-export-format.patch new file mode 100644 index 000000000000..6f541d484a47 --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-2.02.45-device-mapper-export-format.patch @@ -0,0 +1,285 @@ +--- tools/dmsetup.c 2008-06-24 15:53:47.000000000 -0700 ++++ tools/dmsetup.c 2008-06-28 01:53:56.048598048 -0700 +@@ -108,6 +108,7 @@ + enum { + READ_ONLY = 0, + COLS_ARG, ++ EXPORT_ARG, + EXEC_ARG, + FORCE_ARG, + GID_ARG, +@@ -142,7 +143,8 @@ + DR_TASK = 1, + DR_INFO = 2, + DR_DEPS = 4, +- DR_TREE = 8 /* Complete dependency tree required */ ++ DR_TREE = 8, /* Complete dependency tree required */ ++ DR_TABLE = 0x10, /* table is required, not just info */ + } report_type_t; + + static int _switches[NUM_SWITCHES]; +@@ -1126,8 +1128,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; +@@ -1591,6 +1598,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, +@@ -1702,6 +1719,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, ¶ms); ++ 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, ¶ms); ++ 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) +@@ -1925,6 +2002,7 @@ + { DR_INFO, "Mapped Device Information", "", _info_get_obj }, + { DR_DEPS, "Mapped Device Relationship Information", "", _deps_get_obj }, + { DR_TREE, "Mapped Device Relationship Information", "", _tree_get_obj }, ++ { DR_TABLE, "Mapped Device Table", "", _task_get_obj }, + { 0, "", "", NULL }, + }; + +@@ -1944,6 +2022,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.") +@@ -1954,6 +2033,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.") +@@ -1961,6 +2045,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.") + {0, 0, 0, 0, "", "", NULL, NULL}, + /* *INDENT-ON* */ + }; +@@ -1971,13 +2056,15 @@ + #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 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; +@@ -2004,6 +2091,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]; +@@ -2055,6 +2151,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))) +@@ -2133,7 +2232,8 @@ + fprintf(out, "dmsetup [--version] [-v|--verbose [-v|--verbose ...]]\n" + " [-r|--readonly] [--noopencount] [--nolockfs]\n" + " [--readahead [+]<sectors>|auto|none]\n" +- " [-c|-C|--columns] [-o <fields>] [-O|--sort <sort_fields>]\n" ++ " [-c|-C|--columns] [-e|--export]\n" ++ " [-o <fields>] [-O|--sort <sort_fields>]\n" + " [--nameprefixes] [--noheadings] [--separator <separator>]\n\n"); + for (i = 0; _commands[i].name; i++) + fprintf(out, "\t%s %s\n", _commands[i].name, _commands[i].help); +@@ -2484,6 +2584,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}, +@@ -2566,12 +2667,16 @@ + + optarg = 0; + optind = OPTIND_INIT; +- while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCfGj:m:Mno:O:ru:Uv", ++ while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "cCefGj:m:Mno:O:ru:Uv", + 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 -Nuar --exclude '*.rej' --exclude '*.orig' device-mapper.1.02.27.orig/lib/libdevmapper.h device-mapper.1.02.27/lib/libdevmapper.h +--- libdm/libdevmapper.h 2008-06-24 15:53:48.000000000 -0700 ++++ libdm/libdevmapper.h 2008-06-28 01:54:55.588111461 -0700 +@@ -742,6 +742,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 '*.rej' --exclude '*.orig' device-mapper.1.02.27.orig/lib/libdm-report.c device-mapper.1.02.27/lib/libdm-report.c +--- libdm/libdm-report.c 2008-06-24 17:10:36.000000000 -0700 ++++ libdm/libdm-report.c 2008-06-28 01:56:39.778466634 -0700 +@@ -808,6 +809,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))) { +@@ -838,6 +841,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 --git a/sys-fs/lvm2/files/lvm2-2.02.45-dmeventd.patch b/sys-fs/lvm2/files/lvm2-2.02.45-dmeventd.patch new file mode 100644 index 000000000000..f8b5dadc3152 --- /dev/null +++ b/sys-fs/lvm2/files/lvm2-2.02.45-dmeventd.patch @@ -0,0 +1,11 @@ +--- daemons/dmeventd/Makefile.in 2009-03-22 04:01:26.754802410 -0400 ++++ daemons/dmeventd/Makefile.in.new 2009-03-22 04:01:14.693689634 -0400 +@@ -42,7 +42,7 @@ + LDFLAGS += -ldl -ldevmapper -lpthread + CLDFLAGS += -ldl -ldevmapper -lpthread + +-dmeventd: $(LIB_SHARED) $(VERSIONED_SHLIB) dmeventd.o ++dmeventd: $(LIB_SHARED) $(LIB_STATIC) $(VERSIONED_SHLIB) dmeventd.o + $(CC) -o $@ dmeventd.o $(CFLAGS) $(LDFLAGS) \ + -L. -ldevmapper-event $(LIBS) -rdynamic + diff --git a/sys-fs/lvm2/lvm2-2.02.45.ebuild b/sys-fs/lvm2/lvm2-2.02.45.ebuild new file mode 100644 index 000000000000..cf2f896fa5bd --- /dev/null +++ b/sys-fs/lvm2/lvm2-2.02.45.ebuild @@ -0,0 +1,174 @@ +# 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.45.ebuild,v 1.1 2009/04/09 23:00:10 caleb Exp $ + +inherit eutils multilib toolchain-funcs + +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" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" + +IUSE="readline static clvm cman lvm1 selinux" + +DEPEND="!sys-fs/device-mapper + clvm? ( >=sys-cluster/dlm-1.01.00 + cman? ( >=sys-cluster/cman-1.01.00 ) )" + +RDEPEND="${DEPEND} + !sys-fs/lvm-user + !sys-fs/clvm" + +S="${WORKDIR}/${PN/lvm/LVM}.${PV}" + +pkg_setup() { + use nolvmstatic && eerror "USE=nolvmstatic has changed to USE=static via package.use" + use nolvm1 && eerror "USE=nolvm1 has changed to USE=lvm1 via package.use" +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-dmeventd.patch + epatch "${FILESDIR}"/lvm.conf-2.02.45.patch + epatch "${FILESDIR}"/${P}-device-mapper-export-format.patch +} + +src_compile() { + # Static compile of lvm2 so that the install described in the handbook works + # http://www.gentoo.org/doc/en/lvm2.xml + # fixes http://bugs.gentoo.org/show_bug.cgi?id=84463 + local myconf + local buildmode + + # fsadm is broken, don't include it (2.02.28) + myconf="${myconf} --enable-dmeventd --enable-cmdlib" + + # 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" + myconf="${myconf} --enable-static_link" + buildmode="internal" + 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 + 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) \ + --libdir=/usr/$(get_libdir) \ + ${myconf} \ + CLDFLAGS="${LDFLAGS}" || die + + emake || die "compile problem" +} + +src_install() { + emake DESTDIR="${D}" install + # TODO: At some point in the future, we need to stop installing the static + # as the /sbin/lvm name, and have both variants seperate. + if use static; then + cp -f "${D}"/sbin/lvm.static "${D}"/sbin/lvm \ + || die "Failed to copy lvm.static" + fi + + dodir /$(get_libdir) + # Put these in root so we can reach before /usr is up + for i in libdevmapper-event-lvm2mirror liblvm2{format1,snapshot} ; do + b="${D}"/usr/$(get_libdir)/${i} + if [ -f "${b}".so ]; then + mv -f "${b}".so* "${D}"/$(get_libdir) || die + fi + done + + dodoc README VERSION WHATS_NEW doc/*.{conf,c,txt} + insinto /lib/rcscripts/addons + newins "${FILESDIR}"/lvm2-start.sh-2.02.28-r2 lvm-start.sh || die + newins "${FILESDIR}"/lvm2-stop.sh-2.02.37 lvm-stop.sh || die + newinitd "${FILESDIR}"/lvm.rc-2.02.28-r2 lvm || die + newconfd "${FILESDIR}"/lvm.confd-2.02.28-r2 lvm || die + if use clvm; then + newinitd "${FILESDIR}"/clvmd.rc-2.02.28-r3 clvmd || die + fi + + + # move shared libs to /lib(64) + mv "${D}"/usr/$(get_libdir)/libdevmapper.so* "${D}"/$(get_libdir) + mv "${D}"/usr/$(get_libdir)/libdevmapper-event.so* "${D}"/$(get_libdir) + dolib.a libdm/ioctl/libdevmapper.a || die "dolib.a" + gen_usr_ldscript libdevmapper.so + + insinto /etc + doins "${FILESDIR}"/dmtab + insinto /lib/rcscripts/addons + doins "${FILESDIR}"/dm-start.sh + + # Device mapper stuff + newinitd "${FILESDIR}"/device-mapper.rc-1.02.22-r3 device-mapper || die + newconfd "${FILESDIR}"/device-mapper.conf-1.02.22-r3 device-mapper || die + + newinitd "${FILESDIR}"/1.02.22-dmeventd.initd dmeventd || die + dolib.a daemons/dmeventd/libdevmapper-event.a || die + gen_usr_ldscript libdevmapper-event.so + + insinto /etc/udev/rules.d/ + newins "${FILESDIR}"/64-device-mapper.rules-1.02.22-r5 64-device-mapper.rules || die + + elog "use flag nocman is deprecated and replaced" + elog "with cman and gulm use flags." + elog "" + elog "use flags clvm,cman and gulm are masked" + elog "by default and need to be unmasked to use them" + elog "" + elog "Rebuild your genkernel initramfs if you are using lvm" + use nolvmstatic && \ + elog "USE=nolvmstatic has changed to USE=static via package.use" + use nolvm1 && \ + elog "USE=nolvm1 has changed to USE=lvm1 via package.use" +} + +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" +} |