- Update to latest devel release
- Remove the no longer necessary udev patch - Remove the no longer necessary warn patch - Remove the no longer necessary alias patch - Update the mdadm.rules file to only pay attention to device adds, not changes and to enable incremental assembly - Add a cron job to run a weekly repair of the array to correct bad sectors - Resolves: bz474436, bz490972
This commit is contained in:
parent
77d3b8d977
commit
67385865bb
@ -11,3 +11,4 @@ mdadm-2.6.4.tgz
|
||||
mdadm-2.6.7.tar.bz2
|
||||
mdadm-2.6.7.1.tar.bz2
|
||||
mdadm-3.0-devel2.tar.bz2
|
||||
mdadm-3.0-devel3.tar.bz2
|
||||
|
@ -1,15 +0,0 @@
|
||||
--- mdadm-3.0-devel2/super-intel.c.undef 2009-02-13 15:09:40.000000000 -0500
|
||||
+++ mdadm-3.0-devel2/super-intel.c 2009-02-13 15:09:58.000000000 -0500
|
||||
@@ -271,8 +271,10 @@ static __u32 __gen_imsm_checksum(struct
|
||||
__u32 *p = (__u32 *) mpb;
|
||||
__u32 sum = 0;
|
||||
|
||||
- while (end--)
|
||||
- sum += __le32_to_cpu(*p++);
|
||||
+ while (end--) {
|
||||
+ sum += __le32_to_cpu(*p);
|
||||
+ p++;
|
||||
+ }
|
||||
|
||||
return sum - __le32_to_cpu(mpb->check_sum);
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
--- mdadm-3.0-devel2/super-ddf.c.typedef 2009-02-13 15:26:56.000000000 -0500
|
||||
+++ mdadm-3.0-devel2/super-ddf.c 2009-02-13 15:28:17.000000000 -0500
|
||||
@@ -1043,9 +1043,9 @@ static void examine_vd(int n, struct ddf
|
||||
--- mdadm-3.0-devel3/super-ddf.c.orig 2009-03-10 01:39:41.000000000 -0400
|
||||
+++ mdadm-3.0-devel3/super-ddf.c 2009-03-17 15:22:41.000000000 -0400
|
||||
@@ -1062,9 +1062,9 @@
|
||||
map_num(ddf_sec_level, vc->srl) ?: "-unknown-");
|
||||
}
|
||||
printf(" Device Size[%d] : %llu\n", n,
|
||||
@ -12,11 +12,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1105,7 +1105,7 @@ static void examine_pds(struct ddf_super
|
||||
(state&32)? ", Unrecovered Read Errors": "",
|
||||
(state&64)? ", Missing" : "");
|
||||
printf(" Avail Size[%d] : %llu K\n", i,
|
||||
- __be64_to_cpu(pd->config_size)>>1);
|
||||
@@ -1111,7 +1111,8 @@
|
||||
//printf("\n");
|
||||
printf(" %3d %08x ", i,
|
||||
__be32_to_cpu(pd->refnum));
|
||||
- printf("%lluK ", __be64_to_cpu(pd->config_size)>>1);
|
||||
+ printf("%lluK ",
|
||||
+ (unsigned long long)__be64_to_cpu(pd->config_size)>>1);
|
||||
for (dl = sb->dlist; dl ; dl = dl->next) {
|
||||
if (dl->disk.refnum == pd->refnum) {
|
||||
|
15
mdadm-3.0-incremental.patch
Normal file
15
mdadm-3.0-incremental.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- mdadm-3.0-devel3/udev-md-raid.rules.incremental 2009-03-18 14:16:24.000000000 -0400
|
||||
+++ mdadm-3.0-devel3/udev-md-raid.rules 2009-03-18 14:17:11.000000000 -0400
|
||||
@@ -1,10 +1,10 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
SUBSYSTEM!="block", GOTO="md_end"
|
||||
-ACTION!="add|change", GOTO="md_end"
|
||||
+ACTION!="add", GOTO="md_end"
|
||||
|
||||
# import data from a raid member and activate it
|
||||
-#ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}"
|
||||
+ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}"
|
||||
# import data from a raid set
|
||||
KERNEL!="md*", GOTO="md_end"
|
||||
|
@ -1,28 +0,0 @@
|
||||
--- mdadm-3.0-devel2/Makefile.udev 2009-02-12 09:10:23.000000000 -0500
|
||||
+++ mdadm-3.0-devel2/Makefile 2009-02-12 09:12:20.000000000 -0500
|
||||
@@ -44,7 +44,7 @@ CC = $(CROSS_COMPILE)gcc
|
||||
CXFLAGS = -ggdb
|
||||
CWFLAGS = -Wall -Werror -Wstrict-prototypes
|
||||
ifdef WARN_UNUSED
|
||||
-CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
|
||||
+CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -Os
|
||||
endif
|
||||
|
||||
ifdef DEBIAN
|
||||
@@ -71,6 +71,7 @@ MANDIR = /usr/share/man
|
||||
MAN4DIR = $(MANDIR)/man4
|
||||
MAN5DIR = $(MANDIR)/man5
|
||||
MAN8DIR = $(MANDIR)/man8
|
||||
+UDEVDIR = /etc/udev/rules.d
|
||||
|
||||
OBJS = mdadm.o config.o mdstat.o ReadMe.o util.o Manage.o Assemble.o Build.o \
|
||||
Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \
|
||||
@@ -199,7 +200,7 @@ install-man: mdadm.8 md.4 mdadm.conf.5
|
||||
$(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
|
||||
|
||||
install-udev: udev-md-raid.rules
|
||||
- $(INSTALL) -D -m 644 udev-md-raid.rules /lib/udev/rules.d/64-md-raid.rules
|
||||
+ $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)$(UDEVDIR)/64-md-raid.rules
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 md.4 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
|
@ -1,24 +0,0 @@
|
||||
--- mdadm-3.0-devel2/mdopen.c.warn 2009-02-12 09:13:54.000000000 -0500
|
||||
+++ mdadm-3.0-devel2/mdopen.c 2009-02-12 09:34:15.000000000 -0500
|
||||
@@ -88,8 +88,9 @@ void make_parts(char *dev, int cnt)
|
||||
if (chmod(name, stb2.st_mode & 07777))
|
||||
perror("chmod");
|
||||
} else {
|
||||
- snprintf(sym, 10000, "%s%s%d", orig, odig?"p":"", i);
|
||||
- symlink(sym, name);
|
||||
+ snprintf(sym, 1024, "%s%s%d", orig, odig?"p":"", i);
|
||||
+ if (symlink(sym, name))
|
||||
+ perror("symlink");
|
||||
}
|
||||
stat(name, &stb2);
|
||||
add_dev(name, &stb2, 0, NULL);
|
||||
@@ -357,7 +358,8 @@ int create_mddev(char *dev, char *name,
|
||||
strcpy(chosen, devname);
|
||||
}
|
||||
} else
|
||||
- symlink(devname, chosen);
|
||||
+ if (symlink(devname, chosen))
|
||||
+ perror("symlink");
|
||||
if (use_mdp && strcmp(chosen, devname) != 0)
|
||||
make_parts(chosen, parts);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
# This file causes block devices with Linux RAID (mdadm) signatures to
|
||||
# automatically cause mdadm to be run.
|
||||
# See udev(8) for syntax
|
||||
|
||||
SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="linux_raid*", \
|
||||
RUN+="/sbin/mdadm -I $root/%k"
|
44
mdadm.spec
44
mdadm.spec
@ -1,15 +1,13 @@
|
||||
Summary: The mdadm program controls Linux md devices (software RAID arrays)
|
||||
Name: mdadm
|
||||
Version: 3.0
|
||||
Release: 0.devel2.2%{?dist}.1
|
||||
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}-devel2.tar.bz2
|
||||
Release: 0.devel3.1%{?dist}
|
||||
Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}-devel3.tar.bz2
|
||||
Source1: mdmonitor.init
|
||||
Source2: mdadm.rules
|
||||
Patch1: mdadm-3.0-udev.patch
|
||||
Patch2: mdadm-3.0-warn.patch
|
||||
Patch3: mdadm-2.5.2-static.patch
|
||||
Patch4: mdadm-3.0-alias.patch
|
||||
Patch5: mdadm-3.0-cast.patch
|
||||
Source2: raid-check
|
||||
Patch1: mdadm-2.5.2-static.patch
|
||||
Patch2: mdadm-3.0-cast.patch
|
||||
Patch3: mdadm-3.0-incremental.patch
|
||||
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
|
||||
License: GPLv2+
|
||||
Group: System Environment/Base
|
||||
@ -18,6 +16,7 @@ Obsoletes: mdctl,raidtools
|
||||
Requires(post): /sbin/service, /sbin/chkconfig
|
||||
Requires(preun): /sbin/service, /sbin/chkconfig
|
||||
Requires(postun): /sbin/service
|
||||
Requires: udev
|
||||
BuildRequires: glibc-static
|
||||
|
||||
%description
|
||||
@ -28,24 +27,20 @@ almost all functions without a configuration file, though a configuration
|
||||
file can be used to help with some common tasks.
|
||||
|
||||
%prep
|
||||
%setup -q -n mdadm-3.0-devel2
|
||||
%patch1 -p1 -b .udev
|
||||
%patch2 -p1 -b .warn
|
||||
%patch3 -p1 -b .static
|
||||
%patch4 -p1 -b .alias
|
||||
%patch5 -p1 -b .cast
|
||||
%setup -q -n mdadm-3.0-devel3
|
||||
%patch1 -p1 -b .static
|
||||
%patch2 -p1 -b .cast
|
||||
%patch3 -p1 -b .incremental
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" SYSCONFDIR="%{_sysconfdir}" mdadm.static mdadm mdmon
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -Dp -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/mdmonitor
|
||||
mkdir -p -m 755 $RPM_BUILD_ROOT/etc/udev/rules.d
|
||||
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/udev/rules.d/70-mdadm-assemble.rules
|
||||
install -Dp -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/mdmonitor
|
||||
install -Dp -m 755 %{SOURCE2} $RPM_BUILD_ROOT/%{_sysconfdir}/cron.weekly/raid-check
|
||||
make DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} BINDIR=/sbin install install-static
|
||||
mkdir -p -m 700 $RPM_BUILD_ROOT/var/run/mdadm
|
||||
rm -f $RPM_BUILD_ROOT/etc/udev/rules.d/64-*.rules
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -77,13 +72,24 @@ fi
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc TODO ChangeLog mdadm.conf-example COPYING misc/*
|
||||
/etc/udev/rules.d/*
|
||||
/lib/udev/rules.d/*
|
||||
/sbin/*
|
||||
%{_initrddir}/*
|
||||
%{_mandir}/man*/md*
|
||||
%{_sysconfdir}/cron.weekly/*
|
||||
%attr(0700,root,root) %dir /var/run/mdadm
|
||||
|
||||
%changelog
|
||||
* Tue Mar 17 2009 Doug Ledford <dledford@redhat.com> - 3.0-0.devel3.1
|
||||
- Update to latest devel release
|
||||
- Remove the no longer necessary udev patch
|
||||
- Remove the no longer necessary warn patch
|
||||
- Remove the no longer necessary alias patch
|
||||
- Update the mdadm.rules file to only pay attention to device adds, not
|
||||
changes and to enable incremental assembly
|
||||
- Add a cron job to run a weekly repair of the array to correct bad sectors
|
||||
- Resolves: bz474436, bz490972
|
||||
|
||||
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.devel2.2.1
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||
|
||||
|
6
raid-check
Normal file
6
raid-check
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
for dev in `grep "^md.*: active" /proc/mdstat | cut -f 1 -d ' '`; do
|
||||
echo "repair" > /sys/block/$dev/md/sync_action
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user