Uboot关于CONFIG_BOOTDELAY

全志A133 默认CONFIG_BOOTDELAY=2 如下,



config BOOTDELAY
	int "delay in seconds before automatically booting"
	default 2
	depends on AUTOBOOT
	help
	  Delay before automatically running bootcmd;
	  set to 0 to autoboot with no delay, but you can stop it by key input.
	  set to -1 to disable autoboot.
	  set to -2 to autoboot with no delay and not check for abort

	  See doc/README.autoboot for details.

通过修改longan\brandy\brandy-2.0\u-boot-2018\common\Kconfig中对应宏default的值,有对应解释

      常数是在自动运行bootcmd之前的延迟时间;
      设置为0表示无延迟自动引导,但您可以通过键盘按键停止它。
      设置为-1表示禁用自动引导。进入bootcmd
      设置为-2表示无延迟自动引导,不检查中止。正常开机

这样设置uboot环境变量区的bootdelay是-2,也就是没有启动延时了,我们也没办法再进去uboot菜单管理界面了。实测告诉你那是不行的,因为uboot每次启动他都先去读取了flash里面的环境变量,除非里面没任何数据才会来取这个宏的定义,同时要修改代码只要不让uboot从环境变量里面取不就行了吗!经过查看uboot源码,发现在源码文件“longan\brandy\brandy-2.0\u-boot-2018\common\autoboot.c”中做了如下的判断:

#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
    s = getenv ("bootdelay");
    bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
    debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);

先去取了环境变量的值做判断,有就直接用,那直接把这个判断去掉并改为每次都取“CONFIG_BOOTDELAY”的值不就行了,如下

#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
    s = getenv ("bootdelay");
    bootdelay = CONFIG_BOOTDELAY;
    debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);

 刷机验证完美去掉boot管理模式

  • 9
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wq2249358611

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值