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

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

Updates to bootscripts

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