3
# mdadm bug submission control script
5
# allows Debian's bug tools to include relevant information in bug reports.
7
# Copyright © martin f. krafft <madduck@debian.org>
8
# distributed under the terms of the Artistic Licence 2.0
10
# we need /bin/bash for readline and -n capabalities in the prompt(s)
14
if ! command -v yesno >/dev/null; then
15
if [ -r /usr/share/reportbug/handle_bugscript ]; then
16
exec /usr/share/reportbug/handle_bugscript ". $0" /dev/stdout
29
if [ ! -r /proc/mdstat ]; then
30
echo "The local system does not have MD (RAID) support: no drivers loaded."
31
echo "Without MD support, I cannot collect as much information as I'd like."
33
#yesno "Are you sure you want to report a bug at this time? " yep
34
yesno "Hit any key to continue..." yep
35
#[ "$REPLY" = yep ] || exit 1
38
echo "--- mount output" >&3
42
echo "--- mdadm.conf" >&3
43
if [ -r /etc/mdadm/mdadm.conf ]; then
44
cat /etc/mdadm/mdadm.conf >&3
46
echo no mdadm.conf file. >&3
50
echo "--- /proc/mdstat:" >&3
51
cat /proc/mdstat >&3 2>&3 || :
54
echo "--- /proc/partitions:" >&3
55
cat /proc/partitions >&3 2>&3 || :
58
echo "--- initrd.img-$(uname -r):" >&3
59
if [ -r /boot/initrd.img-$(uname -r) ]; then
60
zcat /boot/initrd.img-$(uname -r) 2>&3 | cpio -t 2>&3 | egrep '/md[a/]' >&3
64
if [ -r /proc/modules ]; then
65
echo "--- /proc/modules:" >&3
66
egrep '(dm_|raid|linear|multipath|faulty)' < /proc/modules >&3 || :
70
if [ -r /var/log/syslog ]; then
71
echo "--- /var/log/syslog:" >&3
72
egrep "^\w{3} [ :[:digit:]]{11} ($(hostname)|localhost) (kernel: md|mdadm): " /var/log/syslog >&3 || :
76
echo "--- volume detail:" >&3
77
for dev in /dev/[hs]d[a-z]*; do mdadm -E $dev 2>/dev/null && echo -- || :; done >&3
80
if [ -r /proc/cmdline ]; then
81
echo "--- /proc/cmdline" >&3
86
if [ -f /boot/grub/menu.lst ]; then
88
if [ -r /boot/grub/menu.lst ]; then
89
grep '^[^#].*root=' /boot/grub/menu.lst >&3 || :
91
echo menu.lst file not readable. >&3
96
if [ -f /etc/lilo.conf ]; then
98
if [ -r /etc/lilo.conf ]; then
99
egrep '^([^#].*)?root=' /etc/lilo.conf >&3 || :
101
echo lilo.conf file not readable. >&3