观察uboot的环境变量

uboot缺少UEFI那样的图形界面,灵活性不如UEFI。正因为此,uboot的环境变量就变得更加重要。

在幽兰众,可以安装uboot的环境变量开发包和工具,包括:

geduer@ulan:~$ apt-cache search uboot
libubootenv-dev - Library to access U-Boot environment - development files
libubootenv-doc - Library to access U-Boot environment - document
libubootenv-tool - Library to access U-Boot environment - tool
libubootenv0.1 - Library to access U-Boot environment - runtime
golang-github-mvo5-uboot-go-dev - Read/write uboot environment
python3-mboot - Module for communication with NXP MCU Bootloader (Python 3)
uuu - Freescale/NXP I.MX Chip image deploy tools

比如执行如下命令就可以安装uboot的环境变量工具:
sudo apt install libubootenv-tool

安装后,就是使用fw_printenv来观察uboot环境变量,用fw_setenv来设置环境变量了。

fw_setenv mytestvariable abcdefg

fw_printenv mytestvariable

mytestenv=abcdefg

对于使用uefi启动的幽兰,执行fw_printenv会显示错误:
geduer@ulan:~$ fw_printenv
Configuration file wrong or corrupted

作者:Zhang Yinkui  创建时间:2024-04-03 09:51
最后编辑:Zhang Yinkui  更新时间:2024-05-06 17:42