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.

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