source: bootscripts-embedded/clfs/rc.d/startup@ f25bf53

Last change on this file since f25bf53 was f25bf53, checked in by Jim Gifford <clfs@…>, 16 years ago

Formatting change to embedded

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