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

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

Bootscript Updates

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