summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebian/bugscript90
-rw-r--r--debian/changelog17
-rw-r--r--debian/control2
-rw-r--r--debian/initramfs/script.local-top2
-rw-r--r--debian/patches/Fix-gcc-4.4-compiler-warning.patch139
-rw-r--r--debian/patches/Makefile-use-CC-more-consistently.patch36
-rw-r--r--debian/patches/series2
-rw-r--r--debian/presubj17
-rwxr-xr-xdebian/rules1
9 files changed, 296 insertions, 10 deletions
diff --git a/debian/bugscript b/debian/bugscript
index 4fb920c2..5ebb2f14 100755
--- a/debian/bugscript
+++ b/debian/bugscript
@@ -28,6 +28,56 @@ if ! command -v yesno >/dev/null; then
exec 3>&1
fi
+# do not let people ctrl-c out of the bugscript
+trap : INT
+
+if [ $(id -u) != 0 ]; then
+ if [ -x "$(command -v sudo)" ]; then
+ yesno "Gather system information as root using sudo? (Y/n) " yep
+ if [ "$REPLY" = yep ]; then
+ echo running sudo "$0" "$@"...
+ sudo "$0" "$@" && exit 0
+ echo "sudo invocation failed, trying /bin/su..."
+ fi
+ fi
+
+ yesno "Gather system information as root using su? (Y/n) " yep
+ if [ "$REPLY" = yep ]; then
+ ARGS=
+ for i in "$@"; do ARGS="${ARGS:+$ARGS }'$1'"; shift; done
+ echo "running su root -s '/bin/sh -c $0 $ARGS'..."
+ su root -s /bin/sh -c "$0 $ARGS" && exit 0
+ unset ARGS
+ echo "su invocation failed."
+ fi
+
+ # arrive here only if neither sudo nor su worked:
+ yesno "Will you provide system information in the bug report yourself? (N/y) " nop
+ if [ "$REPLY" = yep ]; then
+ cat <<_eof >&3
+
+IMPORTANT:
+ please do not forget to include all relevant system information with this
+ bug report. You could run
+ /usr/share/bug/mdadm/script 3>&1
+ as root and attach or include the output.
+
+_eof
+ exit 0
+ fi
+
+ # try our best
+ cat <<_eof >&3
+
+WARNING:
+ the following output was not generated by the root user. If you can, please
+ replace the following up until "-- System Information:" with the output of
+ /usr/share/bug/mdadm/script 3>&1
+ run as root. Thanks!
+
+_eof
+fi
+
if [ ! -r /proc/mdstat ]; then
echo "The local system does not have MD (RAID) support: no drivers loaded."
echo "Without MD support, I cannot collect as much information as I'd like."
@@ -59,7 +109,14 @@ echo >&3
echo "--- initrd.img-$(uname -r):" >&3
if [ -r /boot/initrd.img-$(uname -r) ]; then
- zcat /boot/initrd.img-$(uname -r) 2>&3 | cpio -t 2>&3 | egrep '/md[a/]' >&3
+ TEMPDIR=$(mktemp -d)
+ OLDPWD="$PWD"
+ cd "$TEMPDIR"
+ zcat /boot/initrd.img-$(uname -r) 2>&3 | cpio -i 2>&3
+ find -regex '.*/md[a/].+' -type f -exec md5sum {} \; >&3
+ cd "$OLDPWD"
+ rm -rf "$TEMPDIR"
+ unset TEMPDIR
fi
echo >&3
@@ -69,14 +126,21 @@ if [ -r /proc/modules ]; then
echo >&3
fi
-if [ -r /var/log/syslog ]; then
- echo "--- /var/log/syslog:" >&3
- egrep "^\w{3} [ :[:digit:]]{11} ($(hostname)|localhost) (kernel: md|mdadm): " /var/log/syslog >&3 || :
- echo >&3
+if [ -f /var/log/syslog ]; then
+ if [ -r /var/log/syslog ]; then
+ echo "--- /var/log/syslog:" >&3
+ egrep "^\w{3} [ :[:digit:]]{11} ($(hostname)|localhost) (kernel: md|mdadm): " /var/log/syslog >&3 || :
+ echo >&3
+ else
+ echo "syslog not readable by user." >&3
+ fi
fi
echo "--- volume detail:" >&3
-for dev in /dev/[hs]d[a-z]*; do mdadm -E $dev 2>/dev/null && echo -- || :; done >&3
+for dev in /dev/[hsv]d[a-z]*; do
+ [ ! -r $dev ] && echo "$dev not readable by user." && continue
+ mdadm -E $dev 2>/dev/null && echo -- || echo "$dev is not recognised by mdadm."
+done >&3
echo >&3
if [ -r /proc/cmdline ]; then
@@ -85,10 +149,20 @@ if [ -r /proc/cmdline ]; then
echo >&3
fi
+if [ -f /boot/grub/grub.cfg ]; then
+ echo "--- grub2:" >&3
+ if [ -r /boot/grub/grub.cfg ]; then
+ egrep '^[^#].*\<(root=|raid)' /boot/grub/grub.cfg >&3 || :
+ else
+ echo grub.cfg file not readable. >&3
+ fi
+ echo >&3
+fi
+
if [ -f /boot/grub/menu.lst ]; then
- echo "--- grub:" >&3
+ echo "--- grub legacy:" >&3
if [ -r /boot/grub/menu.lst ]; then
- grep '^[^#].*root=' /boot/grub/menu.lst >&3 || :
+ grep '^[^#].*\<root=' /boot/grub/menu.lst >&3 || :
else
echo menu.lst file not readable. >&3
fi
diff --git a/debian/changelog b/debian/changelog
index 6d74cb70..0c70c1ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,21 @@ mdadm (3.0~devel3-43-g2800528-1) experimental; urgency=low
-- martin f. krafft <madduck@debian.org> Tue, 05 May 2009 12:02:03 +0200
+mdadm (2.6.9-3) unstable; urgency=low
+
+ * Fix the multipath prereq patch (#516605) and make it exit after printing
+ the prerequisites (closes: #526793).
+ * Change my previous recommendation for postfix over to the new virtual
+ package default-mta (see #522300 and #508644).
+ * Enhance bugscript, which now asks to run as root (sudo/su) if invoked by
+ a normal user.
+ * Include MD5 sums of md-related files in initrd in bug reports.
+ * Add grub2 information retrieval to bugscript.
+ * Trap SIGINT and thus prevent ctrl-c from terminating the bugscript
+ prematurely.
+
+ -- martin f. krafft <madduck@debian.org> Tue, 05 May 2009 11:46:22 +0200
+
mdadm (3.0~devel3-1) experimental; urgency=low
* Initial release of DEVELOPMENT BRANCH 3.0 to experimental.
@@ -20,6 +35,8 @@ mdadm (2.6.9-2) unstable; urgency=low
bouncing.
* Prepare mdadm source to use quilt, with the long-term goal to switch to
TopGit, once I find the time.
+ * Cherry-pick caa0f6c & 667e66d from Neil into a quilt patch to fix gcc-4.4
+ compiler issues (closes: #505375).
-- martin f. krafft <madduck@debian.org> Sun, 26 Apr 2009 16:08:28 +0200
diff --git a/debian/control b/debian/control
index 6eccc184..501b7cbd 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Homepage: http://neil.brown.name/blog/mdadm
Package: mdadm
Architecture: any
Depends: ${shlibs:Depends}, udev | makedev, ${misc:Depends}, lsb-base (>= 3.1-6), debconf (>= 1.4.72)
-Recommends: postfix | mail-transport-agent, module-init-tools
+Recommends: default-mta | mail-transport-agent, module-init-tools
Replaces: mdctl
Conflicts: mdctl (<< 0.7.2), raidtools2 (<< 1.00.3-12.1), initramfs-tools (<< 0.65)
Description: tool to administer Linux MD arrays (software RAID)
diff --git a/debian/initramfs/script.local-top b/debian/initramfs/script.local-top
index 0d314ee2..226bb761 100644
--- a/debian/initramfs/script.local-top
+++ b/debian/initramfs/script.local-top
@@ -7,7 +7,7 @@
set -eu
case ${1:-} in
- prereqs) echo "multipath";;
+ prereqs) echo "multipath"; exit 0;;
esac
. /scripts/functions
diff --git a/debian/patches/Fix-gcc-4.4-compiler-warning.patch b/debian/patches/Fix-gcc-4.4-compiler-warning.patch
new file mode 100644
index 00000000..d13881e6
--- /dev/null
+++ b/debian/patches/Fix-gcc-4.4-compiler-warning.patch
@@ -0,0 +1,139 @@
+From 5d6b7d85d4bb671bc31adc7cbfd0802f2c982a44 Mon Sep 17 00:00:00 2001
+From: Neil Brown <neilb@suse.de>
+Date: Mon, 27 Apr 2009 19:50:44 +1000
+Subject: [PATCH 1/2] 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 <neilb@suse.de>
+Signed-off-by: martin f. krafft <madduck@debian.org>
+---
+ Makefile | 2 +-
+ bitmap.c | 28 +++++++++++++++-------------
+ bitmap.h | 2 +-
+ super1.c | 19 +++++++------------
+ 4 files changed, 24 insertions(+), 27 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 24ad694..3fb9c78 100644
+--- a/Makefile
++++ b/Makefile
+@@ -114,7 +114,7 @@ mdadm.klibc : $(SRCS) mdadm.h
+ gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
+
+ mdadm.Os : $(SRCS) mdadm.h
+- gcc -o mdadm.Os $(CFLAGS) -DHAVE_STDINT_H -Os $(SRCS)
++ $(CC) -o mdadm.Os $(CFLAGS) -DHAVE_STDINT_H -Os $(SRCS)
+
+ mdadm.O2 : $(SRCS) mdadm.h
+ gcc -o mdadm.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 $(SRCS)
+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/bitmap.h b/bitmap.h
+index c8725a3..0228a15 100644
+--- a/bitmap.h
++++ b/bitmap.h
+@@ -146,7 +146,7 @@ enum bitmap_state {
+ typedef struct bitmap_super_s {
+ __u32 magic; /* 0 BITMAP_MAGIC */
+ __u32 version; /* 4 the bitmap major for now, could change... */
+- __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */
++ union {__u8 uuid[16]; __u32 uuid32[4]; }; /* 8 128 bit uuid - must match md device uuid */
+ __u64 events; /* 24 event counter for the bitmap (1)*/
+ __u64 events_cleared;/*32 event counter when last bit cleared (2) */
+ __u64 sync_size; /* 40 the size of the md device's sync range(3) */
+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.4
+
diff --git a/debian/patches/Makefile-use-CC-more-consistently.patch b/debian/patches/Makefile-use-CC-more-consistently.patch
new file mode 100644
index 00000000..56b74a51
--- /dev/null
+++ b/debian/patches/Makefile-use-CC-more-consistently.patch
@@ -0,0 +1,36 @@
+From d3f4d2be1c9e8c21cdc7cdc9e4c7c345258d9f1b Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Wed, 29 Apr 2009 11:21:08 +1000
+Subject: [PATCH 2/2] Makefile: use $(CC) more consistently.
+
+Explicitly calling 'gcc' in some rules makes it hard to test with
+other compilers.
+
+Signed-off-by: martin f. krafft <madduck@debian.org>
+---
+ Makefile | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3fb9c78..b89cd6f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -111,13 +111,13 @@ mdadm.tcc : $(SRCS) mdadm.h
+
+ mdadm.klibc : $(SRCS) mdadm.h
+ rm -f $(OBJS)
+- gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
++ $(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
+
+ mdadm.Os : $(SRCS) mdadm.h
+ $(CC) -o mdadm.Os $(CFLAGS) -DHAVE_STDINT_H -Os $(SRCS)
+
+ mdadm.O2 : $(SRCS) mdadm.h
+- gcc -o mdadm.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 $(SRCS)
++ $(CC) -o mdadm.O2 $(CFLAGS) -DHAVE_STDINT_H -O2 $(SRCS)
+
+ test_stripe : restripe.c mdadm.h
+ $(CC) $(CXFLAGS) $(LDFLAGS) -o test_stripe -DMAIN restripe.c
+--
+1.6.2.4
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000..6f4b6d73
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+Fix-gcc-4.4-compiler-warning.patch -p1
+Makefile-use-CC-more-consistently.patch -p1
diff --git a/debian/presubj b/debian/presubj
new file mode 100644
index 00000000..9eb304fb
--- /dev/null
+++ b/debian/presubj
@@ -0,0 +1,17 @@
+Gathering information relevant to mdadm as root
+===============================================
+
+If you are not reporting bugs as root (which you should not), you will be
+prompted to give permission to run a script to collect relevant information
+from your system as the root user. Only the root user has access to some
+information that might be relevant to the bug report you are about to file.
+
+
+** Please give permission to run the script as root when asked momentarily.
+
+
+If you would rather obtain the same information manually, you can run
+ /usr/share/bug/mdadm/script 3>&1
+as root and include or attach the output.
+
+ -- martin f. krafft <madduck@debian.org> Tue, 05 May 2009 11:26:32 +0200
diff --git a/debian/rules b/debian/rules
index 67aacda6..81ed63e0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -74,6 +74,7 @@ install: build
install -m0755 debian/mkconf $(DESTDIR)/usr/share/mdadm
install -m0755 debian/checkarray $(DESTDIR)/usr/share/mdadm
install -m0755 debian/bugscript $(DESTDIR)/usr/share/bug/mdadm/script
+ install -m0544 debian/presubj $(DESTDIR)/usr/share/bug/mdadm
install -m0755 debian/mdadm-startall $(DESTDIR)/sbin