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

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

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