mkdevs.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/sh
  2. #
  3. # makedev.sh - creates device files for a busybox boot floppy image
  4. # we do our work in the dev/ directory
  5. if [ -z "$1" ]; then
  6. echo "usage: `basename $0` path/to/dev/dir"
  7. exit 1
  8. fi
  9. cd $1
  10. # miscellaneous one-of-a-kind stuff
  11. mknod console c 5 1
  12. mknod full c 1 7
  13. mknod kmem c 1 2
  14. mknod mem c 1 1
  15. mknod null c 1 3
  16. mknod port c 1 4
  17. mknod random c 1 8
  18. mknod urandom c 1 9
  19. mknod zero c 1 5
  20. ln -s /proc/kcore core
  21. # IDE HD devs
  22. # note: not going to bother creating all concievable partitions; you can do
  23. # that yourself as you need 'em.
  24. mknod hda b 3 0
  25. mknod hdb b 3 64
  26. mknod hdc b 22 0
  27. mknod hdd b 22 64
  28. # loop devs
  29. for i in `seq 0 7`; do
  30. mknod loop$i b 7 $i
  31. done
  32. # ram devs
  33. for i in `seq 0 9`; do
  34. mknod ram$i b 1 $i
  35. done
  36. ln -s ram1 ram
  37. # ttys
  38. mknod tty c 5 0
  39. for i in `seq 0 9`; do
  40. mknod tty$i c 4 $i
  41. done
  42. # virtual console screen devs
  43. for i in `seq 0 9`; do
  44. mknod vcs$i b 7 $i
  45. done
  46. ln -s vcs0 vcs
  47. # virtual console screen w/ attributes devs
  48. for i in `seq 0 9`; do
  49. mknod vcsa$i b 7 $i
  50. done
  51. ln -s vcsa0 vcsa