gpt4 book ai didi

linux - uboot : Overwrite mmcboot environment variable not working

转载 作者:太空宇宙 更新时间:2023-11-04 05:14:24 27 4
gpt4 key购买 nike

我试图覆盖 uboot bootcmd 环境变量,但它继续使用默认设置。我知道我可以在 uboot 提示符中设置它,它将永久保存,但我希望能够通过代码自动设置它。

在我的主板配置文件中

#include <config_distro_bootcmd.h>

#ifdef CONFIG_BOOTCOMMAND
#undef CONFIG_BOOTCOMMAND
#endif
#define CONFIG_BOOTCOMMAND \
"echo hello world; " \

但是当我启动 uboot 并 printenv mmcboot 时,默认值集已配置:

    => printenv mmcboot
mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc;
if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage;
then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
=>

如果在 defconfig 文件中设置 CONFIG_DISTRO_DEFAULTS=n 我会收到编译错误。

include/config_distro_bootcmd.h:314:2: error: expected '}' before 'BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE'
BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
^
include/config_distro_bootcmd.h:314:2: note: in definition of macro 'BOOTENV_DEV_NAME_PXE'
BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/configs/am335x_p230.h:101:2: note: in expansion of macro 'BOOTENV_DEV_NAME'
func(PXE, pxe, na) \
^~~~
include/config_distro_bootcmd.h:320:18: note: in expansion of macro 'BOOT_TARGET_DEVICES'
"boot_targets=" BOOT_TARGET_DEVICES(BOOTENV_DEV_NAME) "\0"
^~~~~~~~~~~~~~~~~~~
include/config_distro_bootcmd.h:337:2: note: in expansion of macro 'BOOTENV_BOOT_TARGETS'
BOOTENV_BOOT_TARGETS \
^~~~~~~~~~~~~~~~~~~~
include/configs/am335x_p230.h:208:2: note: in expansion of macro 'BOOTENV'
BOOTENV
^~~~~~~
include/env_default.h:108:2: note: in expansion of macro 'CONFIG_EXTRA_ENV_SETTINGS'
CONFIG_EXTRA_ENV_SETTINGS

最佳答案

无需费力编码。使用

make menuconfig

搜索CONFIG_BOOTCOMMAND并编辑值。

关于linux - uboot : Overwrite mmcboot environment variable not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51302105/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com