[U-Boot] dhcp command not populating dnsip environment variable

Duncan Hare dh at synoia.com
Sun Mar 18 20:01:11 UTC 2018


Cause: u-boot/Kconfig DISTRO_DEFAULTS missing variables in Kconfig files

u-boot/ config DISTRO_DEFAULTS contains these directives:

        select HUSH_PARSER
        select BOOTP_BOOTPATH if NET && CMD_NET
        select BOOTP_DNS if NET && CMD_NET
        select BOOTP_GATEWAY if NET && CMD_NET
        select BOOTP_HOSTNAME if NET && CMD_NET
        select BOOTP_PXE if NET && CMD_NET
        select BOOTP_SUBNETMASK if NET && CMD_NET
        select CMDLINE_EDITING
        select AUTO_COMPLETE
        select SYS_LONGHELP

However net/Kconfig has no references to:
        BOOTP_BOOTPATH
        BOOTP_DNS
        BOOTP_GATEWAY
        BOOTP_HOSTNAME
        BOOTP_PXE
        BOOTP_SUBNETMASK

and possibly common/Kconfig no reference to
	HUSH_PARSER
        CMDLINE_EDITING
        AUTO_COMPLETE
        SYS_LONGHELP

Synptom: Causing the lack of option returned on a dhcp request.

Solutions: Three possible solutions to net/Kconfig omissions
 
1. Add them to Kconfig and select then cmd/Kconfig

2. As they are bootp/dhcp options, always include them ny removing the
preprocessor (ifdef) selections. The code fragments they require are
small, as is the space for the options returned.

3.Configure them when NET and BOOTP or DHCP commands are selected. It
appears they are subordinate to NET features and not stand alone config
options.

I recommend (2). I'm from the simple is good school. This level of
granularity of configuration of the bootp/dchp options appears
unnecessary.

Further action

There needs to be a compile time warning when a select clause in Kconfig
references a directive which does not exist in any included Kconfig
file. Mysteries which require days to find the config variable or days
to resolve are not user friendly.

Any Kconfig define which requires more than a second level
menu option needs close scrutiny. As much as possible a third or
higher level configuration define should be controlled by a
"select" by lower level Kconfig selection.

For documentation there needs to be an autogenerated Kconfig tree,
of the complete tree and with highlighted currently selected 
items. An example of this is the systemd "systemctl list
dependencies" command.




More information about the U-Boot mailing list