aboutsummaryrefslogtreecommitdiffstats
path: root/bttv/driver/update
blob: 91db789d3ec741a63e9c7aa72af33e3254396f1d (plain)
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
#!/bin/sh

if test "$UID" = "0"; then
	# running as root anyway, don't need sudo
	INSMOD="/sbin/insmod"
	RMMOD="/sbin/rmmod"
else
	INSMOD="sudo /sbin/insmod"
	RMMOD="sudo /sbin/rmmod"
fi

# handy functions for rmmod/insmod
function xrmmod () {
	grep -qe "^$1" /proc/modules || return
	echo rmmod $1
	$RMMOD $1 || exit 1
}
function xinsmod () {
	echo insmod $*
	$INSMOD -f $* || exit 1
}

# prepare for crashing the box -- flush dirty buffers
sync; sleep 1; sync

# kill old modules ...
xrmmod bttv
xrmmod msp3400
xrmmod tuner
xrmmod i2c_chardev
xrmmod i2c-dev
xrmmod algo-bit
xrmmod i2c
xrmmod videodev

# ... and load the new ones
xinsmod videodev
xinsmod i2c		verbose=1 scan=1 i2c_debug=0
test -f i2c_chardev.o && xinsmod i2c_chardev
xinsmod tuner		debug=0 type=5 
xinsmod msp3400		
xinsmod bttv		radio=1 vidmem=0xff0

Privacy Policy