[arch-commits] Commit in mdadm/repos (4 files)
Tobias Powalowski
tpowa at archlinux.org
Sun Mar 8 18:17:53 UTC 2009
Date: Sunday, March 8, 2009 @ 14:17:53
Author: tpowa
Revision: 29451
Merged revisions 29450 via svnmerge from
svn+ssh://svn.archlinux.org/srv/svn-packages/mdadm/trunk
........
r29450 | tpowa | 2009-03-08 19:17:20 +0100 (So, 08 M?\195?\164r 2009) | 1 line
upgpkg: mdadm 2.6.8-2
........
Added:
mdadm/repos/testing-x86_64/mdadm.install
(from rev 29450, mdadm/trunk/mdadm.install)
mdadm/repos/testing-x86_64/mdadm_hook
(from rev 29450, mdadm/trunk/mdadm_hook)
mdadm/repos/testing-x86_64/mdadm_install
(from rev 29450, mdadm/trunk/mdadm_install)
Modified:
mdadm/repos/testing-x86_64/ (properties)
---------------+
mdadm.install | 14 ++++++++++++++
mdadm_hook | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
mdadm_install | 44 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 108 insertions(+)
Property changes on: mdadm/repos/testing-x86_64
___________________________________________________________________
Modified: svnmerge-integrated
- /mdadm/trunk:1-29447
+ /mdadm/trunk:1-29450
Copied: mdadm/repos/testing-x86_64/mdadm.install (from rev 29450, mdadm/trunk/mdadm.install)
===================================================================
--- testing-x86_64/mdadm.install (rev 0)
+++ testing-x86_64/mdadm.install 2009-03-08 18:17:53 UTC (rev 29451)
@@ -0,0 +1,14 @@
+# arg 1: the new package version
+# arg 2: the old package version
+
+post_upgrade() {
+ if [ "$(vercmp $2 2.6.8-2)" -lt 0 -a "$(grep raid_partitions /etc/mkinitcpio.conf)" ]; then
+ echo "Attention mdadm update:"
+ echo "raid_partitions hook has been replaced by the more powerfull mdadm hook."
+ echo "Please update your /etc/mkinitcpio.conf accordingly."
+ fi
+}
+
+op=$1
+shift
+$op $*
Copied: mdadm/repos/testing-x86_64/mdadm_hook (from rev 29450, mdadm/trunk/mdadm_hook)
===================================================================
--- testing-x86_64/mdadm_hook (rev 0)
+++ testing-x86_64/mdadm_hook 2009-03-08 18:17:53 UTC (rev 29451)
@@ -0,0 +1,50 @@
+# vim: set ft=sh:
+run_hook ()
+{
+ input="$(cat /proc/cmdline)"
+ mdconfig="/etc/mdadm.conf"
+ # if no config file is present create one from command line parameters
+ if ! [ -e $mdconfig ]; then
+ #Create initial mdadm.conf
+ # scan all devices in /proc/partitions
+ echo DEVICE partitions > $mdconfig
+ for i in $input; do
+ case $i in
+ # raid
+ md=[0-9]*,/*)
+ device="$(/bin/replace -s,/ "$i" "=" "")"
+ array="$(/bin/replace -s/ "$device" "," " devices=")"
+ echo "ARRAY /dev/$array" >> $mdconfig
+ RAID_FOUND=1
+ ;;
+ # partitionable raid
+ md=d[0-9]*,/*)
+ device="$(/bin/replace -s=d "$i" "md=" "md_")"
+ array="$(/bin/replace -s/ "$device" "," " devices=")"
+ echo "ARRAY /dev/$array" >> $mdconfig
+ RAID_FOUND=1
+ ;;
+ # raid UUID
+ md=[0-9]*,[0-9,a-z]*)
+ device="$(/bin/replace -s,/ "$i" "=" "")"
+ array="$(/bin/replace -s/ "$device" "," " uuid=")"
+ echo "ARRAY /dev/$array" >> $mdconfig
+ RAID_FOUND=1
+ ;;
+ # partitionable raid UUID
+ md=d[0-9]*,[0-9,a-z]*)
+ device="$(/bin/replace -s=d "$i" "md=" "md_")"
+ array="$(/bin/replace -s/ "$device" "," " uuid=")"
+ echo "ARRAY /dev/$array" >> $mdconfig
+ RAID_FOUND=1
+ ;;
+ esac
+ done
+ else
+ RAID_FOUND=1
+ fi
+ if [ "$RAID_FOUND" = 1 ]; then
+ # assemble everything
+ /sbin/mdassemble.static
+ fi
+}
\ No newline at end of file
Copied: mdadm/repos/testing-x86_64/mdadm_install (from rev 29450, mdadm/trunk/mdadm_install)
===================================================================
--- testing-x86_64/mdadm_install (rev 0)
+++ testing-x86_64/mdadm_install 2009-03-08 18:17:53 UTC (rev 29451)
@@ -0,0 +1,44 @@
+# vim: set ft=sh:
+
+install ()
+{
+ MODULES=" $(checked_modules "drivers/md/*" | grep -v "dm-") "
+ BINARIES="mdassemble.static"
+ FILES=""
+ SCRIPT="mdadm"
+ # check if a custom mdadm.conf exists
+ if grep -q ^ARRAY /etc/mdadm.conf; then
+ echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+ add_file "/etc/mdadm.conf"
+ fi
+}
+
+help ()
+{
+cat<<HELPEOF
+ This hook loads the necessary modules for any raid root device,
+ and assembles the raid device when run.
+
+ If arrays are defined in /etc/mdadm.conf, the file will be used instead
+ of command line assembling.
+
+ Command Line Setup:
+ - for raid arrays with persistent superblocks:
+ md=<md device no.>,dev0,dev1,...,devn
+ md=<md device no.>,uuid
+ - for partitionable raid arrays with persistent superblocks:
+ md=d<md device no.>,dev0,dev1,...,devn
+ md=d<md device no.>,uuid
+
+ Parameters:
+ - <md device no.> = the number of the md device:
+ 0 means md0, 1 means md1, ...
+ - <dev0-devn>: e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1
+ or 0900878d:f95f6057:c39a36e9:55efa60a
+ Examples:
+ - md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1
+ This will setup 2 md partitionable arrays.
+ - md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1
+ This will setup 2 md arrays with persistent superblocks.
+HELPEOF
+}
More information about the arch-commits
mailing list