File: postinst

package info (click to toggle)
raidtools 0.42-16
  • links: PTS
  • area: main
  • in suites: slink
  • size: 392 kB
  • ctags: 128
  • sloc: ansic: 2,056; makefile: 134; sh: 107
file content (50 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh

set -e
cd /dev

# found="`ls -l 2>/dev/null | perl -ne '
# 	print if m/^b\S+\s+\d+\s+\S+\s+\S+\s+999,\s+0\s/;
# '`"
# if [ "$found" ]; then exit 0; fi

if [ ! -e md0 -o ! -e md1 -o ! -e md1 -o ! -e md2 -o ! -e md3 ]; then
    echo -n Creating
    for i in 0 1 2 3
    do
	echo -n " /dev/md$i"
	mknod -m 600 md$i b 9 $i
	chown root.disk md$i
	chmod 660 md$i
    done
    echo " done."
fi

if [ -z "`/sbin/modprobe -c |grep 'md-personality-1'`" ]; then
    echo "Adding linear."
    echo "alias md-personality-1 linear" >> /etc/conf.modules
fi

if [ -z "`/sbin/modprobe -c |grep 'md-personality-2'`" ]; then
   echo "Adding raid0."
    echo "alias md-personality-2 raid0" >> /etc/conf.modules
fi

if [ -z "`/sbin/modprobe -c |grep 'md-personality-3'`" ]; then
   echo "Adding raid1."
    echo "alias md-personality-3 raid1" >> /etc/conf.modules
fi

if [ -z "`/sbin/modprobe -c |grep 'md-personality-4'`" ]; then
   echo "Adding raid4."
    echo "alias md-personality-4 raid5" >> /etc/conf.modules
fi

if [ "$1" = "configure" ]
then
    #
    # This should really be stop 98 0 6 . start 25 S . but then raid
    # would stop before filesystems are umounted.  Ugh.
    #
    update-rc.d raid start 50 0 6 . start 25 S . > /dev/null
fi