Uboot 中的hush shell
来源:互联网 发布:linux私房菜在线阅读 编辑:程序博客网 时间:2024/06/06 19:33
今天有一个要求,要在uboot启动后不断的执行一些命令。方法记录一下:
1.直接改代码,比较麻烦。
2.制作uboot的执行脚本,用mkimage命令,然后通过tftp下载到内存,然后通过source命令来执行。这个也挺麻烦的。
3.还有一个方法是使用hush shell,uboot中定义了CONFIG_SYS_HUSH_PARSE就可以支持,
网上有资料说uboot中的hush shell是从busybox移植来的,进行了一些精简。但是查找hush shell的使用资料没有找到,直接把好用的命令记下来吧
setenv loopping while true\; do ping 192.168.1.1\; done\;
run loopping
这里是实现不停的执行ping命令。
下面贴一下资料,供参考和进一步研究
Hush shell:
- similar to Bourne shell, with control structures like
if...then...else...fi
,for...do...done
,while...do...done
,until...do...done
, ... - supports environment ("global") variables (through
setenv
/saveenv
commands) and local shell variables (through standard shell syntaxname=value
); only environment variables can be used with therun
command, especially as the variable to run (i. e. the first argument). - In the current implementation, the local variables space and global environment variables space are separated. Local variables are those you define by simply typing like
name=value
. To access a local variable later on, you have to write'$name'
or'${name}'
; to execute the contents of a variable directly you can type'$name'
at the command prompt. Note that local variables can only be used for simple commands, not for compound commands etc. - Global environment variables are those you can set and print using
setenv
andprintenv
. To run a command stored in such a variable, you need to use therun
command, and you must not use the '$' sign to access them. - To store commands and special characters in a variable, use single quotation marks surrounding the whole text of the variable, instead of the backslashes before semicolons and special symbols.
- Be careful when using the hash ('#') character - like with a "real" Bourne shell it is the comment character, so you have to escape it when you use it in the value of a variable.
Examples:
setenv bootcmd bootm \$address setenv addip 'setenv bootargs $bootargs ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:off'
阅读全文
0 0
- Uboot 中的hush shell
- Uboot之hush方式解析用户命令
- hdu5183 hush
- uboot之shell学习
- Keep it hush-hush 保密啊
- uboot脚本(类似于shell)
- API EnumFontFamilies Hush, Hard1
- uboot中的TEXT_BASE
- uboot中的TEXT_BASE
- uboot中的TEXT_BASE
- uboot 中的 start_armboot (void)
- ARM uboot中的.lds
- uboot中的TEXT_BASE
- uboot 中的main_loop分析
- uboot中的TEXT_BASE
- ARM uboot中的.lds
- uboot中的TEXT_BASE
- uboot中的命令解析
- Mongo入门
- Windows10 以管理员身份运行的解决办法
- 爬虫小程序-01
- 原型设计工具Axure
- 文章标题
- Uboot 中的hush shell
- 使用docker部署zookeeper的一般步骤
- 使用RDS和本地mysql做主从同步,实现多服务器数据同步
- Thinking in java-11 Everything is an object
- POI实现将表格数据保存到excel2007
- 利用 test 命令的测试功能
- Vue.js 入门提纲
- hibernate 逆向工程 生成实体加映射文件
- nodejs入门