프로그램 사용/u-boot2010. 1. 22. 19:50
denx.de에 나온 메시지는 아래와는 좀 다른데,

GUNZIP ERROR - must RESET board to recover
에러가 발생할경우, 메모리가 부족해서 겹쳐서 제대로 압축을 해제하지 못했을 가능성이 있다고 한다.
그것도 아니라면.. 도대체 머가 문제일까?

   Verifying Checksum ... OK
   Uncompressing Kernel Image ... Error: Bad gzipped data
GUNZIP ERROR - must RESET board to recover

[링크 : http://www.denx.de/wiki/view/DULG/Manual]
    [링크 : http://www.denx.de/wiki/view/DULG/HowCanILoadAndUncompressACompressedImage]
    [링크 : http://www.denx.de/wiki/view/DULG/LinuxHangsAfterUncompressingKernel]
    [링크 : http://www.denx.de/wiki/view/DULG/LinuxUncompressingError]
Posted by 구차니
프로그램 사용/u-boot2009. 12. 30. 12:26
당연한것 일수도 있지만, u-boot에서 kernel로 argument를 날려주고
그 인자들 중, NIC 관련 변수들을 파싱하여 자동으로 네트워크를 설정하게 되는데
인자를 ' '(홀따옴표)로 감싸주어 커널에서 파싱하도록 할 수 있다.

물론, bootargs에 한번에 넣어서는 불가능하며,
run 명령어를 통해서 인자를 생성후 넘겨주는 방식을 취한다.

We can use U-Boot environment variables to store all necessary configuration parameters:

=> setenv ipaddr 192.168.100.6
=> setenv serverip 192.168.1.1
=> setenv netmask 255.255.0.0
=> setenv hostname canyonlands
=> setenv rootpath /opt/eldk-4.2/ppc_4xx
=> saveenv

Then you can use these variables to build the boot arguments to be passed to the Linux kernel:

=> setenv nfsargs 'root=/dev/nfs rw nfsroot=${serverip}:${rootpath}'


Note: You cannot use this method directly to define for example the "bootargs" environment variable, as the implicit usage of this variable by the "bootm" command will not trigger variable expansion - this happens only when using the "setenv" command.

[링크 : http://www.denx.de/wiki/DULG/LinuxBootArgs]


사용예
setenv nfsargs 'setenv bootargs console=ttyAS0,115200 root=/dev/mtdblock2 rootfstype=cramfs'
setenv addip 'setenv bootargs ${bootargs} nwhwconf=device:eth0,hwaddr:${ethaddr}
                    ip=${ipaddr}::${gateway}:${netmask}:${histname}::off'
setenv bootcmd 'run nfsargs addip\; tftp 0x84400000 uImage\; bootm'

아무튼, bootcmd 에 'run' 을 통해서 bootargs를 생성후 임시 변수를 커널로 넘겨주는 방식이다.
(실제로 bootargs 변수는 uboot에 존재하지 않는다.)
Posted by 구차니
프로그램 사용/u-boot2009. 7. 18. 13:09
u-boot/tools/env 에 있는 README 파일 번역입니다.

이것은 U-boot의 환경 변수를 읽어오는 리눅스 명령행 프로그램의 적용예제 입니다.

run-time 유틸리티 설정을 위해서 다음의 줄을 주석처리 합니다.
fw_env.h 파일의
    #define CONFIG_FILE  "/etc/fw_env.config"

특정 타겟 보드를 위한 define들은 fw_env.confg 파일의 주석을  보시기 바랍니다.

화경설정은 fw_env.h 파일의 #define들을 통해 할 수 있습니다.
아래의 내용을 수정하시면 됩니다.

    #define HAVE_REDUND     /* 환경변수 영역이 2개일 경우 */
    #define DEVICE1_NAME    "/dev/mtd1"
    #define DEVICE2_NAME    "/dev/mtd2"
    #define DEVICE1_OFFSET    0x0000
    #define ENV1_SIZE         0x4000
    #define DEVICE1_ESIZE     0x4000
    #define DEVICE2_OFFSET    0x0000
    #define ENV2_SIZE         0x4000
    #define DEVICE2_ESIZE     0x4000

현재의 설정은 TRAB 보드에 맞추어져 있습니다.

백업용 환경변수 영역을 사용하지 않는다면 HAVE_REFUND를 주석처리합니다.
HAVE_REDUND 가 주석처리 되면 DEVICE2_NAME, ENV2_SIZE, DEVICE2_ESIZE 를 무시합니다.

DEVICEx_NAME 에는 환경변수가 저장되어 있는 MTD 캐릭터 디바이스를 지정합니다.
DEVICEx_OFFSET 에는 MTD 캐릭터 디바이스 범위 안의 환경변수의 offset을 지정합니다.
ENVx_SIZE 에는 (만약에 환경변수가 하나의 섹터크기 보다 적다면 플래시 섹터보다 작은 값을 지닐) 환경변수에 의해 사용되는 크기를 지정합니다.
DEVICEx_ESIZE 환경변수가 위치하는 플래시 파티션의 첫 섹터의 크기를 지정합니다.


Posted by 구차니
프로그램 사용/u-boot2009. 3. 25. 18:51

14.3.27. How can I access U-Boot environment variables in Linux?

Question:
I would like to access U-Boot's environment variables from my Linux application. Is this possible?

Answer:
Yes, you can. The environment variables must be stored in flash memory, and your Linux kernel must support flash access through the MTD layer. In the U-Boot source tree you can find the environment tools in the directory tools/env, which can be built with command:

make env

For building against older versions of the MTD headers (meaning before v2.6.8-rc1) it is required to pass the argument "MTD_VERSION=old" to make:

make MTD_VERSION=old env

The resulting binary is called fw_printenv, but actually includes support for setting environment variables too. To achieve this, the binary behaves according to the name it is invoked as, so you will have to create a link called fw_setenv to fw_printenv.

These tools work exactly like the U-Boot commands printenv resp. setenv You can either build these tools with a fixed configuration selected at compile time, or you can configure the tools using the /etc/fw_env.config configuration file in your target root filesystem.

[링크 : http://www.denx.de/wiki/view/DULG/HowCanIAccessUBootEnvironmentVariablesInLinux]

2010.03.11 추가
간단하게 말하자면 eboot 소스트리에서
u-boot/tools/env 에서
fw_env를 컴파일 하게 되면
fw_setenv
fw_getenv 파일이 생성된다. (물론 하나는 심볼릭 링크이다)

2009/07/18 - [프로그램 사용/u-boot] - U-Boot 환경변수 읽어오기 (u-boot environment variable)

Posted by 구차니