summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-02-03 08:44:50 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-02-03 08:44:50 +0000
commit43ed2ff89ddd96cb6b23d1345e3ed92847a31a58 (patch)
treeddf5516195a4469fb592a29f9b5161aee34724d4 /target/linux/ar71xx
parent9e624a714468404a7f950594edae43e79efeee80 (diff)
downloadmtk-20170518-43ed2ff89ddd96cb6b23d1345e3ed92847a31a58.zip
mtk-20170518-43ed2ff89ddd96cb6b23d1345e3ed92847a31a58.tar.gz
mtk-20170518-43ed2ff89ddd96cb6b23d1345e3ed92847a31a58.tar.bz2
parse RedBoot environments as well (patch by Jonas <jmajau@ubnt.com>)
SVN-Revision: 14384
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/prom.c8
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 5402e0a..29c6c97 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;
}