File: installarchconf

package info (click to toggle)
module-init-tools 3.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,208 kB
  • ctags: 900
  • sloc: sh: 7,980; ansic: 5,036; makefile: 204
file content (48 lines) | stat: -rw-r--r-- 1,001 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

archmodel() {
    local arch=$(dpkg-architecture -qDEB_HOST_ARCH)
    case $arch in
	i[0-9]86)	arch=i386 ;;
	x86_64|amd64)	arch=x86_64 ;;
	lpia)		arch=i386 ;;
	arm*)		arch=arm ;;
	mips*)		arch=mips ;;
	s390x)		arch=s390 ;;
	parisc64)	arch=parisc ;;
	sparc64)	arch=sparc ;;
	ppc64)		arch=powerpc.generic ;;
	ppc|powerpc)	arch="powerpc.*" ;;
	m68k)		arch="m68k.*" ;;
    esac
    echo $arch
}

if [ -z "$1" ]; then
    echo "Usage: $0 DESTINATION_DIRECTORY"
    exit 1
fi

arch=$(archmodel)

for file in extra/modprobe.d/arch/$arch; do
    if [ ! -f $file -a "$(echo $file)" = "$file" ]; then
	cat <<EOM



=================================================================
There are no architecture-specific modprobe files to install
for your architecture ($arch). This is probably an error.
If so, please send an appropriate configuration to the maintainer
of this package.
=================================================================


EOM
	sleep 10
    else
	cp $file $1
    fi
done