Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]

Diff markup

Differences between /ldd-examples/scullp/scullp_load (Version 2.6.31.13) and /ldd-examples/scullp/scullp_load (Version 2.6.25)


  1 #!/bin/sh                                           1 #!/bin/sh
  2 module="scullp"                                     2 module="scullp"
  3 device="scullp"                                     3 device="scullp"
  4 mode="664"                                          4 mode="664"
  5                                                     5 
  6 # Group: since distributions do it differently      6 # Group: since distributions do it differently, look for wheel or use staff
  7 if grep '^staff:' /etc/group > /dev/null; then      7 if grep '^staff:' /etc/group > /dev/null; then
  8     group="staff"                                   8     group="staff"
  9 else                                                9 else
 10     group="wheel"                                  10     group="wheel"
 11 fi                                                 11 fi
 12                                                    12 
 13 # remove stale nodes                               13 # remove stale nodes
 14 rm -f /dev/${device}?                              14 rm -f /dev/${device}? 
 15                                                    15 
 16 # invoke insmod with all arguments we got          16 # invoke insmod with all arguments we got
 17 # and use a pathname, as newer modutils don't      17 # and use a pathname, as newer modutils don't look in . by default
 18 /sbin/insmod -f ./$module.ko $* || exit 1          18 /sbin/insmod -f ./$module.ko $* || exit 1
 19                                                    19 
 20 major=`cat /proc/devices | awk "\\$2==\"$modul     20 major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
 21                                                    21 
 22 mknod /dev/${device}0 c $major 0                   22 mknod /dev/${device}0 c $major 0
 23 mknod /dev/${device}1 c $major 1                   23 mknod /dev/${device}1 c $major 1
 24 mknod /dev/${device}2 c $major 2                   24 mknod /dev/${device}2 c $major 2
 25 mknod /dev/${device}3 c $major 3                   25 mknod /dev/${device}3 c $major 3
 26 ln -sf ${device}0  /dev/${device}                  26 ln -sf ${device}0  /dev/${device}
 27                                                    27 
 28 # give appropriate group/permissions               28 # give appropriate group/permissions
 29 chgrp $group /dev/${device}[0-3]                   29 chgrp $group /dev/${device}[0-3]
 30 chmod $mode  /dev/${device}[0-3]                   30 chmod $mode  /dev/${device}[0-3]
                                                      
  This page was automatically generated by the LXR engine.