-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.sh
More file actions
29 lines (26 loc) · 781 Bytes
/
load.sh
File metadata and controls
29 lines (26 loc) · 781 Bytes
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
#!/bin/sh
module="uframe"
mode="664"
dir="/dev/uframe"
# invoke insmod with all arguments we got
# and use a pathname, as newer modutils don't look in . by
#/sbin/insmod ./udriver.ko $* || exit 1
mkdir -p $dir
# remove stale nodes
rm -f $dir/command
rm -f $dir/bulk
rm -f $dir/interrupt
major=`awk "\\$2==\"$module\" {print \\$1}" /proc/devices`
mknod $dir/command c $major 0
mknod $dir/bulk c $major 1
mknod $dir/interrupt c $major 2
# give appropriate group/permissions, and change the group.
# Not all distributions have staff, some have "wheel" instead.
group="staff"
grep -q '^staff:' /etc/group || group="wheel"
chgrp $group $dir/command
chmod $mode $dir/command
chgrp $group $dir/bulk
chmod $mode $dir/bulk
chgrp $group $dir/interrupt
chmod $mode $dir/interrupt