From 2b945dea69ceff88c1b13d7ef7f5050a01fcb04a Mon Sep 17 00:00:00 2001 From: Juergen Daubert Date: Thu, 4 Jun 2009 11:17:33 +0200 Subject: [PATCH] mdadm: update to 3.0 --- mdadm/.footprint | 6 ++ mdadm/.md5sum | 4 +- mdadm/Pkgfile | 8 +-- mdadm/mdadm-2.6.9-gcc44.patch | 110 ---------------------------------- mdadm/mdadm-3.0-vol_id.patch | 14 +++++ 5 files changed, 26 insertions(+), 116 deletions(-) delete mode 100644 mdadm/mdadm-2.6.9-gcc44.patch create mode 100644 mdadm/mdadm-3.0-vol_id.patch diff --git a/mdadm/.footprint b/mdadm/.footprint index 8999e8f9f..65d25a0c4 100644 --- a/mdadm/.footprint +++ b/mdadm/.footprint @@ -1,5 +1,10 @@ +drwxr-xr-x root/root lib/ +drwxr-xr-x root/root lib/udev/ +drwxr-xr-x root/root lib/udev/rules.d/ +-rw-r--r-- root/root lib/udev/rules.d/64-md-raid.rules drwxr-xr-x root/root sbin/ -rwxr-xr-x root/root sbin/mdadm +-rwxr-xr-x root/root sbin/mdmon drwxr-xr-x root/root usr/ drwxr-xr-x root/root usr/man/ drwxr-xr-x root/root usr/man/man4/ @@ -8,3 +13,4 @@ drwxr-xr-x root/root usr/man/man5/ -rw-r--r-- root/root usr/man/man5/mdadm.conf.5.gz drwxr-xr-x root/root usr/man/man8/ -rw-r--r-- root/root usr/man/man8/mdadm.8.gz +-rw-r--r-- root/root usr/man/man8/mdmon.8.gz diff --git a/mdadm/.md5sum b/mdadm/.md5sum index 5618e676b..9eb5fea15 100644 --- a/mdadm/.md5sum +++ b/mdadm/.md5sum @@ -1,2 +1,2 @@ -4ceaeb6d140ab3286446a976bbdc9a55 mdadm-2.6.9-gcc44.patch -beaa0f066288441d9b3ad1ef67fa0237 mdadm-2.6.9.tar.gz +42b79d4160e996fb64758a17f2a2144b mdadm-3.0-vol_id.patch +1eb89885b2b881562fc79ed2f5e1a056 mdadm-3.0.tar.gz diff --git a/mdadm/Pkgfile b/mdadm/Pkgfile index 9a530eef7..496e02248 100644 --- a/mdadm/Pkgfile +++ b/mdadm/Pkgfile @@ -3,13 +3,13 @@ # Maintainer: Juergen Daubert, juergen dot daubert at t-online dot de name=mdadm -version=2.6.9 -release=2 +version=3.0 +release=1 source=(http://www.kernel.org/pub/linux/utils/raid/$name/$name-$version.tar.gz - $name-$version-gcc44.patch) + $name-$version-vol_id.patch) build() { cd $name-$version - patch -p1 -i $SRC/$name-$version-gcc44.patch + patch -p1 -i $SRC/$name-$version-vol_id.patch make CXFLAGS="$CFLAGS" DESTDIR=$PKG MANDIR=/usr/man install } diff --git a/mdadm/mdadm-2.6.9-gcc44.patch b/mdadm/mdadm-2.6.9-gcc44.patch deleted file mode 100644 index bb9f7fa37..000000000 --- a/mdadm/mdadm-2.6.9-gcc44.patch +++ /dev/null @@ -1,110 +0,0 @@ -From caa0f6c623214231380c5ef0de91b53cc43d1e0b Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Wed, 29 Apr 2009 11:44:02 +1000 -Subject: [PATCH] Fix gcc-4.4 compiler warning. - -Apparently the dereferencing of a type-punned pointer breaks strict -aliasing rules. And we wouldn't want to do that. -So just make a different array of the appropriate type and use memcpy. - -Resolves-Debian-bug: 505375 -Signed-off-by: NeilBrown ---- - bitmap.c | 28 +++++++++++++++------------- - super1.c | 19 +++++++------------ - 2 files changed, 22 insertions(+), 25 deletions(-) - -diff --git a/bitmap.c b/bitmap.c -index 352be5d..5618087 100644 ---- a/bitmap.c -+++ b/bitmap.c -@@ -270,6 +270,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) - int rv = 1; - char buf[64]; - int swap; -+ __u32 uuid32[4]; - - info = bitmap_file_read(filename, brief, &st); - if (!info) -@@ -297,19 +298,20 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) - #else - swap = 1; - #endif -- if (swap) { -- printf(" UUID : %08x:%08x:%08x:%08x\n", -- swapl(*(__u32 *)(sb->uuid+0)), -- swapl(*(__u32 *)(sb->uuid+4)), -- swapl(*(__u32 *)(sb->uuid+8)), -- swapl(*(__u32 *)(sb->uuid+12))); -- } else { -- printf(" UUID : %08x:%08x:%08x:%08x\n", -- *(__u32 *)(sb->uuid+0), -- *(__u32 *)(sb->uuid+4), -- *(__u32 *)(sb->uuid+8), -- *(__u32 *)(sb->uuid+12)); -- } -+ memcpy(uuid32, sb->uuid, 16); -+ if (swap) -+ printf(" UUID : %08x:%08x:%08x:%08x\n", -+ swapl(uuid32[0]), -+ swapl(uuid32[1]), -+ swapl(uuid32[2]), -+ swapl(uuid32[3])); -+ else -+ printf(" UUID : %08x:%08x:%08x:%08x\n", -+ uuid32[0], -+ uuid32[1], -+ uuid32[2], -+ uuid32[3]); -+ - printf(" Events : %llu\n", (unsigned long long)sb->events); - printf(" Events Cleared : %llu\n", (unsigned long long)sb->events_cleared); - printf(" State : %s\n", bitmap_state(sb->state)); -diff --git a/super1.c b/super1.c -index 1342412..037c5eb 100644 ---- a/super1.c -+++ b/super1.c -@@ -612,10 +612,8 @@ static int update_super1(struct supertype *st, struct mdinfo *info, - - if ((rfd = open("/dev/urandom", O_RDONLY)) < 0 || - read(rfd, sb->device_uuid, 16) != 16) { -- *(__u32*)(sb->device_uuid) = random(); -- *(__u32*)(sb->device_uuid+4) = random(); -- *(__u32*)(sb->device_uuid+8) = random(); -- *(__u32*)(sb->device_uuid+12) = random(); -+ __u32 r[4] = {random(), random(), random(), random()}; -+ memcpy(sb->device_uuid, r, 16); - } - - sb->dev_roles[i] = -@@ -735,10 +733,8 @@ static int init_super1(struct supertype *st, mdu_array_info_t *info, - else { - if ((rfd = open("/dev/urandom", O_RDONLY)) < 0 || - read(rfd, sb->set_uuid, 16) != 16) { -- *(__u32*)(sb->set_uuid) = random(); -- *(__u32*)(sb->set_uuid+4) = random(); -- *(__u32*)(sb->set_uuid+8) = random(); -- *(__u32*)(sb->set_uuid+12) = random(); -+ __u32 r[4] = {random(), random(), random(), random()}; -+ memcpy(sb->set_uuid, r, 16); - } - if (rfd >= 0) close(rfd); - } -@@ -912,11 +908,10 @@ static int write_init_super1(struct supertype *st, - - if ((rfd = open("/dev/urandom", O_RDONLY)) < 0 || - read(rfd, sb->device_uuid, 16) != 16) { -- *(__u32*)(sb->device_uuid) = random(); -- *(__u32*)(sb->device_uuid+4) = random(); -- *(__u32*)(sb->device_uuid+8) = random(); -- *(__u32*)(sb->device_uuid+12) = random(); -+ __u32 r[4] = {random(), random(), random(), random()}; -+ memcpy(sb->device_uuid, r, 16); - } -+ - if (rfd >= 0) close(rfd); - sb->events = 0; - --- -1.6.2 - diff --git a/mdadm/mdadm-3.0-vol_id.patch b/mdadm/mdadm-3.0-vol_id.patch new file mode 100644 index 000000000..106b0c57a --- /dev/null +++ b/mdadm/mdadm-3.0-vol_id.patch @@ -0,0 +1,14 @@ +# http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=f07996885dab45102492d7f16e7e2997e264c725 + +diff -Nru mdadm-3.0.orig/udev-md-raid.rules mdadm-3.0/udev-md-raid.rules +--- mdadm-3.0.orig/udev-md-raid.rules 2009-06-04 10:47:00.000000000 +0200 ++++ mdadm-3.0/udev-md-raid.rules 2009-06-04 10:48:50.000000000 +0200 +@@ -30,7 +30,7 @@ + ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" + ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" + +-IMPORT{program}="vol_id --export $tempnode" ++IMPORT{program}="/sbin/blkid -o udev -p $tempnode" + OPTIONS+="link_priority=100" + 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}"