home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd2.bin / suse / inst-sys / lib / YaST2 / bin / YaST2.firstboot < prev    next >
Encoding:
Text File  |  2000-03-30  |  4.4 KB  |  178 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 1999 SuSE GmbH Nuernberg, Germany. All rights reserved
  4. #
  5. # Author: Mathias Kettner <kettner@suse.de> 1999
  6. #
  7. # ----------------------------------------------------------------------
  8. # bootsetup script for YaST2
  9. #
  10. # This script is executed after you installed your system with
  11. # YaST2 and immediately after it has been booted for the first
  12. # time.
  13. #
  14. # ----------------------------------------------------------------------
  15.  
  16. touch /etc/modules.conf
  17. /sbin/depmod -a -F /boot/System.map-`uname -r` `uname -r`
  18.  
  19. #
  20. # Start syslog daemon
  21. #
  22.  
  23. test -x /sbin/init.d/syslog && /sbin/init.d/syslog start
  24.  
  25. # Touch info dir. SuSEconfig probably should regenerated some
  26. # indices
  27.  
  28. for i in /usr/info/ \
  29.      /usr/lib/info/ \
  30.      /usr/local/info/ \
  31.      /usr/local/lib/info/ \
  32.      /usr/X11R6/info/ \
  33.      /usr/X11R6/lib/info/ \
  34.      /usr/X11R6/lib/xemacs/info/ \
  35.      /var/adm/packages ; do
  36.     test -d $i && touch $i 2> /dev/null
  37. done
  38.  
  39. test -e /etc/rc.config && . /etc/rc.config
  40.  
  41. # Rootpasswd is already set by YaST2. 
  42.  
  43. # Touch man page directories. This makes SuSEconfig create new man
  44. # page indices
  45.  
  46. for i in /usr/info /usr/man /usr/X11R6/man /usr/openwin/man \
  47.      /usr/lib/perl5/man /usr/lib/teTeX/man /usr/local/man ; do
  48.     if [ -d $i ] ; then
  49.     find $i -follow -type d 2> /dev/null | xargs touch 2> /dev/null
  50.     fi
  51. done
  52.  
  53. # there was a bug in former releases of ps.tgz - a unreadable /etc/psdevtab
  54. # can be there - this can be deleted. Recreate it simply with calling
  55. # ps as root.  This procedure speeds up ps very much...
  56. # Not longer neccessary?
  57.  
  58. rm -f /etc/psdevtab
  59. ps > /dev/null 2> /dev/null
  60.  
  61. # Now prepare for starting YaST2 again. It needs to complete
  62. # the installation. If it was not able to unmount the CD-Rom
  63. # during the first part of the installation (this happens if
  64. # you have less than 48M of RAM), only the packages from the
  65. # first CD have been installed. The rpm installation must be
  66. # continued in this case.
  67.  
  68. # Start cardmanager for laptops
  69.  
  70. if grep -qs '^PCMCIA:' /etc/install.inf ; then
  71.   test -x /sbin/init.d/pcmcia && /sbin/init.d/pcmcia start
  72. fi
  73.  
  74. sleep 1
  75.  
  76. # Start portmapper in case the installation is done via nfs.
  77. # The network configuration itself is still active, even if
  78. # the root filesystem has been remounted and the processes 
  79. # terminated. It is saved in the kernel.
  80.  
  81. /sbin/portmap
  82.  
  83. #
  84. # make sure, that we have no "future files" in kernel sources
  85. #
  86. find /usr/src/linux* -mtime -0 2>/dev/null | xargs --no-run-if-empty touch
  87.  
  88. # make sure, that texhash will be started in SuSEconfig.
  89. #
  90. mkdir -p /var/adm/SuSEconfig
  91. touch /var/adm/SuSEconfig/run-texhash
  92.  
  93. #
  94. # Start Y2 and tell it to continue the installation. It will install
  95. # the remaining packages and afterwards call SuSEconfig.
  96. #
  97. SPID=`/lib/YaST2/bin/startshell /dev/tty2`
  98. /lib/YaST2/bin/YaST2 installation '(.continue)'
  99. kill $SPID
  100. #
  101. # Stop pcmcia again. If needed it will be started by the
  102. # init scripts again...
  103. #
  104. test -x /sbin/init.d/pcmcia && /sbin/init.d/pcmcia stop
  105.  
  106. #
  107. # Tell the unexperienced user to login as root.
  108. #
  109.  
  110. echo_login_as_root () {
  111.     case "$LANGUAGE" in
  112.       german|de|de_*)
  113.     echo "Geben Sie jetzt \"root\" ein um sich als Benutzer root einzuloggen..."
  114.       ;;
  115.       french|fr|fr_*)
  116.     echo "Tapez maintenant \"root\" pour vous connecter"
  117.     echo "en tant qu'utilisateur root..."
  118.       ;;
  119.       *)
  120.     echo "Please enter \"root\" to login as user root..."
  121.       ;;
  122.     esac
  123. }
  124.  
  125. exec > /etc/issue-SuSE-first-run
  126. #
  127. # Ring the bell
  128. #
  129. tput bel
  130.  
  131. #
  132. # Almost white border line on grey background
  133. #
  134. tput smacs
  135. tput bold; tput setab 7; tput setaf 7
  136. echo -n ┌
  137. echo -n ───────────────────────────────────────
  138. echo -n ───────────────────────────────────────
  139. tput sgr0; tput setab 7; tput setaf 0
  140. echo -n  ┐
  141. tput rmacs
  142.  
  143. #
  144. # Red text on grey background and borders on both sides
  145. #
  146. echo_login_as_root | while read line ; do
  147.     tput bold; tput setab 7; tput setaf 7
  148.     tput smacs; echo -n '│'; tput rmacs; echo -n "  "
  149.     tput sgr0; tput setab 7; tput setaf 1
  150.  
  151.     echo -n "$line" ; tput el; tput hpa 79
  152.  
  153.     tput sgr0; tput setab 7; tput setaf 0
  154.     tput smacs; echo -n '│'; tput rmacs; tput cud1
  155. done
  156.  
  157. #
  158. # Almost black border line on grey background
  159. #
  160. tput smacs
  161. tput bold; tput setab 7; tput setaf 7
  162. echo -n └
  163. tput sgr0; tput setab 7; tput setaf 0
  164. echo -n ───────────────────────────────────────
  165. echo -n ───────────────────────────────────────
  166. echo -n ┘
  167. tput rmacs
  168.  
  169. tput setab 0; tput setaf 7; tput sgr0; tput cud1
  170.  
  171.  
  172. #
  173. # Now we are done. Remove the flag file to avoid this script
  174. # to be executed at next boot time as well.
  175. rm -f /var/lib/YaST2/runme_at_boot
  176.