File: preinst

package info (click to toggle)
raidtools2 0.90.990824-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 688 kB
  • ctags: 468
  • sloc: ansic: 2,631; makefile: 143; sh: 114
file content (30 lines) | stat: -rw-r--r-- 962 bytes parent folder | download
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
#! /bin/sh

set -e

if [ -f /etc/raidtab ]
  then
     exit 0
  fi

# All the alpha RAID drivers i have seen put the "unused devices:" line into
# /proc/mdstat, and the RAID drivers in stock kernels do not.
# A better solution would be to look into /proc/sys/dev/md, but im not sure
# whether it's implemented in all versions.

if ! grep -q '^unused devices:' /proc/mdstat 
then

  echo "It looks like you aren't running a kernel with the correct RAID patch"
  echo "applied. This package needs alpha RAID drivers, which aren't included"
  echo "in the stock kernel. You can find kernel patches for this from"
  echo "ftp://ftp.kernel.org/pub/linux/raid/alpha"
  echo ""
  echo "Please use the older raidtools package if you want to run raid with the"
  echo "stock kernels. If you believe have applied the correct patch you can"
  echo "touch /etc/raidtab and this package will smoothly install."
  echo -n "Press Enter to continue... "; read ans

  exit 1

fi