From 73c5df56d58fe79f69189eebf3e66d45e219027b5dad68f90c69ad1bfcb9b7d3 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 7 Jul 2014 01:53:50 +0000 Subject: [PATCH 1/3] - Remove mkinitrd scripts again. "libguestfs" now includes them so "guestfs" does not need us to. (bnc#883873) OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=115 --- mdadm.changes | 7 +++ mdadm.spec | 9 ---- mkinitrd-boot.sh | 32 ------------- mkinitrd-setup.sh | 120 ---------------------------------------------- 4 files changed, 7 insertions(+), 161 deletions(-) delete mode 100644 mkinitrd-boot.sh delete mode 100644 mkinitrd-setup.sh diff --git a/mdadm.changes b/mdadm.changes index d2b3a47..d0b8c24 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jul 7 01:52:35 UTC 2014 - nfbrown@suse.com + +- Remove mkinitrd scripts again. "libguestfs" now + includes them so "guestfs" does not need us to. + (bnc#883873) + ------------------------------------------------------------------- Thu Jun 26 03:08:15 UTC 2014 - nfbrown@suse.com diff --git a/mdadm.spec b/mdadm.spec index 7e64c80..dab8ff5 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -37,8 +37,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm -Source5: mkinitrd-setup.sh -Source6: mkinitrd-boot.sh Source7: mdadm.cron # PATCH-FIX-UPSTREAM 0001-Makefile-install-mdadm-grow-continue-.service.patch nfbrown@suse.de Patch1: 0001-Makefile-install-mdadm-grow-continue-.service.patch @@ -69,9 +67,6 @@ make install install-systemd install-udev DESTDIR=%{buildroot} SYSTEMD_DIR=%{_un rm -rf %{buildroot}/lib/udev install -d %{buildroot}%{_var}/adm/fillup-templates install -d %{buildroot}{%{_sbindir} -install -d %{buildroot}/lib/mkinitrd/scripts -install -m 755 %{S:5} %{buildroot}/lib/mkinitrd/scripts/setup-md.sh -install -m 755 %{S:6} %{buildroot}/lib/mkinitrd/scripts/boot-md.sh install -d %{buildroot}/etc/cron.daily install -m 755 %{S:7} %{buildroot}/etc/cron.daily/mdadm install -m 644 %{S:2} %{buildroot}%{_var}/adm/fillup-templates/ @@ -98,10 +93,6 @@ rm -rf %{buildroot} %doc %{_mandir}/man?/* /sbin/* %{_var}/adm/fillup-templates/sysconfig.mdadm -%dir /lib/mkinitrd -%dir /lib/mkinitrd/scripts -/lib/mkinitrd/scripts/setup-md.sh -/lib/mkinitrd/scripts/boot-md.sh %{_udevdir}/rules.d/63-md-raid-arrays.rules %{_udevdir}/rules.d/64-md-raid-assembly.rules %dir /etc/cron.daily diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh deleted file mode 100644 index b9e9d66..0000000 --- a/mkinitrd-boot.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -#%stage: boot -#%depends: start -#%programs: /sbin/mdadm /sbin/mdmon -#%modules: raid0 raid1 raid10 raid456 -#%if: -n "$need_mdadm" -# -##### MD (Software-)Raid -## -## This only sets the 'start_ro' module parameter to ensure -## arrays don't start resync until after the first write. -## All array assembly is performed by udev -> "mdadm -I" -## -## Command line parameters -## ----------------------- -## -## need_mdadm=1 use MD raid -## - -# load the necessary module before we initialize the raid system -load_modules - -#check_for_device uses $md_major -#we depend on 'start' to ensure /proc/devices exists -md_major=$(sed -ne 's/\s*\([0-9]\+\)\s*md$/\1/p' /proc/devices) - -# Always start md devices read/only. They will get set to rw as soon -# as the first write occurs. This way we can guarantee that no -# restore occurs before resume. -if [ -f /sys/module/md_mod/parameters/start_ro ]; then - echo 1 > /sys/module/md_mod/parameters/start_ro -fi diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh deleted file mode 100644 index 68e3d71..0000000 --- a/mkinitrd-setup.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# -#%stage: softraid -# -mdblockdev= - -# Full mdadm.conf generated by mdadm. -# Contains all created MD RAIDs -mdadm_conf= - -cont_list= -md_devs= - -declare -A md_conf -# blockdev contains real devices (/dev/X) for root, resume, journal, dumb -for bd in $blockdev ; do - is_part_dev=false - case $bd in - /dev/md[_0-9]*p[0-9]* ) - # Partitionable MD RAID. This is partition on RAID. Get the RAID - bd=${bd%%p[0-9]*} - is_part_dev=true - ;; - /dev/md[0-9_]*) - ;; - *) - mdblockdev="$mdblockdev $bd" - continue - ;; - esac - # Check if this device is already added (possible for partitionable). - md_dev=`mdadm -D --export $bd | sed -n -e 's/^MD_DEVNAME=//p'` - if [ -z "$md_dev" ]; then - md_dev=${bd##/dev/} - else - bd="/dev/md/$md_dev" - fi - dup_found=false - for dup in $md_devs; do - if [ x"$dup" = x"$md_dev" ]; then - dup_found=true - break - fi - done - if $dup_found; then - if ! $is_part_dev; then - echo "setup-md.sh: $md_dev found multiple times" >&2 - fi - continue - fi - mdconf=$(mdadm -Db "$bd") - if test -z "$mdconf"; then - mdblockdev="$mdblockdev $bd" - continue - fi - md_tmpblockdev=$(mdadm -Dbv $bd | sed -n "1D;s/,/ /g;s/^ *devices=//p") - mdblockdev="$mdblockdev $md_tmpblockdev" - md_devs="$md_devs $md_dev" - container=$(echo "$mdconf" | sed -rn 's/.* container=([^ ]*) .*/\1/p') - for cnt in $cont_list; do - if [ x"$container" = x"$cnt" ]; then - container= - break - fi - done - case "$container" in - "") - ;; - /dev/*) - mdconf="$(mdadm -Db "$container")\\n$mdconf" - cont_list="$cont_list $container" - ;; - [0-9a-f]*[0-9a-f]) - if test -z "$mdadm_conf"; then - mdadm_conf=$(mdadm --examine --brief --scan) - fi - mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf" - cont_list="$cont_list $container" - ;; - *) - echo "unrecognized container for $md_dev: $container" - ;; - esac - # If /etc/mdadm.conf contains a different name for this - # array, then use that. - md_uuid=`echo $mdconf | sed -n -e 's/.* UUID=\([0-9a-f:]*\).*/\1/p'` - if [ -f /etc/mdadm.conf -a -n "$md_uuid" ]; then - md_devname=`sed -n -e 's,^ARRAY */dev/\([^ ]*\) .*[Uu][Uu][Ii][Dd]='$md_uuid'.*,\1,p' /etc/mdadm.conf` - if [ -n "$md_devname" ]; then - mdconf=`echo $mdconf | sed -e 's,^ARRAY /dev/\([^ ]*\),ARRAY /dev/'$md_devname','` - fi - fi - md_conf["$md_dev"]="$mdconf" - root_md=1 -done - -# Any 'md' device is replaced by it's component disks. -blockdev="$mdblockdev" - -if [ -n "$root_md" ] ; then - need_mdadm=1 - echo "AUTO -all" > $tmp_mnt/etc/mdadm.conf - for md in $md_devs; do - echo -e "${md_conf["$md"]}" >> $tmp_mnt/etc/mdadm.conf - done -fi - -if [ "x$need_mdadm" = "x1" ] ; then - for rule in \ - 63-md-raid-arrays.rules \ - 64-md-raid-assembly.rules; do - if [ -f /usr/lib/udev/rules.d/$rule ]; then - cp /usr/lib/udev/rules.d/$rule $tmp_mnt/usr/lib/udev/rules.d - elif [ -f /lib/udev/rules.d/$rule ]; then - cp /lib/udev/rules.d/$rule $tmp_mnt/lib/udev/rules.d - fi - done -fi - -save_var need_mdadm From 0accd6ce3180cf957934e02235c465ab7cb0702a451e3ca3895f220eb7a5332f Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Sat, 12 Jul 2014 15:14:20 +0000 Subject: [PATCH 2/3] Updating link to change in openSUSE:Factory/mdadm revision 92.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=4a1fbabd751d27bf803b138c748e7616 --- mdadm.spec | 9 ++++ mkinitrd-boot.sh | 32 +++++++++++++ mkinitrd-setup.sh | 120 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 mkinitrd-boot.sh create mode 100644 mkinitrd-setup.sh diff --git a/mdadm.spec b/mdadm.spec index dab8ff5..7e64c80 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -37,6 +37,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm +Source5: mkinitrd-setup.sh +Source6: mkinitrd-boot.sh Source7: mdadm.cron # PATCH-FIX-UPSTREAM 0001-Makefile-install-mdadm-grow-continue-.service.patch nfbrown@suse.de Patch1: 0001-Makefile-install-mdadm-grow-continue-.service.patch @@ -67,6 +69,9 @@ make install install-systemd install-udev DESTDIR=%{buildroot} SYSTEMD_DIR=%{_un rm -rf %{buildroot}/lib/udev install -d %{buildroot}%{_var}/adm/fillup-templates install -d %{buildroot}{%{_sbindir} +install -d %{buildroot}/lib/mkinitrd/scripts +install -m 755 %{S:5} %{buildroot}/lib/mkinitrd/scripts/setup-md.sh +install -m 755 %{S:6} %{buildroot}/lib/mkinitrd/scripts/boot-md.sh install -d %{buildroot}/etc/cron.daily install -m 755 %{S:7} %{buildroot}/etc/cron.daily/mdadm install -m 644 %{S:2} %{buildroot}%{_var}/adm/fillup-templates/ @@ -93,6 +98,10 @@ rm -rf %{buildroot} %doc %{_mandir}/man?/* /sbin/* %{_var}/adm/fillup-templates/sysconfig.mdadm +%dir /lib/mkinitrd +%dir /lib/mkinitrd/scripts +/lib/mkinitrd/scripts/setup-md.sh +/lib/mkinitrd/scripts/boot-md.sh %{_udevdir}/rules.d/63-md-raid-arrays.rules %{_udevdir}/rules.d/64-md-raid-assembly.rules %dir /etc/cron.daily diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh new file mode 100644 index 0000000..b9e9d66 --- /dev/null +++ b/mkinitrd-boot.sh @@ -0,0 +1,32 @@ +#!/bin/bash +#%stage: boot +#%depends: start +#%programs: /sbin/mdadm /sbin/mdmon +#%modules: raid0 raid1 raid10 raid456 +#%if: -n "$need_mdadm" +# +##### MD (Software-)Raid +## +## This only sets the 'start_ro' module parameter to ensure +## arrays don't start resync until after the first write. +## All array assembly is performed by udev -> "mdadm -I" +## +## Command line parameters +## ----------------------- +## +## need_mdadm=1 use MD raid +## + +# load the necessary module before we initialize the raid system +load_modules + +#check_for_device uses $md_major +#we depend on 'start' to ensure /proc/devices exists +md_major=$(sed -ne 's/\s*\([0-9]\+\)\s*md$/\1/p' /proc/devices) + +# Always start md devices read/only. They will get set to rw as soon +# as the first write occurs. This way we can guarantee that no +# restore occurs before resume. +if [ -f /sys/module/md_mod/parameters/start_ro ]; then + echo 1 > /sys/module/md_mod/parameters/start_ro +fi diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh new file mode 100644 index 0000000..68e3d71 --- /dev/null +++ b/mkinitrd-setup.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# +#%stage: softraid +# +mdblockdev= + +# Full mdadm.conf generated by mdadm. +# Contains all created MD RAIDs +mdadm_conf= + +cont_list= +md_devs= + +declare -A md_conf +# blockdev contains real devices (/dev/X) for root, resume, journal, dumb +for bd in $blockdev ; do + is_part_dev=false + case $bd in + /dev/md[_0-9]*p[0-9]* ) + # Partitionable MD RAID. This is partition on RAID. Get the RAID + bd=${bd%%p[0-9]*} + is_part_dev=true + ;; + /dev/md[0-9_]*) + ;; + *) + mdblockdev="$mdblockdev $bd" + continue + ;; + esac + # Check if this device is already added (possible for partitionable). + md_dev=`mdadm -D --export $bd | sed -n -e 's/^MD_DEVNAME=//p'` + if [ -z "$md_dev" ]; then + md_dev=${bd##/dev/} + else + bd="/dev/md/$md_dev" + fi + dup_found=false + for dup in $md_devs; do + if [ x"$dup" = x"$md_dev" ]; then + dup_found=true + break + fi + done + if $dup_found; then + if ! $is_part_dev; then + echo "setup-md.sh: $md_dev found multiple times" >&2 + fi + continue + fi + mdconf=$(mdadm -Db "$bd") + if test -z "$mdconf"; then + mdblockdev="$mdblockdev $bd" + continue + fi + md_tmpblockdev=$(mdadm -Dbv $bd | sed -n "1D;s/,/ /g;s/^ *devices=//p") + mdblockdev="$mdblockdev $md_tmpblockdev" + md_devs="$md_devs $md_dev" + container=$(echo "$mdconf" | sed -rn 's/.* container=([^ ]*) .*/\1/p') + for cnt in $cont_list; do + if [ x"$container" = x"$cnt" ]; then + container= + break + fi + done + case "$container" in + "") + ;; + /dev/*) + mdconf="$(mdadm -Db "$container")\\n$mdconf" + cont_list="$cont_list $container" + ;; + [0-9a-f]*[0-9a-f]) + if test -z "$mdadm_conf"; then + mdadm_conf=$(mdadm --examine --brief --scan) + fi + mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf" + cont_list="$cont_list $container" + ;; + *) + echo "unrecognized container for $md_dev: $container" + ;; + esac + # If /etc/mdadm.conf contains a different name for this + # array, then use that. + md_uuid=`echo $mdconf | sed -n -e 's/.* UUID=\([0-9a-f:]*\).*/\1/p'` + if [ -f /etc/mdadm.conf -a -n "$md_uuid" ]; then + md_devname=`sed -n -e 's,^ARRAY */dev/\([^ ]*\) .*[Uu][Uu][Ii][Dd]='$md_uuid'.*,\1,p' /etc/mdadm.conf` + if [ -n "$md_devname" ]; then + mdconf=`echo $mdconf | sed -e 's,^ARRAY /dev/\([^ ]*\),ARRAY /dev/'$md_devname','` + fi + fi + md_conf["$md_dev"]="$mdconf" + root_md=1 +done + +# Any 'md' device is replaced by it's component disks. +blockdev="$mdblockdev" + +if [ -n "$root_md" ] ; then + need_mdadm=1 + echo "AUTO -all" > $tmp_mnt/etc/mdadm.conf + for md in $md_devs; do + echo -e "${md_conf["$md"]}" >> $tmp_mnt/etc/mdadm.conf + done +fi + +if [ "x$need_mdadm" = "x1" ] ; then + for rule in \ + 63-md-raid-arrays.rules \ + 64-md-raid-assembly.rules; do + if [ -f /usr/lib/udev/rules.d/$rule ]; then + cp /usr/lib/udev/rules.d/$rule $tmp_mnt/usr/lib/udev/rules.d + elif [ -f /lib/udev/rules.d/$rule ]; then + cp /lib/udev/rules.d/$rule $tmp_mnt/lib/udev/rules.d + fi + done +fi + +save_var need_mdadm From 18396eb7117a0d34f78f41491b58e853d831a37443eabcffb2dc72b91ab8e718 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Sat, 12 Jul 2014 15:14:20 +0000 Subject: [PATCH 3/3] Accepting request 239413 from Base:System baserev update by copy to link target OBS-URL: https://build.opensuse.org/request/show/239413 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=116 --- mdadm.spec | 9 ---- mkinitrd-boot.sh | 32 ------------- mkinitrd-setup.sh | 120 ---------------------------------------------- 3 files changed, 161 deletions(-) delete mode 100644 mkinitrd-boot.sh delete mode 100644 mkinitrd-setup.sh diff --git a/mdadm.spec b/mdadm.spec index 7e64c80..dab8ff5 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -37,8 +37,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm -Source5: mkinitrd-setup.sh -Source6: mkinitrd-boot.sh Source7: mdadm.cron # PATCH-FIX-UPSTREAM 0001-Makefile-install-mdadm-grow-continue-.service.patch nfbrown@suse.de Patch1: 0001-Makefile-install-mdadm-grow-continue-.service.patch @@ -69,9 +67,6 @@ make install install-systemd install-udev DESTDIR=%{buildroot} SYSTEMD_DIR=%{_un rm -rf %{buildroot}/lib/udev install -d %{buildroot}%{_var}/adm/fillup-templates install -d %{buildroot}{%{_sbindir} -install -d %{buildroot}/lib/mkinitrd/scripts -install -m 755 %{S:5} %{buildroot}/lib/mkinitrd/scripts/setup-md.sh -install -m 755 %{S:6} %{buildroot}/lib/mkinitrd/scripts/boot-md.sh install -d %{buildroot}/etc/cron.daily install -m 755 %{S:7} %{buildroot}/etc/cron.daily/mdadm install -m 644 %{S:2} %{buildroot}%{_var}/adm/fillup-templates/ @@ -98,10 +93,6 @@ rm -rf %{buildroot} %doc %{_mandir}/man?/* /sbin/* %{_var}/adm/fillup-templates/sysconfig.mdadm -%dir /lib/mkinitrd -%dir /lib/mkinitrd/scripts -/lib/mkinitrd/scripts/setup-md.sh -/lib/mkinitrd/scripts/boot-md.sh %{_udevdir}/rules.d/63-md-raid-arrays.rules %{_udevdir}/rules.d/64-md-raid-assembly.rules %dir /etc/cron.daily diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh deleted file mode 100644 index b9e9d66..0000000 --- a/mkinitrd-boot.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -#%stage: boot -#%depends: start -#%programs: /sbin/mdadm /sbin/mdmon -#%modules: raid0 raid1 raid10 raid456 -#%if: -n "$need_mdadm" -# -##### MD (Software-)Raid -## -## This only sets the 'start_ro' module parameter to ensure -## arrays don't start resync until after the first write. -## All array assembly is performed by udev -> "mdadm -I" -## -## Command line parameters -## ----------------------- -## -## need_mdadm=1 use MD raid -## - -# load the necessary module before we initialize the raid system -load_modules - -#check_for_device uses $md_major -#we depend on 'start' to ensure /proc/devices exists -md_major=$(sed -ne 's/\s*\([0-9]\+\)\s*md$/\1/p' /proc/devices) - -# Always start md devices read/only. They will get set to rw as soon -# as the first write occurs. This way we can guarantee that no -# restore occurs before resume. -if [ -f /sys/module/md_mod/parameters/start_ro ]; then - echo 1 > /sys/module/md_mod/parameters/start_ro -fi diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh deleted file mode 100644 index 68e3d71..0000000 --- a/mkinitrd-setup.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/bash -# -#%stage: softraid -# -mdblockdev= - -# Full mdadm.conf generated by mdadm. -# Contains all created MD RAIDs -mdadm_conf= - -cont_list= -md_devs= - -declare -A md_conf -# blockdev contains real devices (/dev/X) for root, resume, journal, dumb -for bd in $blockdev ; do - is_part_dev=false - case $bd in - /dev/md[_0-9]*p[0-9]* ) - # Partitionable MD RAID. This is partition on RAID. Get the RAID - bd=${bd%%p[0-9]*} - is_part_dev=true - ;; - /dev/md[0-9_]*) - ;; - *) - mdblockdev="$mdblockdev $bd" - continue - ;; - esac - # Check if this device is already added (possible for partitionable). - md_dev=`mdadm -D --export $bd | sed -n -e 's/^MD_DEVNAME=//p'` - if [ -z "$md_dev" ]; then - md_dev=${bd##/dev/} - else - bd="/dev/md/$md_dev" - fi - dup_found=false - for dup in $md_devs; do - if [ x"$dup" = x"$md_dev" ]; then - dup_found=true - break - fi - done - if $dup_found; then - if ! $is_part_dev; then - echo "setup-md.sh: $md_dev found multiple times" >&2 - fi - continue - fi - mdconf=$(mdadm -Db "$bd") - if test -z "$mdconf"; then - mdblockdev="$mdblockdev $bd" - continue - fi - md_tmpblockdev=$(mdadm -Dbv $bd | sed -n "1D;s/,/ /g;s/^ *devices=//p") - mdblockdev="$mdblockdev $md_tmpblockdev" - md_devs="$md_devs $md_dev" - container=$(echo "$mdconf" | sed -rn 's/.* container=([^ ]*) .*/\1/p') - for cnt in $cont_list; do - if [ x"$container" = x"$cnt" ]; then - container= - break - fi - done - case "$container" in - "") - ;; - /dev/*) - mdconf="$(mdadm -Db "$container")\\n$mdconf" - cont_list="$cont_list $container" - ;; - [0-9a-f]*[0-9a-f]) - if test -z "$mdadm_conf"; then - mdadm_conf=$(mdadm --examine --brief --scan) - fi - mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf" - cont_list="$cont_list $container" - ;; - *) - echo "unrecognized container for $md_dev: $container" - ;; - esac - # If /etc/mdadm.conf contains a different name for this - # array, then use that. - md_uuid=`echo $mdconf | sed -n -e 's/.* UUID=\([0-9a-f:]*\).*/\1/p'` - if [ -f /etc/mdadm.conf -a -n "$md_uuid" ]; then - md_devname=`sed -n -e 's,^ARRAY */dev/\([^ ]*\) .*[Uu][Uu][Ii][Dd]='$md_uuid'.*,\1,p' /etc/mdadm.conf` - if [ -n "$md_devname" ]; then - mdconf=`echo $mdconf | sed -e 's,^ARRAY /dev/\([^ ]*\),ARRAY /dev/'$md_devname','` - fi - fi - md_conf["$md_dev"]="$mdconf" - root_md=1 -done - -# Any 'md' device is replaced by it's component disks. -blockdev="$mdblockdev" - -if [ -n "$root_md" ] ; then - need_mdadm=1 - echo "AUTO -all" > $tmp_mnt/etc/mdadm.conf - for md in $md_devs; do - echo -e "${md_conf["$md"]}" >> $tmp_mnt/etc/mdadm.conf - done -fi - -if [ "x$need_mdadm" = "x1" ] ; then - for rule in \ - 63-md-raid-arrays.rules \ - 64-md-raid-assembly.rules; do - if [ -f /usr/lib/udev/rules.d/$rule ]; then - cp /usr/lib/udev/rules.d/$rule $tmp_mnt/usr/lib/udev/rules.d - elif [ -f /lib/udev/rules.d/$rule ]; then - cp /lib/udev/rules.d/$rule $tmp_mnt/lib/udev/rules.d - fi - done -fi - -save_var need_mdadm