#! /bin/sh #---------------------------------------------------------------------------- # /etc/init.d/boot - initial boot script # # Creation: 08.08.2001 fm # Last Update: $Id$ # # Copyright (c) 2001-2004 Frank Meyer # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- /usr/local/bin/colecho "Running $0" gn PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin; export PATH . /etc/config.d/base #---------------------------------------------------------------------------- # mount devices, e.g. /proc #---------------------------------------------------------------------------- cd / swapon -a /bin/mount -n -o remount,ro / 2>/dev/null if [ $? -eq 0 ] then echo "Checking file systems..." /sbin/fsck -A -p 2>/dev/null if [ $? -gt 1 ] then echo echo "fsck failed. Please repair manually and reboot. The root" echo "file system is currently mounted read-only. To remount it" echo "read-write do:" echo echo " bash# mount -n -o remount,rw /" echo echo "Attention: Only CONTROL-D will reboot the system in this" echo "maintanance mode. shutdown or reboot will not work." echo PS1="(repair filesystem) # " export PS1 /bin/sh /dev/console 2>&1 # if the user has mounted something rw, this should be umounted echo "Unmounting file systems (ignore error messages)" /bin/umount -avn # on umsdos fs this would lead to an error message. so direct # errors to /dev/null /bin/mount -no remount,ro / 2> /dev/null /bin/sync /sbin/reboot -f fi fi for j in /var/boot-ext/* do if [ -f $j ] then /bin/sh $j fi done /bin/sync /bin/umount /initrd 2>/dev/null /bin/mount /proc 2>/dev/null # mount /proc /bin/mount -n -o remount,rw / # remount read-write rm -f /etc/mtab /etc/mtab~ # remove old mtabs rm -f /var/boot-ext/* #grep -v '^rootfs' /proc/mounts >/etc/mtab # copy from /proc/mounts /bin/mount -av 2>/dev/null # mount rest chmod 644 /etc/mtab # set permission if [ -d /etc/init.d/boot.d ] then for j in /etc/init.d/boot.d/S* # start cleanup scripts do if [ -x $j ] then $j start fi done fi # set hostname /bin/hostname $HOSTNAME # apply environment /bin/sh /var/install/config.d/environment.sh case "$TIME_ZONE" in met|cet|CET) TIME_ZONE='CET';; # compatibility gmt|GMT) TIME_ZONE='GMT';; esac /usr/sbin/zic -l $TIME_ZONE # set TIME_ZONE