[Buildroot] [PATCH v4] Allow a single DHCP configuration via the system configuration submenu

Peter Korsgaard peter at korsgaard.com
Mon Feb 2 16:36:31 UTC 2015


>>>>> "Jérémy" == Jérémy Rosen <jeremy.rosen at openwide.fr> writes:

Hi,

 > This patch allows the setup of simple a single interface to be
 > automatically brought up and configured via DHCP on system startup.

 > The interface name can be set via a configuration option. This patch
 > does not support systemd-networkd, any complex network configuration should
 > be done via overlay of /etc/network/interfaces or the relevant networkd
 > configuration file

 > Signed-off-by: Jérémy Rosen <jeremy.rosen at openwide.fr>

 > ---
 > v4 : - changed condition to also depend on ifupdown or busybox
 >        suggestion by Gustavo Zacarias

Sorry for the slow response. We have discussed this during the dev days
and agreed to include it. Committed with some changes, see below.

Thanks!

> +config BR2_SIMPLE_DHCP

We're not completely consist with this, but the new system options are
called BR2_SYSTEM_*, so I've renamed to the option.

> +	string "Name of the physical network interface to run DHCP on"

This is quite long, so I reworded it to:

"Network interface to configure through DHCP"

> +	default ""
 > +	depends on !BR2_PACKAGE_SYSTEMD_NETWORKD && (BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_IFUPDOWN)
 > +	help
 > +	  The name of the network interface to configure automatically.
 > +	  A DHCP request will automatically happen on startup on the selected
 > +	  interface.

And here I reworded it a bit and mentioned an example (eth0).

 
 > +define SET_NETWORK_LOCALHOST
 > +        echo "# interface file auto-generated by buildroot" >  $(TARGET_DIR)/etc/network/interfaces
 > +        echo                                                >> $(TARGET_DIR)/etc/network/interfaces
 > +        echo "auto lo"                                      >> $(TARGET_DIR)/etc/network/interfaces
 > +        echo "iface lo inet loopback"                       >> $(TARGET_DIR)/etc/network/interfaces
 > +        echo                                                >> $(TARGET_DIR)/etc/network/interfaces
 > +endef

Elsewhere in BR we use syntax like:

( \
  echo foo ; \
  echo bar ; \
) > file

Which is a bit less verbose, so I've changed it to that.

-- 
Bye, Peter Korsgaard


More information about the buildroot mailing list