summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-09-02 14:00:52 +0000
committerRichard Purdie <richard@openedhand.com>2007-09-02 14:00:52 +0000
commit1cf731b1e3bb125449c2ef4e1194b6bf69e7b667 (patch)
treefc305d382d225d9a033fb1678bdc4720f38484e4
parent3cb6c768efa690f25035351fb7975bca59f94ee2 (diff)
downloadpoky-1cf731b1e3bb125449c2ef4e1194b6bf69e7b667.tar.gz
initscripts: Sync with OE, primarily for better /etc/timestamp handling
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2650 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/bootmisc.sh15
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/devices3
-rw-r--r--meta/packages/initscripts/initscripts-1.0/functions17
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/halt6
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/jornada6xx/checkroot.sh211
-rw-r--r--meta/packages/initscripts/initscripts-1.0/jornada6xx/devices7
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/jornada7xx/checkroot.sh211
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/jornada7xx/devices81
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/openzaurus/checkversion31
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/ramdisk3
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/reboot6
-rw-r--r--meta/packages/initscripts/initscripts-1.0/save-rtc.sh17
-rw-r--r--meta/packages/initscripts/initscripts_1.0.bb57
13 files changed, 539 insertions, 126 deletions
diff --git a/meta/packages/initscripts/initscripts-1.0/bootmisc.sh b/meta/packages/initscripts/initscripts-1.0/bootmisc.sh
index 814dba676c..2a40e0c410 100755
--- a/meta/packages/initscripts/initscripts-1.0/bootmisc.sh
+++ b/meta/packages/initscripts/initscripts-1.0/bootmisc.sh
@@ -61,11 +61,18 @@ fi
61# 61#
62/sbin/ldconfig 62/sbin/ldconfig
63 63
64# 64# Set the system clock from hardware clock
65# Recover the time, if there is a time file 65# If the timestamp is 1 day or more recent than the current time,
66# 66# use the timestamp instead.
67/etc/init.d/hwclock.sh start
67if test -e /etc/timestamp 68if test -e /etc/timestamp
68then 69then
69 date -s `cat /etc/timestamp` 70 SYSTEMDATE=`date "+%Y%m%d"`
71 TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'`
72 NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)`
73 if [ $NEEDUPDATE -eq 1 ]; then
74 date `cat /etc/timestamp`
75 /etc/init.d/hwclock.sh stop
76 fi
70fi 77fi
71: exit 0 78: exit 0
diff --git a/meta/packages/initscripts/initscripts-1.0/devices b/meta/packages/initscripts/initscripts-1.0/devices
index 28fb71fe3f..67a2ec8092 100755
--- a/meta/packages/initscripts/initscripts-1.0/devices
+++ b/meta/packages/initscripts/initscripts-1.0/devices
@@ -6,7 +6,7 @@
6. /etc/default/rcS 6. /etc/default/rcS
7 7
8# exit without doing anything if udev is active 8# exit without doing anything if udev is active
9if test -e /dev/.udevdb; then 9if test -e /dev/.udev -o -e /dev/.udevdb; then
10 exit 0 10 exit 0
11fi 11fi
12 12
@@ -50,6 +50,7 @@ else
50 mkdir -p dev/msys 50 mkdir -p dev/msys
51 mkdir -p dev/pts 51 mkdir -p dev/pts
52 mkdir -p dev/vc 52 mkdir -p dev/vc
53 mkdir -p dev/snd
53 for i in 0 1 2 3 4 5 6 7 8 9; do 54 for i in 0 1 2 3 4 5 6 7 8 9; do
54 ln -s /dev/tty$i /dev/vc/$i 55 ln -s /dev/tty$i /dev/vc/$i
55 done 56 done
diff --git a/meta/packages/initscripts/initscripts-1.0/functions b/meta/packages/initscripts/initscripts-1.0/functions
new file mode 100644
index 0000000000..358fc6edb3
--- /dev/null
+++ b/meta/packages/initscripts/initscripts-1.0/functions
@@ -0,0 +1,17 @@
1# -*-Shell-script-*-
2#
3# functions This file contains functions to be used by most or all
4# shell scripts in the /etc/init.d directory.
5#
6
7cpuinfo_id() { # return the Hardware module ID
8 awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
9}
10
11killproc() { # kill the named process(es)
12 pid=`/bin/ps -e x |
13 /bin/grep $1 |
14 /bin/grep -v grep |
15 /bin/sed -e 's/^ *//' -e 's/ .*//'`
16 [ "$pid" != "" ] && kill $pid
17}
diff --git a/meta/packages/initscripts/initscripts-1.0/halt b/meta/packages/initscripts/initscripts-1.0/halt
index aa1769606a..d8cab222ca 100755
--- a/meta/packages/initscripts/initscripts-1.0/halt
+++ b/meta/packages/initscripts/initscripts-1.0/halt
@@ -7,12 +7,6 @@
7 7
8PATH=/sbin:/bin:/usr/sbin:/usr/bin 8PATH=/sbin:/bin:/usr/sbin:/usr/bin
9 9
10# Update the timestamp, if there is already one
11if test -e /etc/timestamp
12then
13 date +%2m%2d%2H%2M%Y > /etc/timestamp
14fi
15
16# See if we need to cut the power. 10# See if we need to cut the power.
17if test -x /etc/init.d/ups-monitor 11if test -x /etc/init.d/ups-monitor
18then 12then
diff --git a/meta/packages/initscripts/initscripts-1.0/jornada6xx/checkroot.sh b/meta/packages/initscripts/initscripts-1.0/jornada6xx/checkroot.sh
new file mode 100755
index 0000000000..9e2d3cfc85
--- /dev/null
+++ b/meta/packages/initscripts/initscripts-1.0/jornada6xx/checkroot.sh
@@ -0,0 +1,211 @@
1#
2# checkroot.sh Check to root filesystem.
3#
4# Version: @(#)checkroot.sh 2.84 25-Jan-2002 miquels@cistron.nl
5#
6
7. /etc/default/rcS
8
9#
10# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
11# from this script *before anything else* with a timeout, like SCO does.
12#
13test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
14
15#
16# Ensure that bdflush (update) is running before any major I/O is
17# performed (the following fsck is a good example of such activity :).
18#
19test -x /sbin/update && update
20
21#
22# Read /etc/fstab.
23#
24exec 9>&0 </etc/fstab
25rootmode=rw
26rootopts=rw
27test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no"
28swap_on_md=no
29devfs=
30while read fs mnt type opts dump pass junk
31do
32 case "$fs" in
33 ""|\#*)
34 continue;
35 ;;
36 /dev/md*)
37 # Swap on md device.
38 test "$type" = swap && swap_on_md=yes
39 ;;
40 /dev/*)
41 ;;
42 *)
43 # Might be a swapfile.
44 test "$type" = swap && swap_on_md=yes
45 ;;
46 esac
47
48 test "$type" = devfs && devfs="$fs"
49
50 # Currently we do not care about the other entries
51 if test "$mnt" = "/"
52 then
53 #echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]"
54
55 rootopts="$opts"
56 roottype="$type"
57
58 #The "spinner" is broken on busybox sh
59 TERM=dumb
60
61 test "$pass" = 0 -o "$pass" = "" && rootcheck=no
62
63 # Enable fsck for ext2 and ext3 rootfs, disable for everything else
64 case "$type" in
65 ext3) rootcheck=yes;;
66 *) rootcheck=no;;
67 esac
68
69 if test "$rootcheck" = yes
70 then
71 if ! test -x "/sbin/fsck.${roottype}"
72 then
73 echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n"
74 rootcheck=no
75 fi
76 fi
77
78 case "$opts" in
79 ro|ro,*|*,ro|*,ro,*)
80 rootmode=ro
81 ;;
82 esac
83 fi
84done
85exec 0>&9 9>&-
86
87#
88# Activate the swap device(s) in /etc/fstab. This needs to be done
89# before fsck, since fsck can be quite memory-hungry.
90#
91doswap=no
92test -d /proc/1 || mount -n /proc
93case "`uname -r`" in
94 2.[0123].*)
95 if test $swap_on_md = yes && grep -qs resync /proc/mdstat
96 then
97 test "$VERBOSE" != no && echo "Not activating swap - RAID array resyncing"
98 else
99 doswap=yes
100 fi
101 ;;
102 *)
103 doswap=yes
104 ;;
105esac
106if test $doswap = yes
107then
108 test "$VERBOSE" != no && echo "Activating swap"
109 swapon -a 2> /dev/null
110fi
111
112#
113# Check the root filesystem.
114#
115if test -f /fastboot || test $rootcheck = no
116then
117 test $rootcheck = yes && echo "Fast boot, no filesystem check"
118else
119 #
120 # Ensure that root is quiescent and read-only before fsck'ing.
121 #
122 mount -n -o remount,ro /
123 if test $? = 0
124 then
125 if test -f /forcefsck
126 then
127 force="-f"
128 else
129 force=""
130 fi
131 if test "$FSCKFIX" = yes
132 then
133 fix="-y"
134 else
135 fix="-a"
136 fi
137 spinner="-C"
138 case "$TERM" in
139 dumb|network|unknown|"") spinner="" ;;
140 esac
141 test `uname -m` = s390 && spinner="" # This should go away
142 test "$VERBOSE" != no && echo "Checking root filesystem..."
143 fsck $spinner $force $fix /
144 #
145 # If there was a failure, drop into single-user mode.
146 #
147 # NOTE: "failure" is defined as exiting with a return code of
148 # 2 or larger. A return code of 1 indicates that filesystem
149 # errors were corrected but that the boot may proceed.
150 #
151 if test "$?" -gt 1
152 then
153
154 # Since this script is run very early in the boot-process, it should be safe to assume that the
155 # output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot
156 # messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal
157 chvt 1
158
159 # Surprise! Re-directing from a HERE document (as in
160 # "cat << EOF") won't work, because the root is read-only.
161 echo
162 echo "fsck failed. Please repair manually and reboot. Please note"
163 echo "that the root filesystem is currently mounted read-only. To"
164 echo "remount it read-write:"
165 echo
166 echo " # mount -n -o remount,rw /"
167 echo
168 echo "CONTROL-D will exit from this shell and REBOOT the system."
169 echo
170 # Start a single user shell on the console
171 /sbin/sulogin $CONSOLE
172 reboot -f
173 fi
174 else
175 echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
176 echo
177 fi
178fi
179
180#
181# If the root filesystem was not marked as read-only in /etc/fstab,
182# remount the rootfs rw but do not try to change mtab because it
183# is on a ro fs until the remount succeeded. Then clean up old mtabs
184# and finally write the new mtab.
185# This part is only needed if the rootfs was mounted ro.
186#
187if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then
188 exit 0
189fi
190
191# Add a second check, which seems to be needed for some kernel versions
192if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then
193 exit 0
194fi
195
196
197echo "Remounting root file system..."
198mount -n -o remount,$rootmode /
199if test "$rootmode" = rw
200then
201 if test ! -L /etc/mtab
202 then
203 rm -f /etc/mtab~ /etc/nologin
204 : > /etc/mtab
205 fi
206 mount -f -o remount /
207 mount -f /proc
208 test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
209fi
210
211: exit 0
diff --git a/meta/packages/initscripts/initscripts-1.0/jornada6xx/devices b/meta/packages/initscripts/initscripts-1.0/jornada6xx/devices
index fc96ff62ee..5ca2a1ccef 100644
--- a/meta/packages/initscripts/initscripts-1.0/jornada6xx/devices
+++ b/meta/packages/initscripts/initscripts-1.0/jornada6xx/devices
@@ -22,9 +22,6 @@ then
22 ln -s /dev/vc/4 /dev/tty4 22 ln -s /dev/vc/4 /dev/tty4
23 ln -s /dev/vc/5 /dev/tty5 23 ln -s /dev/vc/5 /dev/tty5
24 ln -s /dev/fb/0 /dev/fb0 24 ln -s /dev/fb/0 /dev/fb0
25# ln -s /dev/tts/0 /dev/ttySA0
26# ln -s /dev/tts/1 /dev/ttySA1
27# ln -s /dev/tts/2 /dev/ttySA2
28 25
29 ln -s /dev/sound/dsp /dev/dsp 26 ln -s /dev/sound/dsp /dev/dsp
30 ln -s /dev/sound/mixer /dev/mixer 27 ln -s /dev/sound/mixer /dev/mixer
@@ -49,8 +46,12 @@ else
49 cd / 46 cd /
50 mkdir -p dev/input 47 mkdir -p dev/input
51 mknod /dev/input/ts0 c 13 128 48 mknod /dev/input/ts0 c 13 128
49 mknod /dev/ttySC0 c 8 204
52 mknod /dev/ttySC1 c 9 204 50 mknod /dev/ttySC1 c 9 204
51 mknod /dev/ttySC2 c 10 204
52
53 mknod /dev/irda0 c 10 204 53 mknod /dev/irda0 c 10 204
54
54 mkdir -p dev/msys 55 mkdir -p dev/msys
55 mkdir -p dev/pts 56 mkdir -p dev/pts
56 mkdir -p dev/vc 57 mkdir -p dev/vc
diff --git a/meta/packages/initscripts/initscripts-1.0/jornada7xx/checkroot.sh b/meta/packages/initscripts/initscripts-1.0/jornada7xx/checkroot.sh
new file mode 100755
index 0000000000..9e2d3cfc85
--- /dev/null
+++ b/meta/packages/initscripts/initscripts-1.0/jornada7xx/checkroot.sh
@@ -0,0 +1,211 @@
1#
2# checkroot.sh Check to root filesystem.
3#
4# Version: @(#)checkroot.sh 2.84 25-Jan-2002 miquels@cistron.nl
5#
6
7. /etc/default/rcS
8
9#
10# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
11# from this script *before anything else* with a timeout, like SCO does.
12#
13test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
14
15#
16# Ensure that bdflush (update) is running before any major I/O is
17# performed (the following fsck is a good example of such activity :).
18#
19test -x /sbin/update && update
20
21#
22# Read /etc/fstab.
23#
24exec 9>&0 </etc/fstab
25rootmode=rw
26rootopts=rw
27test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no"
28swap_on_md=no
29devfs=
30while read fs mnt type opts dump pass junk
31do
32 case "$fs" in
33 ""|\#*)
34 continue;
35 ;;
36 /dev/md*)
37 # Swap on md device.
38 test "$type" = swap && swap_on_md=yes
39 ;;
40 /dev/*)
41 ;;
42 *)
43 # Might be a swapfile.
44 test "$type" = swap && swap_on_md=yes
45 ;;
46 esac
47
48 test "$type" = devfs && devfs="$fs"
49
50 # Currently we do not care about the other entries
51 if test "$mnt" = "/"
52 then
53 #echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]"
54
55 rootopts="$opts"
56 roottype="$type"
57
58 #The "spinner" is broken on busybox sh
59 TERM=dumb
60
61 test "$pass" = 0 -o "$pass" = "" && rootcheck=no
62
63 # Enable fsck for ext2 and ext3 rootfs, disable for everything else
64 case "$type" in
65 ext3) rootcheck=yes;;
66 *) rootcheck=no;;
67 esac
68
69 if test "$rootcheck" = yes
70 then
71 if ! test -x "/sbin/fsck.${roottype}"
72 then
73 echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n"
74 rootcheck=no
75 fi
76 fi
77
78 case "$opts" in
79 ro|ro,*|*,ro|*,ro,*)
80 rootmode=ro
81 ;;
82 esac
83 fi
84done
85exec 0>&9 9>&-
86
87#
88# Activate the swap device(s) in /etc/fstab. This needs to be done
89# before fsck, since fsck can be quite memory-hungry.
90#
91doswap=no
92test -d /proc/1 || mount -n /proc
93case "`uname -r`" in
94 2.[0123].*)
95 if test $swap_on_md = yes && grep -qs resync /proc/mdstat
96 then
97 test "$VERBOSE" != no && echo "Not activating swap - RAID array resyncing"
98 else
99 doswap=yes
100 fi
101 ;;
102 *)
103 doswap=yes
104 ;;
105esac
106if test $doswap = yes
107then
108 test "$VERBOSE" != no && echo "Activating swap"
109 swapon -a 2> /dev/null
110fi
111
112#
113# Check the root filesystem.
114#
115if test -f /fastboot || test $rootcheck = no
116then
117 test $rootcheck = yes && echo "Fast boot, no filesystem check"
118else
119 #
120 # Ensure that root is quiescent and read-only before fsck'ing.
121 #
122 mount -n -o remount,ro /
123 if test $? = 0
124 then
125 if test -f /forcefsck
126 then
127 force="-f"
128 else
129 force=""
130 fi
131 if test "$FSCKFIX" = yes
132 then
133 fix="-y"
134 else
135 fix="-a"
136 fi
137 spinner="-C"
138 case "$TERM" in
139 dumb|network|unknown|"") spinner="" ;;
140 esac
141 test `uname -m` = s390 && spinner="" # This should go away
142 test "$VERBOSE" != no && echo "Checking root filesystem..."
143 fsck $spinner $force $fix /
144 #
145 # If there was a failure, drop into single-user mode.
146 #
147 # NOTE: "failure" is defined as exiting with a return code of
148 # 2 or larger. A return code of 1 indicates that filesystem
149 # errors were corrected but that the boot may proceed.
150 #
151 if test "$?" -gt 1
152 then
153
154 # Since this script is run very early in the boot-process, it should be safe to assume that the
155 # output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot
156 # messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal
157 chvt 1
158
159 # Surprise! Re-directing from a HERE document (as in
160 # "cat << EOF") won't work, because the root is read-only.
161 echo
162 echo "fsck failed. Please repair manually and reboot. Please note"
163 echo "that the root filesystem is currently mounted read-only. To"
164 echo "remount it read-write:"
165 echo
166 echo " # mount -n -o remount,rw /"
167 echo
168 echo "CONTROL-D will exit from this shell and REBOOT the system."
169 echo
170 # Start a single user shell on the console
171 /sbin/sulogin $CONSOLE
172 reboot -f
173 fi
174 else
175 echo "*** ERROR! Cannot fsck root fs because it is not mounted read-only!"
176 echo
177 fi
178fi
179
180#
181# If the root filesystem was not marked as read-only in /etc/fstab,
182# remount the rootfs rw but do not try to change mtab because it
183# is on a ro fs until the remount succeeded. Then clean up old mtabs
184# and finally write the new mtab.
185# This part is only needed if the rootfs was mounted ro.
186#
187if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then
188 exit 0
189fi
190
191# Add a second check, which seems to be needed for some kernel versions
192if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then
193 exit 0
194fi
195
196
197echo "Remounting root file system..."
198mount -n -o remount,$rootmode /
199if test "$rootmode" = rw
200then
201 if test ! -L /etc/mtab
202 then
203 rm -f /etc/mtab~ /etc/nologin
204 : > /etc/mtab
205 fi
206 mount -f -o remount /
207 mount -f /proc
208 test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
209fi
210
211: exit 0
diff --git a/meta/packages/initscripts/initscripts-1.0/jornada7xx/devices b/meta/packages/initscripts/initscripts-1.0/jornada7xx/devices
index 0e59229225..422336a345 100755
--- a/meta/packages/initscripts/initscripts-1.0/jornada7xx/devices
+++ b/meta/packages/initscripts/initscripts-1.0/jornada7xx/devices
@@ -3,35 +3,68 @@
3# Devfs handling script. Since we arent running devfsd due to various reasons 3# Devfs handling script. Since we arent running devfsd due to various reasons
4# which I will not lay out here, we need to create some links for compatibility. 4# which I will not lay out here, we need to create some links for compatibility.
5 5
6. /etc/default/rcS
7
6# exit without doing anything if udev is active 8# exit without doing anything if udev is active
7if test -e /dev/.udevdb; then 9if test -e /dev/.udevdb; then
8 exit 0 10 exit 0
9fi 11fi
10 12
11 test -n "$VERBOSE" && echo -n "Setting up device links for devfs: " 13if test -e /dev/.devfsd
12 ( 14then
13 ln -s /dev/vc/0 /dev/tty0 15 if test "$VERBOSE" != "no"; then echo -n "Setting up device links for devfs: "; fi
14 ln -s /dev/vc/1 /dev/tty1 16 ln -s /dev/touchscreen/0 /dev/ts
15 ln -s /dev/vc/2 /dev/tty2 17 ln -s /dev/touchscreen/0raw /dev/tsraw
16 ln -s /dev/vc/3 /dev/tty3 18 ln -s /dev/vc/0 /dev/tty0
17 ln -s /dev/vc/4 /dev/tty4 19 ln -s /dev/vc/1 /dev/tty1
18 ln -s /dev/vc/5 /dev/tty5 20 ln -s /dev/vc/2 /dev/tty2
19 ln -s /dev/fb/0 /dev/fb0 21 ln -s /dev/vc/3 /dev/tty3
20 # ln -s /dev/tts/0 /dev/ttySA0 22 ln -s /dev/vc/4 /dev/tty4
21 # ln -s /dev/tts/1 /dev/ttySA1 23 ln -s /dev/vc/5 /dev/tty5
22 # ln -s /dev/tts/2 /dev/ttySA2 24 ln -s /dev/fb/0 /dev/fb0
23 25# ln -s /dev/tts/0 /dev/ttySA0
24 ln -s /dev/sound/dsp /dev/dsp 26# ln -s /dev/tts/1 /dev/ttySA1
25 ln -s /dev/sound/mixer /dev/mixer 27# ln -s /dev/tts/2 /dev/ttySA2
26 28
27 ln -s /dev/v4l/video0 /dev/video0 29 ln -s /dev/sound/dsp /dev/dsp
28 ln -s /dev/v4l/video0 /dev/video 30 ln -s /dev/sound/mixer /dev/mixer
29 ln -s /dev/misc/rtc /dev/rtc
30 ln -s /dev/misc/apm_bios /dev/apm_bios
31 31
32 ## need this so that ppp will autoload the ppp modules 32 ln -s /dev/v4l/video0 /dev/video0
33 mknod /dev/ppp c 108 0 33 ln -s /dev/v4l/video0 /dev/video
34 ) > /dev/null 2>&1 34 ln -s /dev/misc/rtc /dev/rtc
35 35
36 ## need this so that ppp will autoload the ppp modules
37 mknod /dev/ppp c 108 0
38
39 if test "$VERBOSE" != "no"; then echo "done"; fi
40else
41 if test "$VERBOSE" != "no"; then echo -n "Mounting /dev ramdisk: "; fi
42 mount -t ramfs ramfs /dev || mount -t tmpfs ramfs /dev
43 if test $? -ne 0; then
44 if test "$VERBOSE" != "no"; then echo "failed"; fi
45 else
46 if test "$VERBOSE" != "no"; then echo "done"; fi
47 fi
48 if test "$VERBOSE" != "no"; then echo -n "Populating /dev: "; fi
49 cd /
50 mkdir -p dev/input
51 mknod /dev/input/ts0 c 13 65
52 mknod /dev/ttySC1 c 9 204
53 mknod /dev/irda0 c 10 204
54 mkdir -p dev/msys
55 mkdir -p dev/pts
56 mkdir -p dev/vc
57 for i in 0 1 2 3 4 5 6 7 8 9; do
58 ln -s /dev/tty$i /dev/vc/$i
59 done
60 ln -sf /proc/self/fd /dev/fd
61 ln -sf /proc/kcore /dev/core
62 /sbin/makedevs -r / -D /etc/device_table
63 if test $? -ne 0; then
64 if test "$VERBOSE" != "no"; then echo "failed"; fi
65 else
66 if test "$VERBOSE" != "no"; then echo "done"; fi
67 fi
68fi
36 69
37 test -n "$VERBOSE" && echo "done" 70exit 0
diff --git a/meta/packages/initscripts/initscripts-1.0/openzaurus/checkversion b/meta/packages/initscripts/initscripts-1.0/openzaurus/checkversion
deleted file mode 100755
index 0c8be4fc2d..0000000000
--- a/meta/packages/initscripts/initscripts-1.0/openzaurus/checkversion
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/bin/sh
2
3found=`cat /proc/version | cut -d ' ' -f3`
4echo "$found" | grep -q "snapshot" && exit 0
5
6if [ "VERSION" != "$found" ] ; then
7 echo -e >/dev/tty1
8 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
9 echo -e "\033[31;1m * \033[0mW A R N I N G ! \033[31;1m* \033[0m" >/dev/tty1
10 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
11 echo >/dev/tty1
12 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
13 echo -e "\033[31;1m * \033[0mYou are running the wrong kernel! \033[31;1m* \033[0m" >/dev/tty1
14 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
15 echo >/dev/tty1
16 echo -e "You are running '" $found "'" >/dev/tty1
17 echo -e "I expect kernel '" VERSION "'" >/dev/tty1
18 echo >/dev/tty1
19 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
20 echo -e "\033[31;1m * \033[0mRunning this combination is unsupported \033[31;1m* \033[0m" >/dev/tty1
21 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
22 echo >/dev/tty1
23 echo "I will sleep for 1 minute now. Use this chance to " >/dev/tty1
24 echo "reboot the device and flash the proper kernel now! " >/dev/tty1
25 echo -e >/dev/tty1
26 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
27 echo -e "\033[31;1m * \033[0mW A R N I N G ! \033[31;1m* \033[0m" >/dev/tty1
28 echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
29 echo >/dev/tty1
30 sleep 60
31fi
diff --git a/meta/packages/initscripts/initscripts-1.0/ramdisk b/meta/packages/initscripts/initscripts-1.0/ramdisk
index 03ac9bd05b..4dfe53cf61 100755
--- a/meta/packages/initscripts/initscripts-1.0/ramdisk
+++ b/meta/packages/initscripts/initscripts-1.0/ramdisk
@@ -22,6 +22,9 @@ else
22 RAM_MTDBLK=/dev/mtdblock$RAM_MTD_NO 22 RAM_MTDBLK=/dev/mtdblock$RAM_MTD_NO
23fi 23fi
24 24
25if grep -q $RAM_MTDBLK /etc/mtab; then echo "Device $RAM_MTDBLK already mounted"; exit 0; fi
26if test ! -e $RAM_MTD; then echo >&2 "Mtdram device $RAM_MTD does not exist!"; exit 1; fi
27
25RAM_MNTPT=/mnt/ram 28RAM_MNTPT=/mnt/ram
26RAM_MTD_SIZE_HEX=`cat /proc/mtd | grep mtdram | tail -n 1 | cut -d" " -f 2` 29RAM_MTD_SIZE_HEX=`cat /proc/mtd | grep mtdram | tail -n 1 | cut -d" " -f 2`
27RAM_MTD_SIZE=`dc 0x$RAM_MTD_SIZE_HEX 1024 / p` 30RAM_MTD_SIZE=`dc 0x$RAM_MTD_SIZE_HEX 1024 / p`
diff --git a/meta/packages/initscripts/initscripts-1.0/reboot b/meta/packages/initscripts/initscripts-1.0/reboot
index 7f95255bd9..56278199be 100755
--- a/meta/packages/initscripts/initscripts-1.0/reboot
+++ b/meta/packages/initscripts/initscripts-1.0/reboot
@@ -7,11 +7,5 @@
7 7
8PATH=/sbin:/bin:/usr/sbin:/usr/bin 8PATH=/sbin:/bin:/usr/sbin:/usr/bin
9 9
10# Update the timestamp, if there is one
11if test -e /etc/timestamp
12then
13 date +%2m%2d%2H%2M%Y > /etc/timestamp
14fi
15
16echo -n "Rebooting... " 10echo -n "Rebooting... "
17reboot -d -f -i 11reboot -d -f -i
diff --git a/meta/packages/initscripts/initscripts-1.0/save-rtc.sh b/meta/packages/initscripts/initscripts-1.0/save-rtc.sh
index d06aa6d569..e786073051 100644
--- a/meta/packages/initscripts/initscripts-1.0/save-rtc.sh
+++ b/meta/packages/initscripts/initscripts-1.0/save-rtc.sh
@@ -1,16 +1,5 @@
1#! /bin/sh 1#! /bin/sh
2# 2/etc/init.d/hwclock.sh stop
3# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
4# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
5#
6# Filename: save-rtc.sh
7# Date: 03-Jul-06
8 3
9 4# Update the timestamp
10# Update the timestamp, if there is already one 5date +%2m%2d%2H%2M%Y > /etc/timestamp
11if test -e /etc/timestamp
12then
13 echo "Will restore RCT from /etc/timestamp on next boot"
14 echo "Delete that file to disable this feature."
15 date +%2m%2d%2H%2M%Y > /etc/timestamp
16fi
diff --git a/meta/packages/initscripts/initscripts_1.0.bb b/meta/packages/initscripts/initscripts_1.0.bb
index 5f59bf9d7b..06a12c04a5 100644
--- a/meta/packages/initscripts/initscripts_1.0.bb
+++ b/meta/packages/initscripts/initscripts_1.0.bb
@@ -2,12 +2,12 @@ DESCRIPTION = "SysV init scripts"
2SECTION = "base" 2SECTION = "base"
3PRIORITY = "required" 3PRIORITY = "required"
4DEPENDS = "makedevs" 4DEPENDS = "makedevs"
5DEPENDS_openzaurus = "makedevs virtual/kernel"
6RDEPENDS = "makedevs" 5RDEPENDS = "makedevs"
7LICENSE = "GPL" 6LICENSE = "GPL"
8PR = "r74" 7PR = "r100"
9 8
10SRC_URI = "file://halt \ 9SRC_URI = "file://functions \
10 file://halt \
11 file://ramdisk \ 11 file://ramdisk \
12 file://umountfs \ 12 file://umountfs \
13 file://devices \ 13 file://devices \
@@ -31,39 +31,29 @@ SRC_URI = "file://halt \
31 file://device_table.txt \ 31 file://device_table.txt \
32 file://populate-volatile.sh \ 32 file://populate-volatile.sh \
33 file://volatiles \ 33 file://volatiles \
34 file://save-rtc.sh" 34 file://save-rtc.sh"
35 35
36SRC_URI_append_arm = " file://alignment.sh" 36SRC_URI_append_arm = " file://alignment.sh"
37SRC_URI_append_openzaurus = " file://checkversion"
38 37
39def read_kernel_version(d):
40 import bb
41 distro = bb.data.getVar('DISTRO', d, 1)
42 filename = bb.data.getVar('STAGING_KERNEL_DIR', d, 1)
43 if distro == "openzaurus":
44 return file( filename + "/kernel-abiversion", "r" ).read().strip()
45 else:
46 return "not important"
47KERNEL_VERSION = "" 38KERNEL_VERSION = ""
48KERNEL_VERSION_openzaurus = "${@read_kernel_version(d)}"
49PACKAGE_ARCH_openzaurus = "${MACHINE_ARCH}"
50 39
51do_install () { 40do_install () {
52# 41#
53# Create directories and install device independent scripts 42# Create directories and install device independent scripts
54# 43#
55 install -d ${D}${sysconfdir}/init.d \ 44 install -d ${D}${sysconfdir}/init.d
56 ${D}${sysconfdir}/rcS.d \ 45 install -d ${D}${sysconfdir}/rcS.d
57 ${D}${sysconfdir}/rc0.d \ 46 install -d ${D}${sysconfdir}/rc0.d
58 ${D}${sysconfdir}/rc1.d \ 47 install -d ${D}${sysconfdir}/rc1.d
59 ${D}${sysconfdir}/rc2.d \ 48 install -d ${D}${sysconfdir}/rc2.d
60 ${D}${sysconfdir}/rc3.d \ 49 install -d ${D}${sysconfdir}/rc3.d
61 ${D}${sysconfdir}/rc4.d \ 50 install -d ${D}${sysconfdir}/rc4.d
62 ${D}${sysconfdir}/rc5.d \ 51 install -d ${D}${sysconfdir}/rc5.d
63 ${D}${sysconfdir}/rc6.d \ 52 install -d ${D}${sysconfdir}/rc6.d
64 ${D}${sysconfdir}/default \ 53 install -d ${D}${sysconfdir}/default
65 ${D}${sysconfdir}/default/volatiles 54 install -d ${D}${sysconfdir}/default/volatiles
66 55
56 install -m 0755 ${WORKDIR}/functions ${D}${sysconfdir}/init.d
67 install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d 57 install -m 0755 ${WORKDIR}/bootmisc.sh ${D}${sysconfdir}/init.d
68 install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d 58 install -m 0755 ${WORKDIR}/checkroot.sh ${D}${sysconfdir}/init.d
69 install -m 0755 ${WORKDIR}/finish ${D}${sysconfdir}/init.d 59 install -m 0755 ${WORKDIR}/finish ${D}${sysconfdir}/init.d
@@ -82,7 +72,7 @@ do_install () {
82 install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default 72 install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default
83 install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d 73 install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d
84 install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d 74 install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
85 install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d 75 install -m 0755 ${WORKDIR}/save-rtc.sh ${D}${sysconfdir}/init.d
86 install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core 76 install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default/volatiles/00_core
87 if [ "${TARGET_ARCH}" = "arm" ]; then 77 if [ "${TARGET_ARCH}" = "arm" ]; then
88 install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d 78 install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
@@ -90,13 +80,6 @@ do_install () {
90# 80#
91# Install device dependent scripts 81# Install device dependent scripts
92# 82#
93
94 if [ "${DISTRO}" = "openzaurus" ]; then
95 cat ${WORKDIR}/checkversion | sed -e "s,VERSION,${KERNEL_VERSION}-${DISTRO_VERSION}," > ${D}${sysconfdir}/init.d/checkversion
96 chmod 0755 ${D}${sysconfdir}/init.d/checkversion
97 ln -sf ../init.d/checkversion ${D}${sysconfdir}/rcS.d/S01version
98 fi
99
100 install -m 0755 ${WORKDIR}/banner ${D}${sysconfdir}/init.d/banner 83 install -m 0755 ${WORKDIR}/banner ${D}${sysconfdir}/init.d/banner
101 install -m 0755 ${WORKDIR}/devices ${D}${sysconfdir}/init.d/devices 84 install -m 0755 ${WORKDIR}/devices ${D}${sysconfdir}/init.d/devices
102 install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs 85 install -m 0755 ${WORKDIR}/umountfs ${D}${sysconfdir}/init.d/umountfs
@@ -112,7 +95,7 @@ do_install () {
112 ln -sf ../init.d/umountnfs.sh ${D}${sysconfdir}/rc6.d/S31umountnfs.sh 95 ln -sf ../init.d/umountnfs.sh ${D}${sysconfdir}/rc6.d/S31umountnfs.sh
113 ln -sf ../init.d/umountfs ${D}${sysconfdir}/rc6.d/S40umountfs 96 ln -sf ../init.d/umountfs ${D}${sysconfdir}/rc6.d/S40umountfs
114 # udev will run at S55 if installed 97 # udev will run at S55 if installed
115 ln -sf ../init.d/ramdisk ${D}${sysconfdir}/rcS.d/S30ramdisk 98 ln -sf ../init.d/ramdisk ${D}${sysconfdir}/rcS.d/S30ramdisk
116 ln -sf ../init.d/reboot ${D}${sysconfdir}/rc6.d/S90reboot 99 ln -sf ../init.d/reboot ${D}${sysconfdir}/rc6.d/S90reboot
117 ln -sf ../init.d/sendsigs ${D}${sysconfdir}/rc0.d/S20sendsigs 100 ln -sf ../init.d/sendsigs ${D}${sysconfdir}/rc0.d/S20sendsigs
118# ln -sf ../init.d/urandom ${D}${sysconfdir}/rc0.d/S30urandom 101# ln -sf ../init.d/urandom ${D}${sysconfdir}/rc0.d/S30urandom
@@ -121,7 +104,7 @@ do_install () {
121 # udev will run at S55 if installed 104 # udev will run at S55 if installed
122 ln -sf ../init.d/halt ${D}${sysconfdir}/rc0.d/S90halt 105 ln -sf ../init.d/halt ${D}${sysconfdir}/rc0.d/S90halt
123 ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc0.d/S25save-rtc.sh 106 ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc0.d/S25save-rtc.sh
124 ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc6.d/S25save-rtc.sh 107 ln -sf ../init.d/save-rtc.sh ${D}${sysconfdir}/rc6.d/S25save-rtc.sh
125 ln -sf ../init.d/banner ${D}${sysconfdir}/rcS.d/S02banner 108 ln -sf ../init.d/banner ${D}${sysconfdir}/rcS.d/S02banner
126 ln -sf ../init.d/checkroot.sh ${D}${sysconfdir}/rcS.d/S10checkroot.sh 109 ln -sf ../init.d/checkroot.sh ${D}${sysconfdir}/rcS.d/S10checkroot.sh
127# ln -sf ../init.d/checkfs.sh ${D}${sysconfdir}/rcS.d/S30checkfs.sh 110# ln -sf ../init.d/checkfs.sh ${D}${sysconfdir}/rcS.d/S30checkfs.sh