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

Last change on this file since 2255872 was 2255872, checked in by Andrew Bradford <andrew@…>, 11 years ago

startup: Don't mount /var as tmpfs

We create the /var and subdirectories in the book, there's no need to
make them tmpfs in startupscripts.

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