mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.3 KiB

  1. #!/bin/sh
  2. export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
  3. if [ -d /old_root ] && umount /old_root ; then
  4. rmdir /old_root
  5. else
  6. echo "Can't umount /old_root"
  7. fi
  8. mkdir -p /lib/modules/$( uname -r )
  9. echo -n >> /lib/modules/$( uname -r )/modules.dep
  10. if [[ "$( < /proc/version)" == "Linux version 2.6."* ]] \
  11. && type -p udevd > /dev/null ; then
  12. /sbin/udevd --daemon
  13. udevtrigger
  14. udevsettle
  15. fi
  16. setterm -blank 0 -powersave off -powerdown 0
  17. echo
  18. echo ' ******************************************************************'
  19. echo ' * Welcome to the ROCK Linux 2nd stage boot disk. *'
  20. echo ' ******************************************************************'
  21. echo
  22. echo "This is a small linux distribution, loaded into your computer's memory."
  23. echo "It has everything needed to install ROCK Linux, restore an old installation"
  24. echo "or perform some administrative tasks."
  25. for x in /etc/setup-*.sh /setup/setup.sh ; do
  26. if [ -f "$x" ] ; then
  27. echo ; echo "Running $x ..." ; sh $x
  28. echo "Setup script $x finished."
  29. fi
  30. done
  31. echo
  32. ttydevs=""
  33. if [ -z "$autoboot" ]; then
  34. echo "Enter the names of all terminal devices (e.g. 'vc/1' or 'tts/0')."
  35. echo -n "An empty text stands for vc/1 - vc/6: "; read ttydevs
  36. fi
  37. if [ -z "$ttydevs" ]; then
  38. ttydevs="vc/1 vc/2 vc/3 vc/4 vc/5 vc/6"
  39. fi
  40. if [[ "$ttydevs" = *tts/* ]] ; then
  41. echo -n "Connection speed in Baud (default: 9600): " ; read baud
  42. [ -z "$baud" ] && baud=9600
  43. else
  44. baud=38400
  45. fi
  46. echo
  47. echo 'Just type "stone" now if you want to make a normal installation of a ROCK'
  48. echo -n 'Linux build '
  49. if type -p dialog > /dev/null ; then
  50. echo '(or type "stone -text" if you prefer non-dialog based menus).'
  51. else
  52. echo '(only the text interface is available).'
  53. fi
  54. if [ -z "$autoboot" ]; then
  55. echo -e '#!/bin/sh\ncd ; exec /bin/sh --login' > /sbin/login-shell
  56. else
  57. cat <<- EOT > /sbin/login-shell
  58. #!/bin/bash
  59. cd
  60. case "\$( tty )" in
  61. /dev/vc/1)
  62. echo "Running 'stone' now.."
  63. /bin/sh --login -c "stone"
  64. echo -e '#!/bin/sh\\ncd ; exec /bin/sh --login' > /sbin/login-shell
  65. exit 0
  66. ;;
  67. *)
  68. exec /bin/sh --login
  69. esac
  70. EOT
  71. fi
  72. chmod +x /sbin/login-shell
  73. for x in $ttydevs ; do
  74. ( ( while : ; do agetty -i $baud $x -n -l /sbin/login-shell ; done ) & )
  75. done
  76. exec < /dev/null > /dev/null 2>&1
  77. while : ; do sleep 1 ; done