vchiq.sh 572 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: vchiq.sh
  4. # Required-Start: $remote_fs rmnologin
  5. # Required-Stop:
  6. # Default-Start: S
  7. # Default-Stop:
  8. # Short-Description: Create /dev/vchiq.
  9. # Description: Get the major number from /proc/devices and use it
  10. # ti create /dev/vchiq
  11. ### END INIT INFO
  12. rm -f /dev/vchiq
  13. #Get the major number
  14. major=$(awk "\$2==\"vchiq\" {print \$1}" /proc/devices)
  15. if [ -z "$major" ]; then
  16. echo "Error: Cannot find vchiq in /proc/devices"
  17. exit 2
  18. else
  19. mknod /dev/vchiq c "$major" 0
  20. chmod a+w /dev/vchiq
  21. fi