[a44b91b] | 1 | #!/bin/ash
|
---|
| 2 |
|
---|
| 3 | # System Startup Script
|
---|
| 4 | #
|
---|
| 5 | . /etc/rc.d/init.d/functions
|
---|
| 6 |
|
---|
[a0038b3] | 7 | /bin/mount -t tmpfs /tmp /tmp
|
---|
[aea05b2] | 8 | /bin/mount -t proc none /proc
|
---|
[ae024d6] | 9 | /bin/mount -t sysfs none /sys
|
---|
[aea05b2] | 10 | /bin/mount -t tmpfs -o mode=0755 none /dev
|
---|
[c25b963] | 11 | /bin/mkdir /dev/pts
|
---|
| 12 | /bin/mkdir /dev/shm
|
---|
[9c1d1fa] | 13 | /bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
|
---|
[1933be2] | 14 |
|
---|
| 15 | echo -n "Starting mdev: "
|
---|
[ae024d6] | 16 | /sbin/mdev -s
|
---|
[1933be2] | 17 | check_status
|
---|
| 18 |
|
---|
| 19 | echo -n "Mounting devpts: "
|
---|
| 20 | mount /dev/pts
|
---|
| 21 | check_status
|
---|
[ae024d6] | 22 |
|
---|
[1933be2] | 23 | if [ -x /sbin/hwclock ] && [ -e /dev/rtc ]; then
|
---|
[8172859] | 24 | echo -n "Setting system clock: "
|
---|
| 25 | hwclock --hctosys --utc
|
---|
[a44b91b] | 26 | check_status
|
---|
| 27 | fi
|
---|
| 28 |
|
---|
[8172859] | 29 | if [ -x /sbin/fsck ]; then
|
---|
[1933be2] | 30 | echo "Starting fsck for local filesystems."
|
---|
| 31 | fsck -A -C -R -T -t nonfs,nosmbfs
|
---|
[8172859] | 32 | if [ "$?" -gt 2 ]; then
|
---|
[1933be2] | 33 | echo "WARNING: Errors found while checking filesystems."
|
---|
[8172859] | 34 | echo "You can login as root now, the system will reboot after logout."
|
---|
| 35 | sulogin
|
---|
| 36 | reboot
|
---|
| 37 | elif [ "$?" = "2" ]; then
|
---|
| 38 | echo "NOTICE: System needs to be rebooted now."
|
---|
| 39 | sleep 1
|
---|
| 40 | reboot
|
---|
| 41 | else
|
---|
[1933be2] | 42 | echo -n "Checking local filesystems: "
|
---|
[8172859] | 43 | check_status
|
---|
| 44 | fi
|
---|
| 45 | fi
|
---|
| 46 |
|
---|
[a44b91b] | 47 |
|
---|
[8172859] | 48 | if [ -x /sbin/swapon ]; then
|
---|
| 49 | echo -n "Enabling swap space: "
|
---|
| 50 | swapon -a
|
---|
| 51 | check_status
|
---|
| 52 | fi
|
---|
[a44b91b] | 53 |
|
---|
[1933be2] | 54 | echo -n "Remounting root rw: "
|
---|
| 55 | mount -o remount,rw /
|
---|
| 56 | check_status
|
---|
| 57 |
|
---|
[a44b91b] | 58 | echo -n "Setting hostname: "
|
---|
| 59 | hostname -F /etc/HOSTNAME
|
---|
| 60 | check_status
|
---|
| 61 |
|
---|
| 62 | echo -n "Cleaning up system: "
|
---|
| 63 | > /var/run/utmp
|
---|
| 64 | touch /var/log/wtmp
|
---|
| 65 | touch /var/log/messages
|
---|
| 66 | chmod 0664 /var/run/utmp
|
---|
| 67 | chmod 0664 /var/log/wtmp
|
---|
| 68 | chmod 0660 /var/log/messages
|
---|
| 69 | rm -rf /tmp/*
|
---|
| 70 | rm -f /var/run/*.pid
|
---|
| 71 | check_status
|
---|
| 72 |
|
---|
| 73 | echo -n "Setting up interface lo: "
|
---|
| 74 | ifconfig lo up 127.0.0.1
|
---|
| 75 | check_status
|
---|
| 76 |
|
---|
[b9cef84] | 77 | echo "Running start scripts."
|
---|
[a44b91b] | 78 |
|
---|
| 79 | for i in /etc/rc.d/start/*
|
---|
| 80 | do
|
---|
| 81 | if [ -x $i ]; then
|
---|
| 82 | $i start
|
---|
| 83 | fi
|
---|
| 84 | done
|
---|
[1933be2] | 85 |
|
---|
| 86 | exit 0
|
---|