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

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

Updates to bootscripts

  • Property mode set to 100755
File size: 1.8 KB
RevLine 
[a44b91b]1#!/bin/ash
2
3# System Startup Script
4#
5. /etc/rc.d/init.d/functions
6
[ae024d6]7/bin/mount -t proc proc /proc
8/bin/mount -t sysfs none /sys
9/bin/mount -o remount,rw /
[9c1d1fa]10/bin/mount -t tmpfs -o mode=0755 udev /dev
[c25b963]11/bin/mkdir /dev/pts
12/bin/mkdir /dev/shm
[9c1d1fa]13/bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
[ae024d6]14/sbin/mdev -s
15
[a44b91b]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
[b9cef84]83echo "Running start scripts."
[a44b91b]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.