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

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

startup: Mount /dev/shm

  • Property mode set to 100755
File size: 1.7 KB
RevLine 
[97ad60e]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
[292c832]9/bin/mount -t tmpfs /tmp /tmp
[97ad60e]10/bin/mkdir /dev/pts
11/bin/mkdir /dev/shm
[292c832]12
[97ad60e]13/bin/echo "/sbin/mdev" > /proc/sys/kernel/hotplug
[292c832]14
15echo -n "Starting mdev: "
[97ad60e]16/sbin/mdev -s
[292c832]17check_status
[97ad60e]18
[292c832]19echo -n "Mounting devpts: "
20mount /dev/pts
[97ad60e]21check_status
22
[6394df1]23echo -n "Mounting shared memory: "
24/bin/mount -t tmpfs none /dev/shm
25check_status
26
[3a3ba03]27if [ -x /sbin/hwclock ] && [ -e /dev/rtc0 ]; then
[292c832]28 echo -n "Setting system clock: "
29 hwclock --hctosys --utc
30 check_status
[97ad60e]31fi
32
[292c832]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
[97ad60e]50
51
[292c832]52if [ -x /sbin/swapon ]; then
53 echo -n "Enabling swap space: "
54 swapon -a
55 check_status
[97ad60e]56fi
57
[292c832]58echo -n "Remounting root rw: "
59mount -o remount,rw /
[97ad60e]60check_status
61
[e0e7d60]62echo -n "Linking /var/tmp and /tmp: "
63ln -s ../tmp /var/tmp
64check_status
65
[97ad60e]66echo -n "Setting hostname: "
67hostname -F /etc/HOSTNAME
68check_status
69
70echo -n "Cleaning up system: "
71> /var/run/utmp
72touch /var/log/wtmp
73touch /var/log/messages
74chmod 0664 /var/run/utmp
75chmod 0664 /var/log/wtmp
76chmod 0660 /var/log/messages
77rm -rf /tmp/*
78rm -f /var/run/*.pid
79check_status
80
81echo -n "Setting up interface lo: "
82ifconfig lo up 127.0.0.1
83check_status
84
85echo "Running start scripts."
86
[292c832]87for i in /etc/rc.d/start/*
88do
89 if [ -x $i ]; then
90 $i start
91 fi
[97ad60e]92done
[292c832]93
94exit 0
Note: See TracBrowser for help on using the repository browser.