Debian Codegraph @

langford_init

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 #***********************************************************************
4 # * The langford initialization file. This utility initializes the
5 # * /dev/langford file based on the /proc/device list.
6 # *
7 # * (c) 2013 Per Vices Corporation
8 # *
9 # * See LICENSE.txt for license and copyright information.
10 # ************************************************************************/
11
12 #Load registered char device to /dev/langford
13 #This will only work after compiling correct kernel driver.
14
15 #Check for root permissions - required to create char device.
16 if [[ $EUID -ne 0 ]]; then
17 echoscip-shell system . . echo. "Langford device initialization requires superuser permissions. Please run as root, or try typing: sudo langford_init" 1>&2
18 exit 1
19 fi
20
21
22 if [scip-shell system . . `[`. -e /dev/langfordscip-shell filesystem . . `/dev/langford`. ]; then
23 echoscip-shell system . . echo. "/dev/langford already exists - exiting.scip-shell filesystem . . `/dev/langford already exists - exiting.`."
24 exit 1
25 else
26 mknodscip-shell system . . mknod. /dev/langfordscip-shell filesystem . . `/dev/langford`. c $(awkscip-shell system . . awk. '/langford/ {print $1}scip-shell filesystem . . `/langford/ {print $1}`.' /proc/devicesscip-shell filesystem . . `/proc/devices`.) 0
27 if [scip-shell system . . `[`. -e /dev/langfordscip-shell filesystem . . `/dev/langford`. ]
28 then
29 # echo "New Langford Device Created at /dev/langford"
30 chownscip-shell system . . chown. root:langford /dev/langfordscip-shell filesystem . . `/dev/langford`.
31 chmodscip-shell system . . chmod. g+u /dev/langfordscip-shell filesystem . . `/dev/langford`.
32 # echo "Granting read/write permissions to members of the langford group."
33 exit 0
34 else
35 echoscip-shell system . . echo. "Failed to create Langford device. Is the kernel module loaded?"
36 exit 1
37 fi
38 fi
39