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.

118 lines
3.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/sysfiles/stone_mod_setup.sh
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. #
  23. # This module should only be executed once directly after the installation
  24. make_fstab() {
  25. tmp1=`mktemp` ; tmp2=`mktemp`
  26. cat <<- EOT > $tmp2
  27. /dev/root / auto defaults 0 1
  28. none /proc proc defaults 0 0
  29. none /dev/pts devpts defaults 0 0
  30. none /dev/shm ramfs defaults 0 0
  31. none /sys sysfs defaults 0 0
  32. #none /tmp tmpfs defaults 0 0
  33. EOT
  34. for x in /dev/cdroms/cdrom[0-9] ; do
  35. if [ -e $x ] ; then
  36. trg=/mnt/${x/*\//} ; trg=${trg/cdrom0/cdrom}
  37. mkdir -p $trg
  38. echo "$x $trg iso9660 ro,noauto 0 0" >> $tmp2
  39. fi
  40. done
  41. for x in /dev/floppy/[0-9] ; do
  42. if [ -e $x ] ; then
  43. trg=/mnt/floppy${x/*\//} ; trg=${trg/floppy0/floppy}
  44. mkdir -p $trg
  45. echo "$x $trg auto sync,noauto 0 0" >> $tmp2
  46. fi
  47. done
  48. sed -e "s/ nfs [^ ]\+/ nfs rw/" < /etc/mtab | \
  49. sed "s/ rw,/ /; s/ rw / defaults /" >> $tmp2
  50. grep '^/dev/' /proc/swaps | cut -f1 -d' ' | \
  51. sed 's,$, swap swap defaults 0 0,' >> $tmp2
  52. cut -f2 -d' ' < $tmp2 | sort -u | while read dn ; do
  53. grep " $dn " $tmp2 | tail -n 1; done > $tmp1
  54. fsregex="$( echo -n $( ls /sbin/fsck.* | \
  55. cut -f2- -d. ) | sed 's, ,\\|,g' )"
  56. gawk '{ printf("%-58s %d %d\n",
  57. sprintf("%-45s ", sprintf("%-35s ",
  58. sprintf("%-20s ", $1) $2) $3) $4,
  59. $5, $6); }' < $tmp1 | \
  60. sed "/ \($fsregex\) / s, 0$, 1," > /etc/fstab
  61. tr ' ' '\240' < /etc/fstab > $tmp1
  62. gui_message $'Auto-created /etc/fstab file:\n\n'"$( cat $tmp1 )"
  63. rm -f $tmp1 $tmp2
  64. }
  65. set_rootpw() {
  66. if [ "$SETUPG" = dialog ] ; then
  67. tmp1="`mktemp`" ; tmp2="`mktemp`" ; rc=0
  68. gui_dialog --nocancel --passwordbox "Setting a root password. `
  69. `Type password:" 8 70 > $tmp1
  70. gui_dialog --nocancel --passwordbox "Setting a root password. `
  71. `Retype password:" 8 70 > $tmp2
  72. if [ -s $tmp1 ] && cmp -s $tmp1 $tmp2 ; then
  73. echo -n "root:" > $tmp1 ; echo >> $tmp2
  74. cat $tmp1 $tmp2 | chpasswd
  75. else
  76. gui_message "Password 1 and password 2 are `
  77. `not the same" ; rc=1
  78. fi
  79. rm $tmp1 $tmp2
  80. return $rc
  81. else
  82. passwd root
  83. return $?
  84. fi
  85. }
  86. main() {
  87. ldconfig
  88. export gui_nocancel=1
  89. make_fstab
  90. $STONE general set_keymap
  91. while ! set_rootpw; do :; done
  92. $STONE general set_tmarea
  93. $STONE general set_dtime
  94. $STONE general set_locale
  95. $STONE general set_vcfont
  96. # source postinstall scripts added by misc packages
  97. for x in ${SETUPD}/setup_*.sh ; do
  98. [ -f $x ] && . $x
  99. done
  100. cron.run
  101. unset gui_nocancel
  102. exec $STONE
  103. }