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.

100 lines
2.5 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. udevd --daemon
  16. echo "/sbin/udevsend" > /proc/sys/kernel/hotplug
  17. cd /dev ; rm -f fd
  18. ln -sf /proc/kcore core
  19. ln -sf /proc/self/fd fd
  20. ln -sf fd/0 stdin
  21. ln -sf fd/1 stdout
  22. ln -sf fd/2 stderr
  23. cd /
  24. setterm -blank 0 -powersave off -powerdown 0
  25. echo
  26. echo ' ******************************************************************'
  27. echo ' * Welcome to the ROCK Linux 2nd stage boot disk. *'
  28. echo ' ******************************************************************'
  29. echo
  30. echo "This is a small linux distribution, loaded into your computer's memory."
  31. echo "It has everything needed to install ROCK Linux, restore an old installation"
  32. echo "or perform some administrative tasks."
  33. for x in /etc/setup-*.sh /setup/setup.sh ; do
  34. if [ -f "$x" ] ; then
  35. echo ; echo "Running $x ..." ; sh $x
  36. echo "Setup script $x finished."
  37. fi
  38. done
  39. echo
  40. ttydevs=""
  41. if [ -z "$autoboot" ]; then
  42. echo "Enter the names of all terminal devices (e.g. 'vc/1' or 'tts/0')."
  43. echo -n "An empty text stands for vc/1 - vc/6: "; read ttydevs
  44. fi
  45. if [ -z "$ttydevs" ]; then
  46. ttydevs="vc/1 vc/2 vc/3 vc/4 vc/5 vc/6"
  47. fi
  48. if [[ "$ttydevs" = *tts/* ]] ; then
  49. echo -n "Connection speed in Baud (default: 9600): " ; read baud
  50. [ -z "$baud" ] && baud=9600
  51. else
  52. baud=38400
  53. fi
  54. echo
  55. echo 'Just type "stone" now if you want to make a normal installation of a ROCK'
  56. echo -n 'Linux build '
  57. if type -p dialog > /dev/null ; then
  58. echo '(or type "stone -text" if you prefer non-dialog based menus).'
  59. else
  60. echo '(only the text interface is available).'
  61. fi
  62. if [ -z "$autoboot" ]; then
  63. echo -e '#!/bin/sh\ncd ; exec /bin/sh --login' > /sbin/login-shell
  64. else
  65. cat <<- EOT > /sbin/login-shell
  66. #!/bin/bash
  67. cd
  68. case "\$( tty )" in
  69. /dev/vc/1)
  70. echo "Running 'stone' now.."
  71. /bin/sh --login -c "stone"
  72. echo -e '#!/bin/sh\\ncd ; exec /bin/sh --login' > /sbin/login-shell
  73. exit 0
  74. ;;
  75. *)
  76. exec /bin/sh --login
  77. esac
  78. EOT
  79. fi
  80. chmod +x /sbin/login-shell
  81. for x in $ttydevs ; do
  82. ( ( while : ; do agetty -i $baud $x -n -l /sbin/login-shell ; done ) & )
  83. done
  84. exec < /dev/null > /dev/null 2>&1
  85. while : ; do sleep 1 ; done