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

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

bootscripts: Updates, and add a network bridge startup file

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