summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <eradicator@gentoo.org>2006-05-02 08:14:30 +0000
committerJeremy Huddleston <eradicator@gentoo.org>2006-05-02 08:14:30 +0000
commitf3651dd66b06cd7ef6d86db6048921d7c5a67fdf (patch)
tree2fdee4cda6c9fd3ce68758f03ba99033ccded66c /sys-fs/evms
parentinitial commit - ebuild submitted by Cristiano Chiucchiolo via bug #131564 (diff)
downloadgentoo-2-f3651dd66b06cd7ef6d86db6048921d7c5a67fdf.tar.gz
gentoo-2-f3651dd66b06cd7ef6d86db6048921d7c5a67fdf.tar.bz2
gentoo-2-f3651dd66b06cd7ef6d86db6048921d7c5a67fdf.zip
Added maintenance patches to handle degraded raid5 arrays. Closes bug #131193.
(Portage version: 2.1_pre9-r4)
Diffstat (limited to 'sys-fs/evms')
-rw-r--r--sys-fs/evms/ChangeLog9
-rw-r--r--sys-fs/evms/evms-2.5.5-r1.ebuild91
-rw-r--r--sys-fs/evms/files/2.5.5/md_super_fix.patch96
-rw-r--r--sys-fs/evms/files/2.5.5/raid5_degrade_fix.patch38
-rw-r--r--sys-fs/evms/files/digest-evms-2.5.52
-rw-r--r--sys-fs/evms/files/digest-evms-2.5.5-r13
6 files changed, 238 insertions, 1 deletions
diff --git a/sys-fs/evms/ChangeLog b/sys-fs/evms/ChangeLog
index 7a691faff7df..ab33fc1d3c7e 100644
--- a/sys-fs/evms/ChangeLog
+++ b/sys-fs/evms/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-fs/evms
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/ChangeLog,v 1.45 2006/03/29 02:28:25 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/ChangeLog,v 1.46 2006/05/02 08:14:30 eradicator Exp $
+
+*evms-2.5.5-r1 (02 May 2006)
+
+ 02 May 2006; Jeremy Huddleston <eradicator@gentoo.org>
+ +files/2.5.5/md_super_fix.patch, +files/2.5.5/raid5_degrade_fix.patch,
+ +evms-2.5.5-r1.ebuild:
+ Added maintenance patches to handle degraded raid5 arrays. Closes bug #131193.
29 Mar 2006; Aron Griffis <agriffis@gentoo.org> evms-2.5.5.ebuild:
Mark 2.5.5 stable on ia64
diff --git a/sys-fs/evms/evms-2.5.5-r1.ebuild b/sys-fs/evms/evms-2.5.5-r1.ebuild
new file mode 100644
index 000000000000..319928222c62
--- /dev/null
+++ b/sys-fs/evms/evms-2.5.5-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/evms/evms-2.5.5-r1.ebuild,v 1.1 2006/05/02 08:14:30 eradicator Exp $
+
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="Utilities for the IBM Enterprise Volume Management System"
+HOMEPAGE="http://www.sourceforge.net/projects/evms"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc ~sparc ~x86"
+IUSE="ncurses gtk"
+
+#EVMS uses libuuid from e2fsprogs
+DEPEND="virtual/libc
+ sys-fs/e2fsprogs
+ sys-fs/device-mapper
+ >=sys-apps/baselayout-1.9.4-r6
+ gtk? ( =x11-libs/gtk+-1* )
+ ncurses? ( sys-libs/ncurses
+ =dev-libs/glib-1* )"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/${PV}/raid5_degrade_fix.patch
+ epatch ${FILESDIR}/${PV}/md_super_fix.patch
+}
+
+src_compile() {
+ # Bug #54856
+ # filter-flags "-fstack-protector"
+ replace-flags -O3 -O2
+ replace-flags -Os -O2
+
+ local excluded_interfaces=""
+ use ncurses || excluded_interfaces="--disable-text-mode"
+ use gtk || excluded_interfaces="${excluded_interfaces} --disable-gui"
+
+ econf \
+ --libdir=/$(get_libdir) \
+ --sbindir=/sbin \
+ --includedir=/usr/include \
+ ${excluded_interfaces} || die "Failed configure"
+ emake || die "Failed emake"
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "Make install died"
+ dodoc ChangeLog INSTALL* PLUGIN.IDS README TERMINOLOGY doc/linuxrc
+
+ insinto /$(get_libdir)/rcscripts/addons
+ newins "${FILESDIR}"/evms2-start.sh evms-start.sh || die "rcscript addon failed"
+
+ # install the sample configuration into the doc dir
+ dodoc ${D}/etc/evms.conf.sample
+ rm -f ${D}/etc/evms.conf.sample
+
+ # the kernel patches may come handy for people compiling their own kernel
+ docinto kernel/2.4
+ dodoc kernel/2.4/*
+ docinto kernel/2.6
+ dodoc kernel/2.6/*
+
+ # move static libraries to /usr/lib
+ dodir /usr/$(get_libdir)
+ mv -f ${D}/$(get_libdir)/*.a ${D}/usr/$(get_libdir)
+
+ # Create linker scripts for dynamic libs in /lib, else gcc
+ # links to the static ones in /usr/lib first. Bug #4411.
+ for x in ${D}/usr/$(get_libdir)/*.a
+ do
+ if [ -f ${x} ]
+ then
+ local lib="${x##*/}"
+ gen_usr_ldscript ${lib/\.a/\.so}
+ fi
+ done
+
+ # the gtk+ frontend should live in /usr/sbin
+ if use gtk
+ then
+ dodir /usr/sbin
+ mv -f ${D}/sbin/evmsgui ${D}/usr/sbin
+ fi
+
+ # Needed for bug #51252
+ dosym libevms-2.5.so.0.0 /$(get_libdir)/libevms-2.5.so.0
+}
diff --git a/sys-fs/evms/files/2.5.5/md_super_fix.patch b/sys-fs/evms/files/2.5.5/md_super_fix.patch
new file mode 100644
index 000000000000..8ff1b4a22997
--- /dev/null
+++ b/sys-fs/evms/files/2.5.5/md_super_fix.patch
@@ -0,0 +1,96 @@
+--- evms-2.5.5/plugins/md/md_super.c 2006-02-22 14:34:53.000000000 -0600
++++ evms-2.5.5.fix/plugins/md/md_super.c 2006-04-20 11:00:40.733364216 -0500
+@@ -1312,13 +1312,13 @@
+
+ static int sb0_zero_superblock(md_member_t *member, boolean now)
+ {
+- mdp_super_t sb;
++ char buf[MD_SB_BYTES];
+
+ LOG_ENTRY();
+
+ if (now == TRUE) {
+- memset(&sb, 0, MD_SB_BYTES);
+- if ( WRITE(member->obj, member->super_offset, MD_SB_SECTORS, (char*)&sb)) {
++ memset(buf, 0, MD_SB_BYTES);
++ if ( WRITE(member->obj, member->super_offset, MD_SB_SECTORS, buf)) {
+ LOG_EXIT_INT(EIO);
+ return EIO;
+ }
+@@ -1332,7 +1332,7 @@
+
+ static int sb0_zero_saved_info(md_member_t *member, boolean now)
+ {
+- md_saved_info_t info;
++ char buf[MD_SAVED_INFO_BYTES];
+ u_int64_t location;
+
+ LOG_ENTRY();
+@@ -1341,8 +1341,8 @@
+ location += MD_SB0_SAVED_INFO_SECTOR_OFFSET;
+
+ if (now == TRUE) {
+- memset(&info, 0, sizeof(md_saved_info_t));
+- if ( WRITE(member->obj, location, MD_SAVED_INFO_SECTS, (char*)&info)) {
++ memset(buf, 0, MD_SAVED_INFO_BYTES);
++ if ( WRITE(member->obj, location, MD_SAVED_INFO_SECTS, buf)) {
+ LOG_EXIT_INT(EIO);
+ return EIO;
+ }
+@@ -2451,6 +2451,7 @@
+ {
+ int rc = 0;
+ mdp_sb_1_t *duplicate = NULL;
++ mdp_sb_1_t *master;
+ md_volume_t *vol;
+
+ LOG_ENTRY();
+@@ -2462,9 +2463,16 @@
+ }
+
+ vol = member->vol;
++ master = (mdp_sb_1_t *)vol->sb;
++
++ if (vol->flags & (MD_NEW_REGION | MD_DEGRADED)) {
++ LOG_WARNING("%s: Creating new array with missing disk,"
++ " set resync_offset to -1.\n", vol->name);
++ master->resync_offset = -1;
++ }
+
+ /* Copy from master superblock */
+- rc = sb1_duplicate_sb(&member->sb, vol->sb);
++ rc = sb1_duplicate_sb(&member->sb, master);
+ if (rc) {
+ goto out;
+ }
+@@ -2602,8 +2610,8 @@
+ member->obj->name, member->super_offset);
+
+ if (now == TRUE) {
+- memset(&sb, 0, MD_SB_1_BYTES);
+- if ( WRITE(member->obj, member->super_offset, MD_SB_1_SECTORS, (char*)&sb)) {
++ memset(sb, 0, MD_SB_1_BYTES);
++ if ( WRITE(member->obj, member->super_offset, MD_SB_1_SECTORS, sb)) {
+ LOG_EXIT_INT(EIO);
+ return EIO;
+ }
+@@ -2616,7 +2624,7 @@
+
+ static int sb1_zero_saved_info(md_member_t *member, boolean now)
+ {
+- md_saved_info_t info;
++ char buf[MD_SAVED_INFO_BYTES];
+ u_int64_t location;
+
+ LOG_ENTRY();
+@@ -2627,8 +2635,8 @@
+ member->obj->name, location);
+
+ if (now == TRUE) {
+- memset(&info, 0, sizeof(md_saved_info_t));
+- if ( WRITE(member->obj, location, MD_SAVED_INFO_SECTS, (char*)&info)) {
++ memset(buf, 0, MD_SAVED_INFO_BYTES);
++ if ( WRITE(member->obj, location, MD_SAVED_INFO_SECTS, buf) ) {
+ LOG_EXIT_INT(EIO);
+ return EIO;
+ }
diff --git a/sys-fs/evms/files/2.5.5/raid5_degrade_fix.patch b/sys-fs/evms/files/2.5.5/raid5_degrade_fix.patch
new file mode 100644
index 000000000000..973f65011958
--- /dev/null
+++ b/sys-fs/evms/files/2.5.5/raid5_degrade_fix.patch
@@ -0,0 +1,38 @@
+--- evms-2.5.5/plugins/md/raid5_mgr.c 2006-02-22 10:05:17.000000000 -0600
++++ evms-2.5.5.miket/plugins/md/raid5_mgr.c 2006-04-07 15:01:00.837225392 -0500
+@@ -102,6 +102,7 @@
+ md_super_info_t info;
+ mdu_disk_info_t d;
+ int i, count, length = 0;
++ int conf_disks;
+ int rc = 0;
+
+ LOG_ENTRY();
+@@ -117,9 +118,24 @@
+ conf->failed_disk_index = -1;
+
+ LOG_DEBUG("%s: info.raid_disks: %d, info.nr_disks: %d.\n", vol->name, info.raid_disks, info.nr_disks);
+- conf->stripe.nr_disks = (info.raid_disks > info.nr_disks) ? info.raid_disks : info.nr_disks;
+- conf->disks = EngFncs->engine_alloc(sizeof(disk_info_t) * conf->stripe.nr_disks);
+- conf->stripe.chunks = EngFncs->engine_alloc(sizeof(chunk_t) * conf->stripe.nr_disks);
++ conf_disks = (info.raid_disks > info.nr_disks) ? info.raid_disks : info.nr_disks;
++
++ /*
++ * If a spare is added to fix a degrade array,
++ * its index will be out nr_disks range.
++ * Check disk index of each member and adjust conf_disks if necessary.
++ */
++ LIST_FOR_EACH(vol->members, iter, member) {
++ if (member->dev_number >= conf_disks) {
++ LOG_WARNING("%s: Changing number of disk entries:"
++ " current value %d, new value %d.\n",
++ vol->name, conf_disks, member->dev_number+1);
++ conf_disks = member->dev_number + 1;
++ }
++ }
++
++ conf->disks = EngFncs->engine_alloc(sizeof(disk_info_t) * conf_disks);
++ conf->stripe.chunks = EngFncs->engine_alloc(sizeof(chunk_t) * conf_disks);
+
+ /* Set the volume to which the stripe belongs. */
+ conf->stripe.volume = vol;
diff --git a/sys-fs/evms/files/digest-evms-2.5.5 b/sys-fs/evms/files/digest-evms-2.5.5
index 60b14e266b3e..33b12c6760ce 100644
--- a/sys-fs/evms/files/digest-evms-2.5.5
+++ b/sys-fs/evms/files/digest-evms-2.5.5
@@ -1 +1,3 @@
MD5 45b463f0cbade194dc0a08be432b572e evms-2.5.5.tar.gz 2286321
+RMD160 716d6b34f48f6f7a3f5f4627bc4a2c34957607f7 evms-2.5.5.tar.gz 2286321
+SHA256 9dbfaac148d822068ba883f6533935e03ae5cfc9fdf8836dea6aee99c859307c evms-2.5.5.tar.gz 2286321
diff --git a/sys-fs/evms/files/digest-evms-2.5.5-r1 b/sys-fs/evms/files/digest-evms-2.5.5-r1
new file mode 100644
index 000000000000..33b12c6760ce
--- /dev/null
+++ b/sys-fs/evms/files/digest-evms-2.5.5-r1
@@ -0,0 +1,3 @@
+MD5 45b463f0cbade194dc0a08be432b572e evms-2.5.5.tar.gz 2286321
+RMD160 716d6b34f48f6f7a3f5f4627bc4a2c34957607f7 evms-2.5.5.tar.gz 2286321
+SHA256 9dbfaac148d822068ba883f6533935e03ae5cfc9fdf8836dea6aee99c859307c evms-2.5.5.tar.gz 2286321