uboot默认环境变量设置

common/Kconfig:

config BOOTCOMMAND
        string "bootcmd value"
        depends on USE_BOOTCOMMAND
        default "tftp c2000000 uImage;tftp c4000000 stm32mp157d-atk.dtb;bootm c2000000 - c4000000" if DISTRO_DEFAULTS
        help
          This is the string of commands that will be used as bootcmd and if
          AUTOBOOT is set, automatically run.

config NET_IPADDR
        string "ipaddr value"
        depends on USE_BOOTCOMMAND
        default "192.168.100.150" if DISTRO_DEFAULTS
        help
          This is the string of commands that will be used as ipaddr and if
          AUTOBOOT is set, automatically run.

config NET_ETHADDR
        string "ethaddr value"
        depends on USE_BOOTCOMMAND
        default "b8:ae:1d:01:01:00" if DISTRO_DEFAULTS
        help
          This is the string of commands that will be used as ethaddr and if
          AUTOBOOT is set, automatically run.

config NET_GATEWAYIP
        string "gateway ip value"
        depends on USE_BOOTCOMMAND     

        default "192.168.100.1" if DISTRO_DEFAULTS
        help
          This is the string of commands that will be used as gateway ip and if
          AUTOBOOT is set, automatically run.

config NET_MASK
        string "gateway ip value"
        depends on USE_BOOTCOMMAND
        default "255.255.255.0" if DISTRO_DEFAULTS
        help
          This is the string of commands that will be used as gateway ip and if
          AUTOBOOT is set, automatically run.

config NET_SERVERIP
        string "server ip value"
        depends on USE_BOOTCOMMAND
        default "192.168.100.122" if DISTRO_DEFAULTS
        help
          This is the string of commands that will be used as gateway ip and if
          AUTOBOOT is set, automatically run.
 

include/env_default.h:

#ifdef  CONFIG_NET_IPADDR //CONFIG_IPADDR
        "ipaddr="       CONFIG_NET_IPADDR               "\0" /* __stringify(CONFIG_IPADDR)      "\0"*/
#endif
#ifdef  CONFIG_NET_ETHADDR
        "ethaddr="      CONFIG_NET_ETHADDR              "\0"
#endif
#ifdef  CONFIG_NET_GATEWAYIP
        "gatewayip="    CONFIG_NET_GATEWAYIP            "\0"
#endif
#ifdef  CONFIG_NET_MASK
        "netmask="      CONFIG_NET_MASK                 "\0"
#endif
#ifdef  CONFIG_NET_SERVERIP //CONFIG_SERVERIP
        "serverip="     CONFIG_NET_SERVERIP             "\0" //__stringify(CONFIG_SERVERIP)     "\0"
#endif
 

                                                                       397,23-30     37%

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值