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

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

bootscripts: make /tmp mounted at start

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