From 6ea43b2935c887a73e967ca49391703b46c81198 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sun, 29 Mar 2009 12:38:52 +0200 Subject: [PATCH] 'create correct mdp entry in /etc/mdadm.conf' --- usr/share/archboot/installer/setup | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/usr/share/archboot/installer/setup b/usr/share/archboot/installer/setup index abb1b4b2c..a18ebefad 100755 --- a/usr/share/archboot/installer/setup +++ b/usr/share/archboot/installer/setup @@ -1532,6 +1532,21 @@ ROOTFS="$(blkid -c /dev/null $PART_ROOT -o value -s TYPE)" getraidarrays() { if ! [ "$(grep ^ARRAY $DESTDIR/etc/mdadm.conf)" ]; then RAIDARRAYS="$(echo -n $(cat /proc/mdstat 2>/dev/null | grep ^md | sed -e 's#\[[0-9]\]##g' -e 's# :.* raid[0-9]##g' -e 's#md#md=#g' -e 's# #,/dev/#g' -e 's#_##g'))" + else + # create correct entry on raid partitions! + if [ "$(grep /dev/block $DESTDIR/etc/mdadm.conf)" ]; then + for i in $(grep /dev/block $DESTDIR/etc/mdadm.conf); do + #get uuid + k=$(sed -e 's#.*UUID=##g') + for l in $(cat /proc/mdstat 2>/dev/null | grep ^md | sed -e 's# .*##g'); do + if [ $(mdadm --detail $l | grep $k) ]; then + replace_string="$(grep $k $DESTDIR/etc/mdadm.conf)" + corrected_string="$(echo $replace_string | sed -e "s#/dev/block/.*\ #/dev/$l\ ##g")" + sed -i -e "s#$replace_string#$corrected_string##g" $DESTDIR/etc/mdadm.conf + fi + done + done + fi fi }