如何取消定义 CONFIG_CMD_NET?

How to undefine CONFIG_CMD_NET?

我在我的 include/configs/.h 文件和包含文件中的任何地方都找不到此配置定义,在 configs/_defconfig 中也找不到,并且在配置 u-boot 后它仍然在 .config 文件中定义。我看到 tools/Makefile 中定义了此配置。是默认的吗?我应该在include/configs/.h 中使用#undef 还是在configs/_defconfig 中使用CONFIG_CMD_NET=n?什么比较好?

此配置选项描述为

CONFIG_CMD_NET:

   Network commands.                                 
   bootp - boot image via network using BOOTP/TFTP protocol   
   tftpboot - boot image via network using TFTP protocol  

   Symbol: CMD_NET [=y] 
   Type  : boolean                                
   Prompt: bootp, tftpboot  
     Location:   
       -> Command line interface  
         -> Network commands 
     Defined at cmd/Kconfig:403  
     Selects: NET [=n] 

您可以使用 make menuconfig 禁用 CMD_NET。

Command line interface
    Network commands
        [*] bootp, tftpboot

您还可以按照 README 文件中的建议,在开发板的配置文件中对您的配置进行硬编码:

EXAMPLE: If you want all functions except for network support you can write:

   #include "config_cmd_all.h"
   #undef CONFIG_CMD_NET