mknod_console 431 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. if ! [ -a dev/console ] ;
  3. then
  4. if [ "$USER" = "root" ]; then
  5. MKNOD="mknod"
  6. else
  7. MKNOD="sudo mknod"
  8. fi
  9. $MKNOD dev/console c 5 1
  10. $MKNOD dev/ttyAMA0 c 204 64
  11. $MKNOD dev/ttyAMA1 c 204 65
  12. $MKNOD dev/ttyS000 c 204 64
  13. if [ $? -ne 0 ] ;
  14. then
  15. echo "'mknod dev/console c 5 1' failed!"
  16. echo "You are not 'root' or you have not sudo privilege."
  17. fi
  18. fi