load 685 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. module="jpu"
  3. device="jpu"
  4. mode="664"
  5. # Group: since distributions do it differently, look for wheel or use staff
  6. if grep '^staff:' /etc/group > /dev/null; then
  7. group="staff"
  8. else
  9. group="wheel"
  10. fi
  11. # invoke insmod with all arguments we got
  12. # and use a pathname, as newer modutils don't look in . by default
  13. /sbin/insmod -f ./$module.ko $* || exit 1
  14. major=`cat /proc/devices | awk "\\$2==\"$module\" {print \\$1}"`
  15. # Remove stale nodes and replace them, then give gid and perms
  16. # Usually the script is shorter, it's simple that has several devices in it.
  17. rm -f /dev/${device}
  18. mknod /dev/${device} c $major 0
  19. chgrp $group /dev/${device}
  20. chmod $mode /dev/${device}