add nvram.sh to all startup scripts, no errors on wgt634u
authorWaldemar Brodkorb <mail@waldemar-brodkorb.de>
Sat, 10 Sep 2005 18:28:33 +0000 (18:28 +0000)
committerWaldemar Brodkorb <mail@waldemar-brodkorb.de>
Sat, 10 Sep 2005 18:28:33 +0000 (18:28 +0000)
SVN-Revision: 1892

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 14f5011db700ac86b15caeffb4eb19376d3d7f88..c813e39a6171b103c873c7ff8b90d6dd57c67c7b 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 37eb7b3cc765b164d5158b2d1ecef1554bf8b016..3ec41b1190e70dc1c0d63dbbed2d3bec7bb976c4 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 706585801ce4c31aa28d182ad92b9e4e5e4eaf3b..10079c59322a77ddd8e9d74add66a49973318385 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 b23f8833ef0a4c368af13bb5cae458cd32e9cc48..34de88c60212480d27bf9dc6516ad1edbe6a9fba 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 29c5126ba195fb1a8bbd86e7bfec478ec6fc2bcb..ae78ee4881a14120299e6a8ec5021419a5008e9d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/bin/sh
+. /etc/nvram.sh
 if [ "$1" != "failsafe" ]; then 
        mount | grep jffs2 >&-
        if [ $? = 0 ] ; then