summaryrefslogtreecommitdiffstats
path: root/load.sh
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2012-12-24 12:53:20 -0600
committerKyle Kaminski <kyle@kkaminsk.com>2012-12-24 12:53:20 -0600
commit0d9aff9bd305d18625c322a1a891aba278049862 (patch)
tree274aa52bf311107232488fb3f924cef316cfcb28 /load.sh
parentf0531d88e958b5fa77f8dc9bb34e697e872aeba9 (diff)
downloadkernelhello-0d9aff9bd305d18625c322a1a891aba278049862.tar.gz
kernelhello-0d9aff9bd305d18625c322a1a891aba278049862.tar.bz2
kernelhello-0d9aff9bd305d18625c322a1a891aba278049862.zip
spawn char device at /dev/, implement read
Diffstat (limited to 'load.sh')
-rwxr-xr-xload.sh24
1 files changed, 0 insertions, 24 deletions
diff --git a/load.sh b/load.sh
deleted file mode 100755
index 41266bc..0000000
--- a/load.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-MODULE=hello
-DEVICE=skull
-MODE=664
-
-# invoke insmod with all arguments and use a pathname
-# as newer modutils don't look into . by default
-/usr/bin/insmod ./${MODULE}.ko $* || exit 1
-
-# remove stale nodes
-rm -f /dev/${DEVICE}[0]
-
-MAJOR=$(awk "\$2 == \"$DEVICE\" {print \$1}" /proc/devices)
-
-mknod /dev/${DEVICE}0 c $MAJOR 0
-
-# give appriopriate permissions
-GROUP=staff
-grep -q '^staff' /etc/group || GROUP=wheel
-
-chgrp $GROUP /dev/${DEVICE}0
-chmod $MODE /dev/${DEVICE}0
-