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

Last change on this file since 8172859 was 8172859, checked in by Maarten Lankhorst <mlankhorst@…>, 15 years ago

bootscripts: Ignore unknown executables

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/ash
2
3# System Startup Script
4#
5. /etc/rc.d/init.d/functions
6
7/bin/mount -t proc none /proc
8/bin/mount -t sysfs none /sys
9/bin/mount -t tmpfs -o mode=0755 none /dev
10/bin/mkdir /dev/pts
11/bin/mkdir /dev/shm
12/bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
13/sbin/mdev -s
14
15if [ -x /sbin/hwclock ]; then
16 echo -n "Setting system clock: "
17 hwclock --hctosys --utc
18 check_status
19fi
20
21if [ -x /sbin/fsck ]; then
22 echo "Starting fsck for root filesystem."
23 fsck -T -C /
24 if [ "$?" -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
29 elif [ "$?" = "2" ]; then
30 echo "NOTICE: System needs to be rebooted now."
31 sleep 1
32 reboot
33 else
34 echo -n "Checking root filesystem: "
35 check_status
36 fi
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
63if [ -x /sbin/swapon ]; then
64 echo -n "Enabling swap space: "
65 swapon -a
66 check_status
67fi
68
69echo -n "Setting hostname: "
70hostname -F /etc/HOSTNAME
71check_status
72
73echo -n "Cleaning up system: "
74> /var/run/utmp
75touch /var/log/wtmp
76touch /var/log/messages
77chmod 0664 /var/run/utmp
78chmod 0664 /var/log/wtmp
79chmod 0660 /var/log/messages
80rm -rf /tmp/*
81rm -f /var/run/*.pid
82check_status
83
84echo -n "Setting up interface lo: "
85ifconfig lo up 127.0.0.1
86check_status
87
88echo "Running start scripts."
89
90for i in /etc/rc.d/start/*
91do
92 if [ -x $i ]; then
93 $i start
94 fi
95done
Note: See TracBrowser for help on using the repository browser.