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

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

startup/shutdown: Use /dev/rtc0

The first RTC will be number 0.

  • Property mode set to 100755
File size: 1.6 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
[3a3ba03]23if [ -x /sbin/hwclock ] && [ -e /dev/rtc0 ]; then
[292c832]24 echo -n "Setting system clock: "
25 hwclock --hctosys --utc
26 check_status
[97ad60e]27fi
28
[292c832]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
[97ad60e]46
47
[292c832]48if [ -x /sbin/swapon ]; then
49 echo -n "Enabling swap space: "
50 swapon -a
51 check_status
[97ad60e]52fi
53
[292c832]54echo -n "Remounting root rw: "
55mount -o remount,rw /
[97ad60e]56check_status
57
[e0e7d60]58echo -n "Linking /var/tmp and /tmp: "
59ln -s ../tmp /var/tmp
60check_status
61
[97ad60e]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
[292c832]83for i in /etc/rc.d/start/*
84do
85 if [ -x $i ]; then
86 $i start
87 fi
[97ad60e]88done
[292c832]89
90exit 0
Note: See TracBrowser for help on using the repository browser.