home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / armlinux / alpha / PARTITIONS / ROOT_GZ / root / etc / rc.d / rc.S < prev    next >
Encoding:
Text File  |  1995-06-10  |  2.7 KB  |  98 lines

  1. #!/bin/sh
  2. #
  3. # /etc/rc
  4. #
  5. # These commands are executed at boot time by init(8).
  6. # User customization should go in /etc/rc.local.
  7.  
  8. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  9.  
  10. # enable swapping
  11. /sbin/swapon -a
  12.  
  13. # load fpe as soon as possible
  14. /sbin/insmod /boot/modules/fpem.o licence=0
  15.  
  16. # Start update.
  17. /sbin/update
  18.  
  19. # Test to see if the root partition is read-only, like it ought to be.
  20. READWRITE=no
  21. if echo -n >> "Testing filesystem status"; then
  22.  rm -f "Testing filesystem status"
  23.  READWRITE=yes
  24. fi
  25.  
  26. # Check the integrity of all filesystems
  27. if [ ! $READWRITE = yes ]; then
  28.  /sbin/fsck -A -a
  29.  # If there was a failure, drop into single-user mode.
  30.  if [ $? -gt 1 ] ; then
  31.   echo
  32.   echo
  33.   echo "**************************************"
  34.   echo "fsck returned error code - REBOOT NOW!"
  35.   echo "**************************************"
  36.   echo
  37.   echo
  38.   /bin/login
  39.  fi
  40.  # Remount the root filesystem in read-write mode
  41.  echo "Remounting root device with read-write enabled."
  42.  /sbin/mount -w -n -o remount /
  43. else
  44.  cat << EOF
  45.  
  46. *** Root partition has already been mounted read-write. Cannot check!
  47. For filesystem checking to work properly, your system must initially mount
  48. the root partition as read only. Please modify your kernel with 'rdev' so that
  49. it does this. If you're booting with LILO, type:
  50.   rdev -R /vmlinuz 1
  51.          (^^^^^^^^  ... or whatever your kernel name is.)
  52.  
  53. If you boot from a kernel on a floppy disk, put it in the drive and type:
  54.   rdev -R /dev/fd0 1
  55.  
  56. This will fix the problem *AND* eliminate this annoying message. :^)
  57.  
  58. EOF
  59.  sleep 10
  60. fi
  61.  
  62. # remove /etc/mtab* so that mount will create it with a root entry
  63. /bin/rm -f /etc/mtab* /etc/nologin /var/adm/utmp
  64. /bin/rm -f /etc/inetd.pid /var/run/syslog.pid
  65.  
  66. # Looks like we have to create this.
  67. touch /var/adm/utmp
  68.  
  69. # mount file systems in fstab (and create an entry for /)
  70. # but not NFS because TCP/IP is not yet configured
  71. /sbin/mount -avt nonfs
  72.  
  73. # clear /tmp
  74. #rm -rf /tmp/*
  75. chmod 777 /tmp
  76.  
  77. # Configure the system clock.
  78. # This can be changed if your system keeps GMT.
  79. if [ -x /sbin/clock ]; then
  80.   /sbin/clock -s -u
  81. fi
  82.  
  83. # Setup the /etc/issue and /etc/motd to reflect the current kernel level:
  84. # THESE WIPE ANY CHANGES YOU MAKE TO /ETC/ISSUE AND /ETC/MOTD WITH EACH
  85. # BOOT. COMMENT THEM OUT IF YOU WANT TO MAKE CUSTOM VERSIONS.
  86. #echo > /etc/issue
  87. #echo Welcome to Linux `/bin/uname -a | /bin/cut -d\  -f3`. >> /etc/issue
  88. #echo >> /etc/issue
  89. #echo "`/bin/uname -a | /bin/cut -d\  -f1,3`. (Posix)." > /etc/motd
  90. cat /proc/version > /etc/motd
  91.  
  92. # Set up the serial ports.
  93. # This made a couple machines I tested this on hang at this point in the boot
  94. # process, so it's getting commented out by default. However, if you need to
  95. # set up extended serial ports try it out. It usually works great.
  96. #/bin/sh /etc/rc.d/rc.serial
  97.  
  98.