...
The source files of the fw_printenv
utility reside in the U-boot source tree, which is located in the u-boot/ sub-directory in the Emcraft software distribution.
fw_setenv
and fw_printenv
are included in the default rootfs project. The utilities are built during the rootfs compilation according to the rules specified in the projects/rootfs/env/Makefile
:
The U-Boot source tree is configured for the NXP i.MX RT1050 RT10XX EVK board;
The
fw_printenv
utility is built.
When run on the target, the utility makes use of a configuration file that defines the geometry of the device and where the U-Boot environment is located in it. Since we keep the environment on the SD Card here is what the configuration file looks like for the NXP i.MX RT1050 RT10XX EVK board:
Code Block |
---|
$ cat projects/rootfs/etc/fw_env.config.mmc # Configuration file for fw_(printenv/setenv) utility. # Up to two entries are valid, in this case the redundant # environment sector is assumed present. # Configuration for a board with CONFIG_ENV_IS_IN_MMC # # MTD device name Device offset Env. size /dev/mmcblk0 0x80000 0x1f000 |
In theĀ rootfs
project, the fw_setenv
and the configuration file are added to
...
rootfs.initramfs
:
...
Code Block |
---|
... file /bin/fw_printenv ${INSTALL_ROOT}/u-boot/tools/env/fw_printenv 755 0 0 slink /bin/fw_setenv fw_printenv 755 0 0 ... ifarch IMXRT105X_NXPEVK file /etc/fw_env.config ${INSTALL_ROOT}/projects/${SAMPLE}/etc/fw_env.config.mmc 644 0 0 ... |
...