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

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

bootscripts: mount /var on tmpfs

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