X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/4548d797802bd17460310f4f34346b42918e1762..03404c74a04d5f864d079631c8b9c4ec499cd84d:/openwrt/target/linux/package/base-files/files/brcm-2.4/etc/init.d/S05nvram diff --git a/openwrt/target/linux/package/base-files/files/brcm-2.4/etc/init.d/S05nvram b/openwrt/target/linux/package/base-files/files/brcm-2.4/etc/init.d/S05nvram index b3b4997fc..70fbd4662 100755 --- a/openwrt/target/linux/package/base-files/files/brcm-2.4/etc/init.d/S05nvram +++ b/openwrt/target/linux/package/base-files/files/brcm-2.4/etc/init.d/S05nvram @@ -6,6 +6,9 @@ . /etc/network.overrides alias debug=${DEBUG:-:} +# WGT634u +[ "$(/usr/bin/head -c4 /dev/mtdblock/1 | /usr/bin/tail -c3)" = "ELF" ] && exit + remap () { for type in lan wifi wan pppoe do @@ -21,9 +24,9 @@ nvram_default() { } nvram_set() { # for the linksys fixup part - [ "$(nvram get "$1")" = "$2" ] || { + [ "$(nvram get "$1")" = "$2" -a "$2" != "" ] || { COMMIT=1 - nvram set "$1=$2" + /usr/sbin/nvram set "$1=$2" } } @@ -35,7 +38,7 @@ adm_switch="$(( ($boardflags & 0x80) >> 7 ))" case "$(( $boardtype ))" in "$((0x708))") if [ "$adm_switch" = 0 ]; then - nvram_set sdram_init 0x010b + nvram_set sdram_init "$(printf 0x%04x $(( $(/usr/sbin/nvram get sdram_init) | 0x0100 )))" [ "$COMMIT" = 1 ] && { nvram_set sdram_config 0x0062 nvram_set clkfreq 216 @@ -49,7 +52,7 @@ case "$(( $boardtype ))" in fi ;; "$((0x467))") - nvram_set sdram_init 0x010c + nvram_set sdram_init "$(printf 0x%04x $(( $(/usr/sbin/nvram get sdram_init) | 0x0100 )))" [ "$COMMIT" = 1 ] && { nvram_set sdram_config 0x0062 nvram_set sdram_ncdl 0x0