aboutsummaryrefslogtreecommitdiff
path: root/system/system.mk
diff options
context:
space:
mode:
Diffstat (limited to 'system/system.mk')
-rw-r--r--system/system.mk29
1 files changed, 29 insertions, 0 deletions
diff --git a/system/system.mk b/system/system.mk
index e4a3160e51..4a1eb4a4a1 100644
--- a/system/system.mk
+++ b/system/system.mk
@@ -38,6 +38,35 @@ ifneq ($(TARGET_GENERIC_ROOT_PASSWD),)
TARGETS += host-mkpasswd
endif
+define SET_NETWORK_LOCALHOST
+ ( \
+ echo "# interface file auto-generated by buildroot"; \
+ echo ; \
+ echo "auto lo"; \
+ echo "iface lo inet loopback"; \
+ ) > $(TARGET_DIR)/etc/network/interfaces
+endef
+
+NETWORK_DHCP_IFACE = $(call qstrip,$(BR2_SYSTEM_DHCP))
+
+ifneq ($(NETWORK_DHCP_IFACE),)
+define SET_NETWORK_DHCP
+ ( \
+ echo ; \
+ echo "auto $(NETWORK_DHCP_IFACE)"; \
+ echo "iface $(NETWORK_DHCP_IFACE) inet dhcp"; \
+ ) >> $(TARGET_DIR)/etc/network/interfaces
+endef
+endif
+
+define SET_NETWORK
+ mkdir -p $(TARGET_DIR)/etc/network/
+ $(SET_NETWORK_LOCALHOST)
+ $(SET_NETWORK_DHCP)
+endef
+
+TARGET_FINALIZE_HOOKS += SET_NETWORK
+
ifeq ($(BR2_ROOTFS_SKELETON_DEFAULT),y)
define SYSTEM_ROOT_PASSWD