diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-02-03 08:44:50 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2009-02-03 08:44:50 +0000 |
commit | 7dcb6b3cfd3a41891bf17d42c467cb1fce6b3ffb (patch) | |
tree | 8072a5cfc6b2c079c821a7f8a4612a69f027fe1f /target/linux/ar71xx/files/arch | |
parent | 9a1a756ef529c5f58ab118c49926ee6cddb83c88 (diff) |
[ar71xx] parse RedBoot environments as well (patch by Jonas <jmajau@ubnt.com>)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14384 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch')
-rw-r--r-- | target/linux/ar71xx/files/arch/mips/ar71xx/prom.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c index 5402e0a54..29c6c97cc 100644 --- a/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c +++ b/target/linux/ar71xx/files/arch/mips/ar71xx/prom.c @@ -115,10 +115,16 @@ static __init char *ar71xx_prom_getenv(const char *envname) if (!is_valid_ram_addr(ar71xx_prom_envp)) return NULL; - for (env = ar71xx_prom_envp; is_valid_ram_addr(*env); env++) + for (env = ar71xx_prom_envp; is_valid_ram_addr(*env); env++) { if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=') return *env + len + 1; + /* RedBoot env comes in pointer pairs - key, value */ + if (strncmp(envname, *env, len) == 0 && (*env)[len] == 0) + if (is_valid_ram_addr(*(++env))) + return *env; + } + return NULL; } |