home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / ROOTDSKS.12 / UMSDOS12 / etc / rc < prev    next >
Encoding:
Text File  |  1994-10-22  |  4.6 KB  |  150 lines

  1. #!/bin/sh
  2. # remove /etc/mtab* so mount creates the /etc/mtab file
  3. /bin/rm -f /etc/mtab* /etc/nologin /etc/utmp
  4. echo -n "" >> /etc/utmp
  5.  
  6. # You may wish to clip this one down as well
  7. #/bin/mv -f /etc/wtmp /etc/wtmp.old
  8. #touch /etc/wtmp
  9. echo -n "" >> /etc/utmp
  10.  
  11. # should check fs before mounting
  12. #e2fsck -av /dev/sda2
  13.  
  14. /bin/mount -av -t nonfs
  15. /bin/swapon -a
  16.  
  17. /bin/rm -f /usr/spool/uucp/LCK*
  18. /bin/rm -f /auto/run/*
  19.  
  20. /bin/hostname -S slackware
  21. HOSTNAME=slackware
  22. # Attach the loopback device.
  23. /etc/ifconfig lo 127.0.0.1
  24. /etc/route add 127.0.0.1
  25.   # Constants.
  26.   NET="/usr/etc"
  27.   IN_SERV="syslogd klogd"
  28.   LPSPOOL="/var/spool/lpd"
  29.  
  30.   # At this point, we are ready to talk to The World...
  31.   echo "Mounting remote file systems..."
  32.   /etc/mount -a -t nfs        # This may be our /usr runtime!!!
  33.  
  34.   # Start the INET SuperServer
  35.   if [ -f ${NET}/inetd ]
  36.   then
  37.     echo -n "inetd "
  38.     ${NET}/inetd
  39.   else
  40.     echo "no INETD found.  INET cancelled!"
  41.     exit 1
  42.   fi
  43.  
  44. echo
  45.  
  46. if [ -x /etc/syslogd ]; then
  47.     syslogd  # turn on logging of su's, logins etc.
  48. fi
  49.  
  50. if [ -x /etc/syslogk ]; then
  51.     syslogk on > /usr/log/kernel&  # log all kernel messages.
  52. fi
  53.  
  54. #/bin/syslogk on 1> /dev/null 2> /dev/null
  55. /bin/mount /proc /proc -t proc 1> /dev/null 2> /dev/null
  56.  
  57. echo > /etc/motd
  58. echo "`/bin/uname -a | /bin/cut -d\  -f1,3`. (Posix)." >> /etc/motd
  59. echo >> /etc/motd
  60. echo "If you're upgrading an existing Slackware system, you might want to" >> /etc/motd
  61. echo "remove old packages before you run 'setup' to install the new ones. If" >> /etc/motd
  62. echo "you don't, your system will still work but there might be some old files" >> /etc/motd
  63. echo "left laying around on your drive." >> /etc/motd
  64. echo >> /etc/motd
  65. echo "Just mount your Linux partitions under /mnt and type 'pkgtool'. If you" >> /etc/motd
  66. echo "don't know how to mount your partitions, type 'pkgtool' and it will tell" >> /etc/motd
  67. echo "you how it's done." >> /etc/motd
  68. echo >> /etc/motd
  69. echo "To start the main installation, type 'setup'." >> /etc/motd
  70. echo >> /etc/motd
  71.  
  72. #Scan for potential swap space:
  73. echo
  74. echo "Slackware Linux UMSDOS install disk v. 2.1.0."
  75. echo
  76. echo "Hello, and welcome to Linux. Unless have more than 4 megabytes of RAM,"
  77. echo "you'll need a swap file to install. This should be created on the DOS"
  78. echo "partition that you plan to install on."
  79. echo
  80. echo "   Device Boot  Begin   Start     End  Blocks   Id  System"
  81. fdisk -l > /tmp/dosp
  82. fgrep DOS /tmp/dosp
  83. rm -f /tmp/dosp
  84. echo
  85. echo -n "Use which device (such as /dev/hda1, or ENTER to skip)? "
  86. read ROOT_DEV;
  87. if [ ! "$ROOT_DEV" = "" ]; then
  88.  if [ -r $ROOT_DEV ]; then
  89.   echo $ROOT_DEV > /tmp/used4swap # this will be good to know later
  90.   echo
  91.   echo "Mounting device $ROOT_DEV under /mnt:"
  92.   mount $ROOT_DEV /mnt -t umsdos
  93.   echo "Making directory /mnt/linux/dev:"
  94.   mkdir -p /mnt/linux/dev
  95.   echo 
  96.   echo "What size swap file would you like to create?"
  97.   echo
  98.   echo "To give you an idea, you will specify a number such as 4096 if you want"
  99.   echo "to use 4 megabytes of your DOS partition for a swap file. Assuming you"
  100.   echo "have 4 megabytes of RAM, you will need a swap file of size 2048 to install"
  101.   echo "the system and try a few things out. If you're planning to run X, you'll"
  102.   echo "probably want to use a larger swapfile (around 8192 or so)."
  103.   echo
  104.   echo -n "Enter swap file size: "
  105.   read SIZE;
  106.   if [ "$SIZE" = "0" -o "$SIZE" = "" ]; then
  107.    echo "size is 0!"
  108.    echo
  109.    echo "ABORTING! Please reboot now."
  110.    echo
  111.    sleep 20000
  112.   fi
  113.   echo
  114.   echo "Creating a ${SIZE}K swapfile in your /dev directory:"
  115.   dd if=/dev/zero of=/mnt/linux/dev/swapfile ibs=1024 count=$SIZE
  116.   if [ ! $? = 0 ]; then
  117.    echo 
  118.    echo "Whoooops. I think there was an error there. It's possible if it"
  119.    echo "was an 'out of space' error that your partition wasn't mounted"
  120.    echo "properly in the first place. You'll probably have to reboot and"
  121.    echo "try again, but you might want to log in anyway and type 'mount'"
  122.    echo "to see if the partition shows up. If it does, you probably did"
  123.    echo "just run out of space."
  124.    echo
  125.    echo "In just a moment, I'm going to continue onward and you may see a"
  126.    echo "whole bunch of errors."
  127.    echo
  128.    echo "Try not to look."
  129.    echo
  130.    sleep 50
  131.   fi
  132.   echo "Running mkswap on the new swapfile:"
  133.   mkswap /mnt/linux/dev/swapfile $SIZE
  134.   echo "Activating swap partition:"
  135.   swapon /mnt/linux/dev/swapfile
  136.   echo
  137.   echo "Memory status:"
  138.   /bin/free
  139.   echo
  140.   echo "You should see your swapspace indicated on the table above."
  141.   echo
  142.   echo "Now just go ahead and log in, run the 'setup' program and give it"
  143.   echo "the same partition that you used here for your swap space."
  144.   echo
  145.   echo -n "Press ENTER to continue." 
  146.   read junk;
  147.   echo
  148.  fi
  149. fi
  150.