wok-next rev 4027

dmraid/grub-dmraid: ensure raid is up
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Sep 05 11:28:55 2009 +0200 (2009-09-05)
parents 84fc1b67b40b
children 589a78b28bb2
files dmraid/receipt dmraid/stuff/dmraid-start dmraid/stuff/grub-dmraid
line diff
     1.1 --- a/dmraid/receipt	Fri Sep 04 21:23:04 2009 +0000
     1.2 +++ b/dmraid/receipt	Sat Sep 05 11:28:55 2009 +0200
     1.3 @@ -29,5 +29,6 @@
     1.4  	mkdir -p $fs/usr/sbin
     1.5  	cp -a $src/tools/dmraid $fs/usr/sbin
     1.6  	cp -a stuff/grub-dmraid $fs/usr/sbin
     1.7 +	cp -a stuff/dmraid-start $fs/usr/sbin
     1.8  }
     1.9  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/dmraid/stuff/dmraid-start	Sat Sep 05 11:28:55 2009 +0200
     2.3 @@ -0,0 +1,11 @@
     2.4 +#!/bin/sh
     2.5 +
     2.6 +module=$(dmraid -s | grep ^type | awk '{ print $3 }')
     2.7 +
     2.8 +case "$module" in
     2.9 +mirror) module=dm-mirror;;
    2.10 +raid[456]*) module=raid456;;
    2.11 +esac
    2.12 +
    2.13 +[ -n "$module" ] && modprobe $module
    2.14 +dmraid -ay
     3.1 --- a/dmraid/stuff/grub-dmraid	Fri Sep 04 21:23:04 2009 +0000
     3.2 +++ b/dmraid/stuff/grub-dmraid	Sat Sep 05 11:28:55 2009 +0200
     3.3 @@ -17,6 +17,9 @@
     3.4  	exit 1
     3.5  fi
     3.6  
     3.7 +# Ensure raid is active
     3.8 +[ ! -e $dev ] && dmraid-start
     3.9 +
    3.10  geometry="$(fdisk -l $dev | grep heads | sed \
    3.11  's|\(.*\) heads, \(.*\) sectors/track, \(.*\) cylinders|\3 \1 \2|')"
    3.12