summaryrefslogtreecommitdiff
path: root/debian/initramfs
diff options
context:
space:
mode:
authormartin f. krafft <madduck@debian.org>2010-01-29 18:01:01 +1300
committermartin f. krafft <madduck@debian.org>2010-01-29 18:49:55 +1300
commita82f419df02a4dacf4046cbee9dfb48ccbeaab11 (patch)
treead7daf9472533d51e1a9c16c3dbc819dd1fb16de /debian/initramfs
parent50715745e936ac937084ae390519bd5862ce2985 (diff)
check for running devices based on UUID
Signed-off-by: martin f. krafft <madduck@debian.org>
Diffstat (limited to 'debian/initramfs')
-rw-r--r--debian/initramfs/hook16
1 files changed, 9 insertions, 7 deletions
diff --git a/debian/initramfs/hook b/debian/initramfs/hook
index d4a62371..9b730551 100644
--- a/debian/initramfs/hook
+++ b/debian/initramfs/hook
@@ -226,13 +226,15 @@ if [ "$INITRDSTART" != none ] && [ -n "$devpairs" ]; then
esac
done
- # see if /etc/mdadm/mdadm.conf looks like it's missing devices
- $MDADM --detail --scan | while read array device rubbish; do
- if ! echo $devpairs | grep -qw $device; then
- warn "You appear to be missing $device from /etc/mdadm/mdadm.conf !"
- warn "If this array is required to boot, you must add the following line:"
- rubbish=`echo $rubbish | sed 's/metadata=[^ ]* //'`
- warn "$array $device $rubbish"
+ # make sure the configuration file knows about all running devices
+ $MDADM --detail --scan | while read array device params; do
+ uuid=${params#*UUID=}; uuid=${uuid%% *}
+ if ! grep -q "UUID=$uuid" $DESTMDADMCONF; then
+ warn "the array $device with UUID $uuid"
+ warn "is currently active, but it is not listed in mdadm.conf. if"
+ warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!"
+ warn "please inspect the output of /usr/share/mdadm/mkconf, compare"
+ warn "it to $CONFIG, and make the necessary changes."
fi
done