hx170dec_load.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh
  2. #-------------------------------------------------------------------------------
  3. #- --
  4. #- This software is confidential and proprietary and may be used --
  5. #- only as expressly authorized by a licensing agreement from --
  6. #- --
  7. #- Hantro Products Oy. --
  8. #- --
  9. #- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
  10. #- ALL RIGHTS RESERVED --
  11. #- --
  12. #- The entire notice above must be reproduced --
  13. #- on all copies and should not be removed. --
  14. #- --
  15. #-------------------------------------------------------------------------------
  16. #-
  17. #-- Description : Load device driver
  18. #--
  19. #--------------------------------------------------------------------------------
  20. #--
  21. #-- Version control information, please leave untouched.
  22. #--
  23. #-- $RCSfile: driver_load.sh,v $
  24. #-- $Revision: 1.1 $
  25. #-- $Date: 2007/03/27 11:06:41 $
  26. #--
  27. #--------------------------------------------------------------------------------
  28. module="hx170dec"
  29. device="/tmp/dev/hx170"
  30. mode="666"
  31. echo
  32. #insert module
  33. insmod /lib/modules/4.14.88/kernel/drivers/soc/arkmicro/hx170dec/$module.ko $* || exit 1
  34. echo "module $module inserted"
  35. #remove old nod
  36. rm -f $device
  37. #read the major asigned at loading time
  38. major=`cat /proc/devices | grep $module | cut -c1-3`
  39. echo "$module major = $major"
  40. #create dev node
  41. mknod $device c $major 0
  42. echo "node $device created"
  43. #give all 'rw' access
  44. chmod $mode $device
  45. echo "set node access to $mode"
  46. #the end
  47. echo