File: postinst

package info (click to toggle)
mdutils 0.35-23
  • links: PTS
  • area: main
  • in suites: slink
  • size: 148 kB
  • ctags: 74
  • sloc: ansic: 592; makefile: 112; sh: 63
file content (46 lines) | stat: -rw-r--r-- 1,143 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
#! /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

kver=`uname -r`
if `dpkg --compare-versions $kver ge 2.1.63`; then
    echo "You're using a kernel version higher than 2.1.62.  You should use the"
    echo "raidtools package instead of mdutils."
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 mdutils start 50 0 6 . start 25 S . > /dev/null
fi