| 493 | |
| 494 | |
| 495 | ==== Configuring u-boot-tools |
| 496 | A file defining where your environment is located must be present for u-boot-tools to work. Without this file you will receive an error: |
| 497 | {{{#!bash |
| 498 | Cannot parse config file '/etc/fw_env.config': No such file or directory |
| 499 | }}} |
| 500 | Examples: |
| 501 | * Ventana booting from NAND |
| 502 | {{{#!bash |
| 503 | #Create config file |
| 504 | cat << EOF > /etc/fw_env.config |
| 505 | # device offset size erasesize |
| 506 | /dev/mtd1 0x0 0x20000 0x40000 |
| 507 | /dev/mtd1 0x80000 0x20000 0x40000 |
| 508 | EOF |
| 509 | }}} |
| 510 | * Ventana MMC only |
| 511 | {{{#!bash |
| 512 | #Create config file |
| 513 | cat << EOF > /etc/fw_env.config |
| 514 | # device offset size erasesize |
| 515 | /dev/mmcblk0 0xb1400 0x20000 0x20000 |
| 516 | /dev/mmcblk0 0xd1400 0x20000 0x20000 |
| 517 | EOF |
| 518 | }}} |
| 519 | * A file for building an image |
| 520 | {{{#!bash |
| 521 | #Create config file |
| 522 | cat << EOF > /working/fw_env.config |
| 523 | # device offset size erasesize |
| 524 | envVentana.bin 0x00000 0x20000 |
| 525 | envVentana.bin 0x20000 0x20000 |
| 526 | EOF |
| 527 | }}} |
| 528 | |
| 529 | This will define the device being used, offset according to flash layout, size from flash map, and size of erase block (unless the device is a file). Ventana U-boot environment is redundant hence two entries, both locations need their variables updated. |
| 530 | |
| 531 | ==== Usage example |
| 532 | |
| 533 | {{{#!bash |
| 534 | # display environment |
| 535 | fw_printenv |
| 536 | # set environment variable |
| 537 | fw_setenv foo bar #foo being variable name bar being value variable will be set to |
| 538 | #second example |
| 539 | fw_setenv ipaddr 192.168.1.10 |
| 540 | #print single environment variable |
| 541 | fw_printenv foo |
| 542 | #second example |
| 543 | fw_printenv ipaddr |
| 544 | }}} |