]> code.ossystems Code Review - openembedded-core.git/commitdiff
initscripts: Sync with OE, primarily for better /etc/timestamp handling
authorRichard Purdie <richard@openedhand.com>
Sun, 2 Sep 2007 14:00:52 +0000 (14:00 +0000)
committerRichard Purdie <richard@openedhand.com>
Sun, 2 Sep 2007 14:00:52 +0000 (14:00 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2650 311d38ba-8fff-0310-9ca6-ca027cbcb966

13 files changed:
meta/packages/initscripts/initscripts-1.0/bootmisc.sh
meta/packages/initscripts/initscripts-1.0/devices
meta/packages/initscripts/initscripts-1.0/functions [new file with mode: 0644]
meta/packages/initscripts/initscripts-1.0/halt
meta/packages/initscripts/initscripts-1.0/jornada6xx/checkroot.sh [new file with mode: 0755]
meta/packages/initscripts/initscripts-1.0/jornada6xx/devices
meta/packages/initscripts/initscripts-1.0/jornada7xx/checkroot.sh [new file with mode: 0755]
meta/packages/initscripts/initscripts-1.0/jornada7xx/devices
meta/packages/initscripts/initscripts-1.0/openzaurus/checkversion [deleted file]
meta/packages/initscripts/initscripts-1.0/ramdisk
meta/packages/initscripts/initscripts-1.0/reboot
meta/packages/initscripts/initscripts-1.0/save-rtc.sh
meta/packages/initscripts/initscripts_1.0.bb

index 814dba676cf00348df28374e0163ea3e5a59975a..2a40e0c410d1d0bd322911127517b99cfb03ca3a 100755 (executable)
@@ -61,11 +61,18 @@ fi
 #
 /sbin/ldconfig
 
-# 
-# Recover the time, if there is a time file                 
-#
+# Set the system clock from hardware clock
+# If the timestamp is 1 day or more recent than the current time,
+# use the timestamp instead.
+/etc/init.d/hwclock.sh start
 if test -e /etc/timestamp
 then
-       date -s `cat /etc/timestamp`
+       SYSTEMDATE=`date "+%Y%m%d"`
+       TIMESTAMP=`cat /etc/timestamp | awk '{ print substr($0,9,4) substr($0,1,4);}'`
+        NEEDUPDATE=`expr \( $TIMESTAMP \> $SYSTEMDATE \)`                                                 
+        if [ $NEEDUPDATE -eq 1 ]; then 
+               date `cat /etc/timestamp`
+               /etc/init.d/hwclock.sh stop
+       fi
 fi
 : exit 0
index 28fb71fe3f47a9fc32c20a0c0ad1b87748c841cd..67a2ec8092ae5f1e3a6006aa9a76c664e723351c 100755 (executable)
@@ -6,7 +6,7 @@
 . /etc/default/rcS
 
 # exit without doing anything if udev is active
-if test -e /dev/.udevdb; then
+if test -e /dev/.udev -o -e /dev/.udevdb; then
        exit 0
 fi
 
@@ -50,6 +50,7 @@ else
        mkdir -p dev/msys
        mkdir -p dev/pts
        mkdir -p dev/vc
+       mkdir -p dev/snd
        for i in 0 1 2 3 4 5 6 7 8 9; do
                ln -s /dev/tty$i /dev/vc/$i
        done
diff --git a/meta/packages/initscripts/initscripts-1.0/functions b/meta/packages/initscripts/initscripts-1.0/functions
new file mode 100644 (file)
index 0000000..358fc6e
--- /dev/null
@@ -0,0 +1,17 @@
+# -*-Shell-script-*-
+#
+# functions     This file contains functions to be used by most or all
+#               shell scripts in the /etc/init.d directory.
+#
+
+cpuinfo_id() {         # return the Hardware module ID
+    awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
+}
+
+killproc() {           # kill the named process(es)
+    pid=`/bin/ps -e x |
+         /bin/grep $1 |
+         /bin/grep -v grep |
+         /bin/sed -e 's/^  *//' -e 's/ .*//'`
+    [ "$pid" != "" ] && kill $pid
+}
index aa1769606a739279c55f587b0783d3ebed7ec199..d8cab222ca01feee54d32b5c014016b3ced10299 100755 (executable)
@@ -7,12 +7,6 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-# Update the timestamp, if there is already one
-if test -e /etc/timestamp
-then
-        date +%2m%2d%2H%2M%Y > /etc/timestamp
-fi
-
 # See if we need to cut the power.
 if test -x /etc/init.d/ups-monitor
 then
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 (executable)
index 0000000..9e2d3cf
--- /dev/null
@@ -0,0 +1,211 @@
+#
+# checkroot.sh Check to root filesystem.
+#
+# Version:     @(#)checkroot.sh  2.84  25-Jan-2002  miquels@cistron.nl
+#
+
+. /etc/default/rcS
+
+#
+# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
+# from this script *before anything else* with a timeout, like SCO does.
+#
+test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
+
+#
+# Ensure that bdflush (update) is running before any major I/O is
+# performed (the following fsck is a good example of such activity :).
+#
+test -x /sbin/update && update
+
+#
+# Read /etc/fstab.
+#
+exec 9>&0 </etc/fstab
+rootmode=rw
+rootopts=rw
+test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no"
+swap_on_md=no
+devfs=
+while read fs mnt type opts dump pass junk
+do
+       case "$fs" in
+               ""|\#*)
+                       continue;
+                       ;;
+               /dev/md*)
+                       # Swap on md device.
+                       test "$type" = swap && swap_on_md=yes
+                       ;;
+               /dev/*)
+                       ;;
+               *)
+                       # Might be a swapfile.
+                       test "$type" = swap && swap_on_md=yes
+                       ;;
+       esac
+       
+       test "$type" = devfs && devfs="$fs"
+
+       # Currently we do not care about the other entries
+       if test "$mnt" = "/"
+       then
+               #echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]"
+
+               rootopts="$opts"                
+               roottype="$type"
+
+               #The "spinner" is broken on busybox sh  
+               TERM=dumb
+                       
+               test "$pass" = 0 -o "$pass" = "" && rootcheck=no
+               
+               # Enable fsck for ext2 and ext3 rootfs, disable for everything else                             
+               case "$type" in
+               ext3)   rootcheck=yes;;
+               *)              rootcheck=no;;
+               esac
+               
+               if test "$rootcheck" = yes
+               then
+                       if ! test -x "/sbin/fsck.${roottype}"
+                       then
+                               echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n"
+                               rootcheck=no
+                       fi
+               fi
+               
+               case "$opts" in
+                       ro|ro,*|*,ro|*,ro,*)
+                               rootmode=ro
+                               ;;
+               esac
+       fi
+done
+exec 0>&9 9>&-
+
+#
+# Activate the swap device(s) in /etc/fstab. This needs to be done
+# before fsck, since fsck can be quite memory-hungry.
+#
+doswap=no
+test -d /proc/1 || mount -n /proc
+case "`uname -r`" in
+       2.[0123].*)
+               if test $swap_on_md = yes && grep -qs resync /proc/mdstat
+               then
+                       test "$VERBOSE" != no && echo "Not activating swap - RAID array resyncing"
+               else
+                       doswap=yes
+               fi
+               ;;
+       *)
+               doswap=yes
+               ;;
+esac
+if test $doswap = yes
+then
+       test "$VERBOSE" != no && echo "Activating swap"
+       swapon -a 2> /dev/null
+fi
+
+#
+# Check the root filesystem.
+#
+if test -f /fastboot || test $rootcheck = no
+then
+  test $rootcheck = yes && echo "Fast boot, no filesystem check"
+else
+  #
+  # Ensure that root is quiescent and read-only before fsck'ing.
+  #
+  mount -n -o remount,ro /
+  if test $? = 0
+  then
+    if test -f /forcefsck
+    then
+       force="-f"
+    else
+       force=""
+    fi
+    if test "$FSCKFIX" = yes
+    then
+       fix="-y"
+    else
+       fix="-a"
+    fi
+    spinner="-C"
+    case "$TERM" in
+        dumb|network|unknown|"") spinner="" ;;
+    esac
+    test `uname -m` = s390 && spinner="" # This should go away
+    test "$VERBOSE" != no && echo "Checking root filesystem..."
+    fsck $spinner $force $fix /
+    #
+    # If there was a failure, drop into single-user mode.
+    #
+    # NOTE: "failure" is defined as exiting with a return code of
+    # 2 or larger.  A return code of 1 indicates that filesystem
+    # errors were corrected but that the boot may proceed.
+    #
+    if test "$?" -gt 1
+    then
+    
+      # Since this script is run very early in the boot-process, it should be safe to assume that the
+      # output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot
+      # messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal
+      chvt 1
+    
+      # Surprise! Re-directing from a HERE document (as in
+      # "cat << EOF") won't work, because the root is read-only.
+      echo
+      echo "fsck failed.  Please repair manually and reboot.  Please note"
+      echo "that the root filesystem is currently mounted read-only.  To"
+      echo "remount it read-write:"
+      echo
+      echo "   # mount -n -o remount,rw /"
+      echo
+      echo "CONTROL-D will exit from this shell and REBOOT the system."
+      echo
+      # Start a single user shell on the console
+      /sbin/sulogin $CONSOLE
+      reboot -f
+    fi
+  else
+    echo "*** ERROR!  Cannot fsck root fs because it is not mounted read-only!"
+    echo
+  fi
+fi
+
+#
+#      If the root filesystem was not marked as read-only in /etc/fstab,
+#      remount the rootfs rw but do not try to change mtab because it
+#      is on a ro fs until the remount succeeded. Then clean up old mtabs
+#      and finally write the new mtab.
+#      This part is only needed if the rootfs was mounted ro.
+#
+if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then
+       exit 0
+fi
+
+#       Add a second check, which seems to be needed for some kernel versions
+if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then
+        exit 0
+fi
+
+
+echo "Remounting root file system..."
+mount -n -o remount,$rootmode /
+if test "$rootmode" = rw
+then
+       if test ! -L /etc/mtab
+       then
+               rm -f /etc/mtab~ /etc/nologin
+               : > /etc/mtab
+       fi
+       mount -f -o remount /
+       mount -f /proc
+       test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
+fi
+
+: exit 0
index fc96ff62ee7c02de17f9c8e27f068761b1006d7f..5ca2a1ccefab17c35d9f4b0f25eda2d8b29b8e49 100644 (file)
@@ -22,9 +22,6 @@ then
        ln -s /dev/vc/4 /dev/tty4
        ln -s /dev/vc/5 /dev/tty5
        ln -s /dev/fb/0 /dev/fb0
-#      ln -s /dev/tts/0 /dev/ttySA0
-#      ln -s /dev/tts/1 /dev/ttySA1
-#      ln -s /dev/tts/2 /dev/ttySA2
 
        ln -s /dev/sound/dsp /dev/dsp
        ln -s /dev/sound/mixer /dev/mixer
@@ -49,8 +46,12 @@ else
        cd /
        mkdir -p dev/input
         mknod /dev/input/ts0 c 13 128
+        mknod /dev/ttySC0 c 8 204
        mknod /dev/ttySC1 c 9 204
+        mknod /dev/ttySC2 c 10 204
+       
        mknod /dev/irda0  c 10 204
+        
        mkdir -p dev/msys
        mkdir -p dev/pts
        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 (executable)
index 0000000..9e2d3cf
--- /dev/null
@@ -0,0 +1,211 @@
+#
+# checkroot.sh Check to root filesystem.
+#
+# Version:     @(#)checkroot.sh  2.84  25-Jan-2002  miquels@cistron.nl
+#
+
+. /etc/default/rcS
+
+#
+# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
+# from this script *before anything else* with a timeout, like SCO does.
+#
+test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
+
+#
+# Ensure that bdflush (update) is running before any major I/O is
+# performed (the following fsck is a good example of such activity :).
+#
+test -x /sbin/update && update
+
+#
+# Read /etc/fstab.
+#
+exec 9>&0 </etc/fstab
+rootmode=rw
+rootopts=rw
+test "$ENABLE_ROOTFS_FSCK" = yes && rootcheck="yes" || rootcheck="no"
+swap_on_md=no
+devfs=
+while read fs mnt type opts dump pass junk
+do
+       case "$fs" in
+               ""|\#*)
+                       continue;
+                       ;;
+               /dev/md*)
+                       # Swap on md device.
+                       test "$type" = swap && swap_on_md=yes
+                       ;;
+               /dev/*)
+                       ;;
+               *)
+                       # Might be a swapfile.
+                       test "$type" = swap && swap_on_md=yes
+                       ;;
+       esac
+       
+       test "$type" = devfs && devfs="$fs"
+
+       # Currently we do not care about the other entries
+       if test "$mnt" = "/"
+       then
+               #echo "[$fs] [$mnt] [$type] [$opts] [$dump] [$pass] [$junk]"
+
+               rootopts="$opts"                
+               roottype="$type"
+
+               #The "spinner" is broken on busybox sh  
+               TERM=dumb
+                       
+               test "$pass" = 0 -o "$pass" = "" && rootcheck=no
+               
+               # Enable fsck for ext2 and ext3 rootfs, disable for everything else                             
+               case "$type" in
+               ext3)   rootcheck=yes;;
+               *)              rootcheck=no;;
+               esac
+               
+               if test "$rootcheck" = yes
+               then
+                       if ! test -x "/sbin/fsck.${roottype}"
+                       then
+                               echo -e "\n * * * WARNING: /sbin/fsck.${roottype} is missing! * * *\n"
+                               rootcheck=no
+                       fi
+               fi
+               
+               case "$opts" in
+                       ro|ro,*|*,ro|*,ro,*)
+                               rootmode=ro
+                               ;;
+               esac
+       fi
+done
+exec 0>&9 9>&-
+
+#
+# Activate the swap device(s) in /etc/fstab. This needs to be done
+# before fsck, since fsck can be quite memory-hungry.
+#
+doswap=no
+test -d /proc/1 || mount -n /proc
+case "`uname -r`" in
+       2.[0123].*)
+               if test $swap_on_md = yes && grep -qs resync /proc/mdstat
+               then
+                       test "$VERBOSE" != no && echo "Not activating swap - RAID array resyncing"
+               else
+                       doswap=yes
+               fi
+               ;;
+       *)
+               doswap=yes
+               ;;
+esac
+if test $doswap = yes
+then
+       test "$VERBOSE" != no && echo "Activating swap"
+       swapon -a 2> /dev/null
+fi
+
+#
+# Check the root filesystem.
+#
+if test -f /fastboot || test $rootcheck = no
+then
+  test $rootcheck = yes && echo "Fast boot, no filesystem check"
+else
+  #
+  # Ensure that root is quiescent and read-only before fsck'ing.
+  #
+  mount -n -o remount,ro /
+  if test $? = 0
+  then
+    if test -f /forcefsck
+    then
+       force="-f"
+    else
+       force=""
+    fi
+    if test "$FSCKFIX" = yes
+    then
+       fix="-y"
+    else
+       fix="-a"
+    fi
+    spinner="-C"
+    case "$TERM" in
+        dumb|network|unknown|"") spinner="" ;;
+    esac
+    test `uname -m` = s390 && spinner="" # This should go away
+    test "$VERBOSE" != no && echo "Checking root filesystem..."
+    fsck $spinner $force $fix /
+    #
+    # If there was a failure, drop into single-user mode.
+    #
+    # NOTE: "failure" is defined as exiting with a return code of
+    # 2 or larger.  A return code of 1 indicates that filesystem
+    # errors were corrected but that the boot may proceed.
+    #
+    if test "$?" -gt 1
+    then
+    
+      # Since this script is run very early in the boot-process, it should be safe to assume that the
+      # output is printed to VT1. However, some distributions use a bootsplash to hide the "ugly" boot
+      # messages and having the bootsplash "hang" due to a waiting fsck prompt is less than ideal
+      chvt 1
+    
+      # Surprise! Re-directing from a HERE document (as in
+      # "cat << EOF") won't work, because the root is read-only.
+      echo
+      echo "fsck failed.  Please repair manually and reboot.  Please note"
+      echo "that the root filesystem is currently mounted read-only.  To"
+      echo "remount it read-write:"
+      echo
+      echo "   # mount -n -o remount,rw /"
+      echo
+      echo "CONTROL-D will exit from this shell and REBOOT the system."
+      echo
+      # Start a single user shell on the console
+      /sbin/sulogin $CONSOLE
+      reboot -f
+    fi
+  else
+    echo "*** ERROR!  Cannot fsck root fs because it is not mounted read-only!"
+    echo
+  fi
+fi
+
+#
+#      If the root filesystem was not marked as read-only in /etc/fstab,
+#      remount the rootfs rw but do not try to change mtab because it
+#      is on a ro fs until the remount succeeded. Then clean up old mtabs
+#      and finally write the new mtab.
+#      This part is only needed if the rootfs was mounted ro.
+#
+if [ $(grep rootfs /proc/mounts | awk '{print $4}') = rw ]; then
+       exit 0
+fi
+
+#       Add a second check, which seems to be needed for some kernel versions
+if [ $(grep "/dev/root" /proc/mounts | awk '{print $4}') = rw ]; then
+        exit 0
+fi
+
+
+echo "Remounting root file system..."
+mount -n -o remount,$rootmode /
+if test "$rootmode" = rw
+then
+       if test ! -L /etc/mtab
+       then
+               rm -f /etc/mtab~ /etc/nologin
+               : > /etc/mtab
+       fi
+       mount -f -o remount /
+       mount -f /proc
+       test "$devfs" && grep -q '^devfs /dev' /proc/mounts && mount -f "$devfs"
+fi
+
+: exit 0
index 0e59229225e6d2a46b263dbf5a92afd3c9e24c13..422336a345c2335a9abe814893ea338f9ea56b8c 100755 (executable)
@@ -3,35 +3,68 @@
 # Devfs handling script.  Since we arent running devfsd due to various reasons
 # which I will not lay out here, we need to create some links for compatibility.
 
+. /etc/default/rcS
+
 # exit without doing anything if udev is active
 if test -e /dev/.udevdb; then
-    exit 0
+       exit 0
 fi
 
-    test -n "$VERBOSE" && echo -n "Setting up device links for devfs: "
-    (
-    ln -s /dev/vc/0 /dev/tty0
-    ln -s /dev/vc/1 /dev/tty1
-    ln -s /dev/vc/2 /dev/tty2
-    ln -s /dev/vc/3 /dev/tty3
-    ln -s /dev/vc/4 /dev/tty4
-    ln -s /dev/vc/5 /dev/tty5
-    ln -s /dev/fb/0 /dev/fb0
-    # ln -s /dev/tts/0 /dev/ttySA0
-    # ln -s /dev/tts/1 /dev/ttySA1
-    # ln -s /dev/tts/2 /dev/ttySA2
-
-    ln -s /dev/sound/dsp /dev/dsp
-    ln -s /dev/sound/mixer /dev/mixer
+if test -e /dev/.devfsd
+then
+       if test "$VERBOSE" != "no"; then echo -n "Setting up device links for devfs: "; fi
+       ln -s /dev/touchscreen/0 /dev/ts
+       ln -s /dev/touchscreen/0raw /dev/tsraw
+       ln -s /dev/vc/0 /dev/tty0
+       ln -s /dev/vc/1 /dev/tty1
+       ln -s /dev/vc/2 /dev/tty2
+       ln -s /dev/vc/3 /dev/tty3
+       ln -s /dev/vc/4 /dev/tty4
+       ln -s /dev/vc/5 /dev/tty5
+       ln -s /dev/fb/0 /dev/fb0
+#      ln -s /dev/tts/0 /dev/ttySA0
+#      ln -s /dev/tts/1 /dev/ttySA1
+#      ln -s /dev/tts/2 /dev/ttySA2
 
-    ln -s /dev/v4l/video0 /dev/video0
-    ln -s /dev/v4l/video0 /dev/video
-    ln -s /dev/misc/rtc /dev/rtc
-    ln -s /dev/misc/apm_bios /dev/apm_bios
+       ln -s /dev/sound/dsp /dev/dsp
+       ln -s /dev/sound/mixer /dev/mixer
 
-    ## need this so that ppp will autoload the ppp modules
-    mknod /dev/ppp c 108 0
-    )  > /dev/null 2>&1
+       ln -s /dev/v4l/video0 /dev/video0
+       ln -s /dev/v4l/video0 /dev/video
+       ln -s /dev/misc/rtc /dev/rtc
 
+       ## need this so that ppp will autoload the ppp modules
+       mknod /dev/ppp c 108 0
+        
+       if test "$VERBOSE" != "no"; then echo "done"; fi
+else
+       if test "$VERBOSE" != "no"; then echo -n "Mounting /dev ramdisk: "; fi
+       mount -t ramfs ramfs /dev || mount -t tmpfs ramfs /dev
+       if test $? -ne 0; then
+               if test "$VERBOSE" != "no"; then echo "failed"; fi
+       else
+               if test "$VERBOSE" != "no"; then echo "done"; fi
+       fi
+       if test "$VERBOSE" != "no"; then echo -n "Populating /dev: "; fi
+       cd /
+       mkdir -p dev/input
+        mknod /dev/input/ts0 c 13 65
+       mknod /dev/ttySC1 c 9 204
+       mknod /dev/irda0  c 10 204
+       mkdir -p dev/msys
+       mkdir -p dev/pts
+       mkdir -p dev/vc
+       for i in 0 1 2 3 4 5 6 7 8 9; do
+               ln -s /dev/tty$i /dev/vc/$i
+       done
+       ln -sf /proc/self/fd /dev/fd
+       ln -sf /proc/kcore /dev/core
+       /sbin/makedevs -r / -D /etc/device_table
+       if test $? -ne 0; then
+               if test "$VERBOSE" != "no"; then echo "failed"; fi
+       else
+               if test "$VERBOSE" != "no"; then echo "done"; fi
+       fi
+fi
 
-    test -n "$VERBOSE" && echo "done"
+exit 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 (executable)
index 0c8be4f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-found=`cat /proc/version | cut -d ' ' -f3`
-echo "$found" | grep -q "snapshot" && exit 0
-
-if [ "VERSION" != "$found" ] ; then
-       echo -e >/dev/tty1
-       echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-       echo -e "\033[31;1m *            \033[0mW A R N I N G !              \033[31;1m* \033[0m" >/dev/tty1
-       echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-       echo >/dev/tty1
-       echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-        echo -e "\033[31;1m *    \033[0mYou are running the wrong kernel!    \033[31;1m* \033[0m" >/dev/tty1
-        echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-       echo >/dev/tty1
-       echo -e "You are running '" $found "'"                                   >/dev/tty1
-       echo -e "I expect kernel '" VERSION "'"                                  >/dev/tty1
-       echo >/dev/tty1
-        echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-        echo -e "\033[31;1m * \033[0mRunning this combination is unsupported \033[31;1m* \033[0m" >/dev/tty1
-        echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-       echo >/dev/tty1
-       echo "I will sleep for 1 minute now. Use this chance to "                >/dev/tty1
-       echo "reboot the device and flash the proper kernel now! "               >/dev/tty1
-        echo -e >/dev/tty1
-        echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-        echo -e "\033[31;1m *            \033[0mW A R N I N G !              \033[31;1m* \033[0m" >/dev/tty1
-        echo -e "\033[31;1m ******************************************* \033[0m" >/dev/tty1
-        echo >/dev/tty1
-       sleep 60
-fi
index 03ac9bd05bdb6b2f4353d9045e58cef0710ea47e..4dfe53cf610c4208443c776e463a1329091f2050 100755 (executable)
@@ -22,6 +22,9 @@ else
        RAM_MTDBLK=/dev/mtdblock$RAM_MTD_NO
 fi
 
+if grep -q $RAM_MTDBLK /etc/mtab; then echo "Device $RAM_MTDBLK already mounted"; exit 0; fi
+if test ! -e $RAM_MTD; then echo >&2 "Mtdram device $RAM_MTD does not exist!"; exit 1; fi
+
 RAM_MNTPT=/mnt/ram
 RAM_MTD_SIZE_HEX=`cat /proc/mtd | grep mtdram | tail -n 1 | cut -d" " -f 2`
 RAM_MTD_SIZE=`dc 0x$RAM_MTD_SIZE_HEX 1024 / p`
index 7f95255bd9cd09e6616d8a66281e3f27ac572d81..56278199be49b494017f9458d2a81cf7795738f9 100755 (executable)
@@ -7,11 +7,5 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
-# Update the timestamp, if there is one
-if test -e /etc/timestamp
-then
-        date +%2m%2d%2H%2M%Y > /etc/timestamp
-fi
-
 echo -n "Rebooting... "
 reboot -d -f -i
index d06aa6d5693160073faaf0036254e0e8e276b96e..e786073051e46f21944e8c16bc5276801463ad25 100644 (file)
@@ -1,16 +1,5 @@
 #! /bin/sh
-#
-# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
-# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
-#
-# Filename: save-rtc.sh
-# Date: 03-Jul-06
+/etc/init.d/hwclock.sh stop
 
-
-# Update the timestamp, if there is already one
-if test -e /etc/timestamp
-then
-       echo "Will restore RCT from /etc/timestamp on next boot"
-       echo "Delete that file to disable this feature."
-        date +%2m%2d%2H%2M%Y > /etc/timestamp
-fi
+# Update the timestamp
+date +%2m%2d%2H%2M%Y > /etc/timestamp
index 5f59bf9d7bfa782dbd172273beaad715cf541988..06a12c04a5977cc26bc376a6faaaf4650be96ca6 100644 (file)
@@ -2,12 +2,12 @@ DESCRIPTION = "SysV init scripts"
 SECTION = "base"
 PRIORITY = "required"
 DEPENDS = "makedevs"
-DEPENDS_openzaurus = "makedevs virtual/kernel"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r74"
+PR = "r100"
 
-SRC_URI = "file://halt \
+SRC_URI = "file://functions \
+           file://halt \
            file://ramdisk \
            file://umountfs \
            file://devices \
@@ -31,39 +31,29 @@ SRC_URI = "file://halt \
            file://device_table.txt \
            file://populate-volatile.sh \
            file://volatiles \
-          file://save-rtc.sh"
+           file://save-rtc.sh"
 
-SRC_URI_append_arm          = " file://alignment.sh"
-SRC_URI_append_openzaurus   = " file://checkversion"
+SRC_URI_append_arm = " file://alignment.sh"
 
-def read_kernel_version(d):
-       import bb
-       distro = bb.data.getVar('DISTRO', d, 1)
-       filename = bb.data.getVar('STAGING_KERNEL_DIR', d, 1)
-       if distro == "openzaurus":
-               return file( filename + "/kernel-abiversion", "r" ).read().strip()
-       else:
-               return "not important"
 KERNEL_VERSION = ""
-KERNEL_VERSION_openzaurus = "${@read_kernel_version(d)}"
-PACKAGE_ARCH_openzaurus = "${MACHINE_ARCH}"
 
 do_install () {
 #
 # Create directories and install device independent scripts
 #
-       install -d ${D}${sysconfdir}/init.d \
-                  ${D}${sysconfdir}/rcS.d \
-                  ${D}${sysconfdir}/rc0.d \
-                  ${D}${sysconfdir}/rc1.d \
-                  ${D}${sysconfdir}/rc2.d \
-                  ${D}${sysconfdir}/rc3.d \
-                  ${D}${sysconfdir}/rc4.d \
-                  ${D}${sysconfdir}/rc5.d \
-                  ${D}${sysconfdir}/rc6.d \
-                  ${D}${sysconfdir}/default \
-                  ${D}${sysconfdir}/default/volatiles
+       install -d ${D}${sysconfdir}/init.d
+       install -d ${D}${sysconfdir}/rcS.d
+       install -d ${D}${sysconfdir}/rc0.d
+       install -d ${D}${sysconfdir}/rc1.d
+       install -d ${D}${sysconfdir}/rc2.d
+       install -d ${D}${sysconfdir}/rc3.d
+       install -d ${D}${sysconfdir}/rc4.d
+       install -d ${D}${sysconfdir}/rc5.d
+       install -d ${D}${sysconfdir}/rc6.d
+       install -d ${D}${sysconfdir}/default
+       install -d ${D}${sysconfdir}/default/volatiles
 
+       install -m 0755    ${WORKDIR}/functions         ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/bootmisc.sh       ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/checkroot.sh      ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/finish            ${D}${sysconfdir}/init.d
@@ -82,7 +72,7 @@ do_install () {
        install -m 0755    ${WORKDIR}/devpts            ${D}${sysconfdir}/default
        install -m 0755    ${WORKDIR}/sysfs.sh          ${D}${sysconfdir}/init.d
        install -m 0755    ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
-       install -m 0755    ${WORKDIR}/save-rtc.sh       ${D}${sysconfdir}/init.d        
+       install -m 0755    ${WORKDIR}/save-rtc.sh       ${D}${sysconfdir}/init.d
        install -m 0644    ${WORKDIR}/volatiles         ${D}${sysconfdir}/default/volatiles/00_core
        if [ "${TARGET_ARCH}" = "arm" ]; then
                install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d
@@ -90,13 +80,6 @@ do_install () {
 #
 # Install device dependent scripts
 #
-
-       if [ "${DISTRO}" = "openzaurus" ]; then
-               cat ${WORKDIR}/checkversion | sed -e "s,VERSION,${KERNEL_VERSION}-${DISTRO_VERSION}," > ${D}${sysconfdir}/init.d/checkversion
-               chmod 0755      ${D}${sysconfdir}/init.d/checkversion
-               ln -sf          ../init.d/checkversion  ${D}${sysconfdir}/rcS.d/S01version
-       fi
-
        install -m 0755 ${WORKDIR}/banner       ${D}${sysconfdir}/init.d/banner
        install -m 0755 ${WORKDIR}/devices      ${D}${sysconfdir}/init.d/devices
        install -m 0755 ${WORKDIR}/umountfs     ${D}${sysconfdir}/init.d/umountfs
@@ -112,7 +95,7 @@ do_install () {
        ln -sf          ../init.d/umountnfs.sh  ${D}${sysconfdir}/rc6.d/S31umountnfs.sh
        ln -sf          ../init.d/umountfs      ${D}${sysconfdir}/rc6.d/S40umountfs
        # udev will run at S55 if installed
-       ln -sf          ../init.d/ramdisk       ${D}${sysconfdir}/rcS.d/S30ramdisk 
+       ln -sf          ../init.d/ramdisk       ${D}${sysconfdir}/rcS.d/S30ramdisk
        ln -sf          ../init.d/reboot        ${D}${sysconfdir}/rc6.d/S90reboot
        ln -sf          ../init.d/sendsigs      ${D}${sysconfdir}/rc0.d/S20sendsigs
 #      ln -sf          ../init.d/urandom       ${D}${sysconfdir}/rc0.d/S30urandom
@@ -121,7 +104,7 @@ do_install () {
        # udev will run at S55 if installed
        ln -sf          ../init.d/halt          ${D}${sysconfdir}/rc0.d/S90halt
        ln -sf          ../init.d/save-rtc.sh   ${D}${sysconfdir}/rc0.d/S25save-rtc.sh
-       ln -sf          ../init.d/save-rtc.sh   ${D}${sysconfdir}/rc6.d/S25save-rtc.sh          
+       ln -sf          ../init.d/save-rtc.sh   ${D}${sysconfdir}/rc6.d/S25save-rtc.sh
        ln -sf          ../init.d/banner        ${D}${sysconfdir}/rcS.d/S02banner
        ln -sf          ../init.d/checkroot.sh  ${D}${sysconfdir}/rcS.d/S10checkroot.sh
 #      ln -sf          ../init.d/checkfs.sh    ${D}${sysconfdir}/rcS.d/S30checkfs.sh