summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authormadduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464>2006-09-13 11:21:20 +0000
committermadduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464>2006-09-13 11:21:20 +0000
commit1262406a697fd9f6ebbd24116c2052e116944084 (patch)
tree1d30adfd4c1240519a9102d7b7782b90ed63253d /debian
parent9c3eb72e73ff5d978e3bf84632638b56a7aa0904 (diff)
* If mdadm is being configured in a chroot, it now defaults to starting all
arrays from the initial ramdisk, rather than trying to figure out the root MD array (we're using /proc information, so it would be the one of the host, not the one of the chroot) (closes: #386468).
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog4
-rw-r--r--debian/mdadm.config30
2 files changed, 25 insertions, 9 deletions
diff --git a/debian/changelog b/debian/changelog
index ed17a767..6802f76d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,10 @@ mdadm (2.5.3.git200608202239-3) unstable; urgency=medium
* Added bootloader/cmdline info to bugscript so that future bug reports via
bug/reportbug include information on how the system is booted with respect
to RAID (the root partition).
+ * If mdadm is being configured in a chroot, it now defaults to starting all
+ arrays from the initial ramdisk, rather than trying to figure out the root
+ MD array (we're using /proc information, so it would be the one of the
+ host, not the one of the chroot) (closes: #386468).
* Added LSB headers to init scripts.
* Reworked the documentation with respect to the use of "MD" and "RAID", and
added a FAQ entry on the meaning of "MD". Thanks to Frans Pop for his
diff --git a/debian/mdadm.config b/debian/mdadm.config
index 6a59ef1d..9fdde4dc 100644
--- a/debian/mdadm.config
+++ b/debian/mdadm.config
@@ -50,19 +50,31 @@ if [ -s $DEBIANCONFIG ] ; then
[ -n "$MAILADDR" ] && db_set mdadm/mail_to "$MAILADDR"
fi
-db_fget mdadm/initrdstart seen
-if [ -z "$INITRDSTART" ] || [ "$RET $INITRDSTART" = "false all" ]; then
+chrooted() {
+ test ! -r /proc/1/root
+}
+
+get_root_raiddev() {
+ local rootraiddev;
rootraiddev="$(df / | sed -rne 's,^(/dev/[^[:space:]]+).*,\1,p')"
if ! mdadm --detail $rootraiddev >/dev/null 2>&1; then
- # you are using some funky setup. Let's be save...
- # (could also happen during preconfigure, when no mdadm present)
- INITRDSTART=all
- else
- # remove partition from partitionable array
- INITRDSTART="${rootraiddev%p[0-9]*}"
+ return 1
fi
-fi
+ echo ${rootraiddev%p[0-9]*}
+ return 0
+}
+
+get_initrdstart() {
+ db_fget mdadm/initrdstart seen
+ if chrooted || [ "$RET $INITRDSTART" = "false all" ]; then
+ echo all
+ return 1
+ fi
+
+ get_root_raiddev || echo all
+}
+[ -z "$INITRDSTART" ] && INITRDSTART="$(get_initrdstart)"
[ -n "$INITRDSTART" ] && db_set mdadm/initrdstart "$INITRDSTART"
db_capb escape