add nvram.sh to all startup scripts, no errors on wgt634u
authorwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 10 Sep 2005 18:28:33 +0000 (18:28 +0000)
committerwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 10 Sep 2005 18:28:33 +0000 (18:28 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1892 3c298f89-4303-0410-b956-a3cf2f4a3e73

openwrt/package/base-files/default/etc/functions.sh
openwrt/package/base-files/default/etc/init.d/S10boot
openwrt/package/base-files/default/etc/init.d/rcS
openwrt/package/base-files/default/etc/nvram.sh [new file with mode: 0644]
openwrt/package/base-files/default/etc/preinit
openwrt/package/base-files/default/sbin/mount_root

index 14f5011..c813e39 100755 (executable)
@@ -1,22 +1,8 @@
 #!/bin/ash
+. /etc/nvram.sh
 
 alias debug=${DEBUG:-:}
 
-# allow env to override nvram
-nvram () {
-  if [ -x /usr/sbin/nvram ]; then
-    case $1 in
-      get) eval "echo \${$2:-\$(command nvram get $2)}";;
-      *) command nvram $*;;
-    esac
-  else
-    case $1 in
-      get) eval "echo \${$2:-\${DEFAULT_$2}}";;
-      *);;
-    esac
-  fi  
-}
-
 # valid interface?
 if_valid () (
   ifconfig "$1" >&- 2>&- ||
index 37eb7b3..3ec41b1 100755 (executable)
@@ -1,5 +1,8 @@
 #!/bin/sh
-echo "S" > /proc/jffs2_bbc
+. /etc/nvram.sh
+if [ "$(uname -r|grep 2.4)" = "0" ];do
+       echo "S" > /proc/jffs2_bbc
+done
 
 mkdir -p /var/run
 mkdir -p /var/log
index 7065858..10079c5 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+. /etc/nvram.sh
 syslog_ip=$(nvram get log_ipaddr)
 ipcalc -s "$syslog_ip" || syslog_ip=""
 syslogd -C 16 ${syslog_ip:+-L -R $syslog_ip}
diff --git a/openwrt/package/base-files/default/etc/nvram.sh b/openwrt/package/base-files/default/etc/nvram.sh
new file mode 100644 (file)
index 0000000..f1170ac
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/ash
+
+# allow env to override nvram
+nvram () {
+  if [ -x /usr/sbin/nvram ]; then
+    case $1 in
+      get) eval "echo \${$2:-\$(command nvram get $2)}";;
+      *) command nvram $*;;
+    esac
+  else
+    case $1 in
+      get) eval "echo \${$2:-\${DEFAULT_$2}}";;
+      *);;
+    esac
+  fi  
+}
+
index b23f883..34de88c 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+. /etc/nvram.sh
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 mount none /proc -t proc
 insmod diag
index 29c5126..ae78ee4 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+. /etc/nvram.sh
 if [ "$1" != "failsafe" ]; then 
        mount | grep jffs2 >&-
        if [ $? = 0 ] ; then
This page took 0.028807 seconds and 4 git commands to generate.