bootdisk: installer-raid-functions (HEAD) [malekith]
PLD CVS
pld-cvs-commit w pld.org.pl
Pon, 29 Lip 2002, 13:11:20 CEST
Module name: bootdisk
Changes by: malekith 02/07/29 13:11:17
Modified files:
installer-raid-functions
Log message:
- raidtools are braindamaged and cannot handle comments longer then
100 bytes; workaround it
Index: installer-raid-functions
===================================================================
RCS file: /cvsroot/bootdisk/batch-installer/installer-raid-functions,v
diff -d -u -r1.7 -r1.8
--- installer-raid-functions 2002/02/01 17:12:27 1.7
+++ installer-raid-functions 2002/07/29 11:11:17 1.8
@@ -125,8 +125,7 @@
log debug "writing raidtab normal=$dev_normal, spare=$dev_spare"
- mdctl_opt="--create /dev/md${md_dev} --chunk=${chunk_size} "
- mdctl_opt="$mdctl_opt --level=${raid_lev} --raid-disks=${nr_normal}"
+ mdctl_opt=""
if [ $nr_spare != 0 ] ; then
mdctl_opt="$mdctl_opt --spare-disks=$nr_spare"
fi
@@ -134,9 +133,20 @@
mdctl_opt="$mdctl_opt --parity=$(echo ${parity_algorithm} | sed -e 's/-/_/')"
fi
- cat >> /tmp/raidtab <<EOF
+ # we have to split MDCTL*: stuff since raidtools are braindamaged
+ # and cannot handle comments longer then 100 characters
+ cat >> /tmp/raidtab <<EOF
# created from dest_part${id}:
-# MDCTL$md_dev: mdctl $mdctl_opt --run $dev_normal $dev_spare
+# MDCTL$md_dev: mdctl --create /dev/md${md_dev} --chunk=${chunk_size}
+# MDCTL$md_dev: --level=${raid_lev} --raid-disks=${nr_normal}
+# MDCTL$md_dev: $mdctl_opt
+# MDCTL$md_dev: --run
+EOF
+ for f in $dev_normal $dev_spare ; do
+ echo "# MDCTL$md_dev: $f" >> /tmp/raidtab
+ done
+
+ cat >> /tmp/raidtab <<EOF
raiddev /dev/md${md_dev}
raid-level ${raid_lev}
persistent-superblock ${persistent_superblock}
@@ -224,8 +234,8 @@
log info "$(nls "Creating RAID device /dev/md%s" $minor)"
if test "x$dry_run" = "xno"; then
if [ $mdctl = yes ] ; then
- log_wrap `grep MDCTL$minor: /tmp/raidtab | \
- sed -e "s/. MDCTL$minor://"`
+ log_wrap $(echo $(grep MDCTL$minor: /tmp/raidtab | \
+ sed -e "s/. MDCTL$minor://"))
else
log_wrap mkraid --force --configfile /tmp/raidtab /dev/md$minor
fi
Więcej informacji o liście dyskusyjnej pld-installer