瀏覽代碼

ifupdown-script: send current hostname in DHCP request

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.

Notice that this may not be handled by all DHCP clients.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Peter Korsgaard 6 年之前
父節點
當前提交
7a3f85ddff
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      package/ifupdown-scripts/ifupdown-scripts.mk

+ 1 - 0
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