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

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

Added udev to startup script

  • Property mode set to 100755
File size: 2.2 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 "Mounting dev: ""
19mount -n -t tmpfs -o mode=0755 udev /dev
20check_status
21echo -n "Copying static devices to dev: "
22cp --preserve=all --recursive --remove-destination /lib/udev/devices/* /dev
23check_status
24chmod 1777 /dev/shm
25echo "" > /sys/kernel/uevent_helper
26echo -n "Starting udev daemon: "
27/sbin/udevd --daemon
28check_status
29mkdir -p /dev/.udev/queue
30echo -n "Populating dev: "
31/sbin/udevtrigger
32check_status
33echo -n "Waiting for udev to finish: "
34/sbin/udevsettle
35check_status
36
37echo -n "Setting system clock: "
38hwclock --hctosys --utc
39check_status
40
41echo "Starting fsck for root filesystem."
42fsck -T -C /
43if [ "$?" -gt 2 ]; then
44 echo "WARNING: Errors found while checking root filesystem."
45 echo "You can login as root now, the system will reboot after logout."
46 sulogin
47 reboot
48elif [ "$?" = "2" ]; then
49 echo "NOTICE: System needs to be rebooted now."
50 sleep 1
51 reboot
52else
53 echo -n "Checking root filesystem: "
54 check_status
55fi
56
57echo -n "Remounting root rw: "
58mount -o remount,rw /
59check_status
60
61echo -n "Mounting devpts: "
62mount /dev/pts
63check_status
64
65echo "Starting fsck for local filesystems."
66fsck -A -C -R -T -t nonfs,nosmbfs
67if [ "$?" -gt 2 ]; then
68 echo "WARNING: Errors found while checking filesystems."
69 echo "You can login as root now, the system will reboot after logout."
70 sulogin
71 reboot
72elif [ "$?" = "2" ]; then
73 echo "NOTICE: System needs to be rebooted now."
74 sleep 1
75 reboot
76else
77 echo -n "Checking local filesystems: "
78 check_status
79fi
80
81echo -n "Enabling swap space: "
82swapon -a
83check_status
84
85echo -n "Setting hostname: "
86hostname -F /etc/HOSTNAME
87check_status
88
89echo -n "Cleaning up system: "
90> /var/run/utmp
91touch /var/log/wtmp
92touch /var/log/messages
93chmod 0664 /var/run/utmp
94chmod 0664 /var/log/wtmp
95chmod 0660 /var/log/messages
96rm -rf /tmp/*
97rm -f /var/run/*.pid
98check_status
99
100echo -n "Setting up interface lo: "
101ifconfig lo up 127.0.0.1
102check_status
103
104echo "Running local start scripts."
105
106for i in /etc/rc.d/start/*
107do
108 if [ -x $i ]; then
109 $i start
110 fi
111done
Note: See TracBrowser for help on using the repository browser.