summaryrefslogtreecommitdiff
path: root/pid2/loader.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pid2/loader.sh')
-rw-r--r--pid2/loader.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/pid2/loader.sh b/pid2/loader.sh
new file mode 100644
index 0000000..579acff
--- /dev/null
+++ b/pid2/loader.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+module="pidevice"
+device="pidevice"
+mode="644"
+
+insmod ./$module.ko $* || exit -1
+
+rm -f /dev/${device}[0-4]
+
+major=$(cat /proc/devices | grep $module | cut -f 1)
+
+echo major
+exit -1
+
+for i in {0..3}; do
+ mknod /dev/${device}$i c $major $i
+done
+
+group="staff"
+grep -q '^staff:' /etc/group || group="wheel"
+
+chgrp $group /dev/${device}[0-3]
+chmod $mode /dev/${device}[0-3]