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.

90 lines
2.3 KiB

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