author | Florian Pose <fp@igh-essen.com> |
Tue, 21 Mar 2006 15:10:18 +0000 | |
changeset 122 | 132c3ffc8dea |
parent 28 | 801dc7eabf51 |
child 181 | 3e9155836bc7 |
permissions | -rwxr-xr-x |
0 | 1 |
#!/bin/sh |
2 |
module="msr_modul" |
|
3 |
device="msr" |
|
4 |
mode="664" |
|
5 |
||
6 |
# Group: since distributions do it differently, look for wheel or use staff |
|
7 |
if grep '^staff:' /etc/group > /dev/null; then |
|
8 |
group="staff" |
|
9 |
else |
|
10 |
group="wheel" |
|
11 |
fi |
|
12 |
||
13 |
# invoke insmod with all arguments we got |
|
14 |
# and use a pathname, as newer modutils don't look in . by default |
|
28
801dc7eabf51
IPIPE,floatpoint,rtlib
Wilhelm Hagemeister <hm@igh-essen.com>
parents:
0
diff
changeset
|
15 |
/sbin/insmod -f ./$module.ko $* || exit 1 |
0 | 16 |
|
17 |
major=`cat /proc/devices | awk "\\$2==\"$device\" {print \\$1}"` |
|
18 |
||
19 |
echo $major |
|
20 |
# Remove stale nodes and replace them, then give gid and perms |
|
21 |
# Usually the script is shorter, it's scull that has several devices in it. |
|
22 |
||
23 |
rm -f /dev/${device} |
|
24 |
mknod /dev/${device} c $major 0 |
|
25 |
# ln -sf ${device}0 /dev/${device} |
|
26 |
chgrp users /dev/${device} |
|
27 |
chmod $mode /dev/${device} |
|
28 |
||
29 |
||
30 |
||
31 |
||
32 |
||
33 |
||
34 |
||
35 |
||
36 |