waf*_*man 11 embedded-linux u-boot
有谁知道从用户空间安装U-boot版本的方法?有fw_printenv命令可以访问U-boot的环境变量,但不能访问版本.
小智 16
如果U-boot位于mtd0中,您可以获得如下版本信息:
root@SUPERWIFI:/proc# strings /dev/mtd0 | grep U-Boot
U-Boot 1.1.4-g1c8343c8-dirty (Feb 28 2014 - 13:56:54)
U-Boot
Now running in RAM - U-Boot at: %08lx
Run Code Online (Sandbox Code Playgroud)
小智 5
只是对此的更新。在我们的 U-Boot 版本中,我们将 main.c 中 main_loop() 的代码更改为:
#ifdef CONFIG_VERSION_VARIABLE
char *oldver=getenv("ver");
if(oldver==0 ||strcmp(oldver,version_string))
{
setenv("ver", version_string); /* set version variable */
saveenv();
}
#endif /* CONFIG_VERSION_VARIABLE */
Run Code Online (Sandbox Code Playgroud)
因此,仅在更新需要时才会调用 setenv/saveenv。在我们的固件中添加了
/sbin/fw_printenv -n ver > /var/config/u-boot.ver
Run Code Online (Sandbox Code Playgroud)
使 u-boot 版本公开。
没有明确的方法可以做到这一点。一旦 Linux 启动,u-boot 就不再运行,它的 RAM 被回收供 Linux 使用。Linux 甚至不知道 u-boot。它也不必由 u-boot 启动。
如果你真的想这样做,唯一的方法是将 u-boot 版本添加到内核的命令行中,编写代码来扫描闪存中的 u-boot 映像以获取其版本,或者甚至更糟糕的方法。
归档时间: |
|
查看次数: |
16734 次 |
最近记录: |