source: clfs-embedded/bootscripts/clfs/etc/rc.d/startup @ 74f852a

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

Updates to CLFS 3 Bootscripts

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