[ELDK] FW: help
Wolfgang Denk
wd at denx.de
Wed Nov 19 21:02:55 CET 2008
Dear =?iso-8859-1?Q?Ana_Cl=E1udia?=,
In message <52981DB05D3C5247A12D0AEE309F3CC23B5D823314 at INOAVREX11.ptin.corpPT.com> you wrote:
>
> I need your help to get the value of boot environment in kernel space.
> I add a new environment on boot. The name of this environment is "serialnumber".
Do you by any chance mean "serial#" instead? This is the standard name
at least.
> I can read this environments on boot , using the command "printenv".
...
> serialnumber=AABBCCDD00000000
Why do you reinvent the wheel? Why don't you use the already existing
(and well protected!) variables that are intended for this purpose?
> What I need is to read this value on my kernel module.
There are two easy and straightforward ways to do so:
1) Pass the data as part of the kernel command line, i. e. add
something like
setenv bootargs ${bootargs} serial#=${serial#}
to your boot command sequence. In your kenrel module you can then
read the settings from the kernel's command line.
2) Use the fw_printenv command in Linux user space to extract the
settings and pass it as module parameters when insmod'ing your
kernel module.
> I try to create a new function on kernel (a compile and test several image
Don't write new code. Use what already exists.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can fool some of the people all of the time, and You can fool all
of the people some of the time, but You can't fool mom.
More information about the eldk
mailing list