Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] ifupdown-script: send current hostname in DHCP request
@ 2018-10-30 17:16 Peter Korsgaard
  2018-11-02  3:28 ` Matthew Weber
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2018-10-30 17:16 UTC (permalink / raw)
  To: buildroot

For the default (BR2_SYSTEM_DHCP) /etc/network/interfaces handling.

Both the "big" and busybox ifupdown variants pass the hostname argument to
the DHCP client through the shell, so we can use $() to expand to the
current hostname value.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/ifupdown-scripts/ifupdown-scripts.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk b/package/ifupdown-scripts/ifupdown-scripts.mk
index ebc89b3872..17364aed03 100644
--- a/package/ifupdown-scripts/ifupdown-scripts.mk
+++ b/package/ifupdown-scripts/ifupdown-scripts.mk
@@ -23,6 +23,7 @@ define IFUPDOWN_SCRIPTS_DHCP
 		echo "iface $(IFUPDOWN_SCRIPTS_DHCP_IFACE) inet dhcp"; \
 		echo "  pre-up /etc/network/nfs_check"; \
 		echo "  wait-delay 15"; \
+		echo "  hostname \$$(hostname)"; \
 	) >> $(TARGET_DIR)/etc/network/interfaces
 	$(INSTALL) -m 0755 -D $(IFUPDOWN_SCRIPTS_PKGDIR)/nfs_check \
 		$(TARGET_DIR)/etc/network/nfs_check
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] ifupdown-script: send current hostname in DHCP request
  2018-10-30 17:16 [Buildroot] [PATCH] ifupdown-script: send current hostname in DHCP request Peter Korsgaard
@ 2018-11-02  3:28 ` Matthew Weber
  2018-11-05 22:22   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Weber @ 2018-11-02  3:28 UTC (permalink / raw)
  To: buildroot

Peter,

On Tue, Oct 30, 2018 at 12:16 PM Peter Korsgaard <peter@korsgaard.com> wrote:
>
> For the default (BR2_SYSTEM_DHCP) /etc/network/interfaces handling.
>
> Both the "big" and busybox ifupdown variants pass the hostname argument to
> the DHCP client through the shell, so we can use $() to expand to the
> current hostname value.
>
The man page for the interfaces file mentioned that only pump, dhcpcd
and udhcpc use the hostname value from interfaces.  With dhclient
requiring the dhclient.conf to specify the set hostname option with
the hostname string.  Would it be worth mentioning that here in the
comment that for most (pump, dhcpcd, udhcpc) the hostname parameter
will work but some clients like dhclient require a separate
configuration file?

Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com>

> ---
>  package/ifupdown-scripts/ifupdown-scripts.mk | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/package/ifupdown-scripts/ifupdown-scripts.mk b/package/ifupdown-scripts/ifupdown-scripts.mk
> index ebc89b3872..17364aed03 100644
> --- a/package/ifupdown-scripts/ifupdown-scripts.mk
> +++ b/package/ifupdown-scripts/ifupdown-scripts.mk
> @@ -23,6 +23,7 @@ define IFUPDOWN_SCRIPTS_DHCP
>                 echo "iface $(IFUPDOWN_SCRIPTS_DHCP_IFACE) inet dhcp"; \
>                 echo "  pre-up /etc/network/nfs_check"; \
>                 echo "  wait-delay 15"; \
> +               echo "  hostname \$$(hostname)"; \
>         ) >> $(TARGET_DIR)/etc/network/interfaces
>         $(INSTALL) -m 0755 -D $(IFUPDOWN_SCRIPTS_PKGDIR)/nfs_check \
>                 $(TARGET_DIR)/etc/network/nfs_check
> --
> 2.11.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot



-- 
Matthew L Weber / Pr Software Engineer
Airborne Information Systems / RC Linux Secure Platforms
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
www.rockwellcollins.com

Note: Any Export License Required Information and License Restricted
Third Party Intellectual Property (TPIP) content must be encrypted and
sent to matthew.weber at corp.rockwellcollins.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] ifupdown-script: send current hostname in DHCP request
  2018-11-02  3:28 ` Matthew Weber
@ 2018-11-05 22:22   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-11-05 22:22 UTC (permalink / raw)
  To: buildroot

>>>>> "Matthew" == Matthew Weber <matthew.weber@rockwellcollins.com> writes:

 > Peter,
 > On Tue, Oct 30, 2018 at 12:16 PM Peter Korsgaard <peter@korsgaard.com> wrote:
 >> 
 >> For the default (BR2_SYSTEM_DHCP) /etc/network/interfaces handling.
 >> 
 >> Both the "big" and busybox ifupdown variants pass the hostname argument to
 >> the DHCP client through the shell, so we can use $() to expand to the
 >> current hostname value.
 >> 
 > The man page for the interfaces file mentioned that only pump, dhcpcd
 > and udhcpc use the hostname value from interfaces.  With dhclient
 > requiring the dhclient.conf to specify the set hostname option with
 > the hostname string.  Would it be worth mentioning that here in the
 > comment that for most (pump, dhcpcd, udhcpc) the hostname parameter
 > will work but some clients like dhclient require a separate
 > configuration file?

 > Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com>

I've added a comment about that and applied, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-05 22:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-30 17:16 [Buildroot] [PATCH] ifupdown-script: send current hostname in DHCP request Peter Korsgaard
2018-11-02  3:28 ` Matthew Weber
2018-11-05 22:22   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox