diff options
author | warhog <warhog@gmx.de> | 2011-08-28 15:05:13 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2011-08-29 05:05:09 +0200 |
commit | a3f13b147ab6e48be91dedbe116411196f1448b0 (patch) | |
tree | 4fe8122463a759b881f7b10d99b90031dfb1297a /package | |
parent | 5b264e378044b2de6541676d0c04d50e97c98f60 (diff) |
added logic for simple network config
Diffstat (limited to 'package')
-rw-r--r-- | package/base-files/Makefile | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index a1cf05491..974823904 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -81,4 +81,75 @@ ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},) chmod 600 $(IDIR_BASE_FILES)/etc/adkconfig.gz endif + + +# simple network configuration +ifneq (${ADK_SIMPLE_NETWORK_CONFIG},) + ${INSTALL_DIR} ${IDIR_BASE_FILES}/etc/network + + # network config local + echo -e "auto lo\niface lo inet loopback" > ${IDIR_BASE_FILES}/etc/network/interfaces + + # network config eth0 + # configure nic with manual ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_NIC},y) + echo -e "\nauto eth0\niface eth0 inet dhcp" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure nic with dhcp +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_NIC_MANUAL},y) + echo -e "\nauto eth0\niface eth0 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH0_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH0_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH0_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " gateway ${SIMPLE_NETWORK_CONFIG_ETH0_GW}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure bridge +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_BRIDGE},y) + echo -e "\nauto br0\niface br0 inet manual" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH0_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + #configure bridge with ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_BRIDGE_IP},y) + echo -e "\nauto br0\niface br0 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH0_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH0_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH0_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH0_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + + # network config eth1 + # configure nic with manual ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_NIC},y) + echo -e "\nauto eth1\niface eth1 inet dhcp" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure nic with dhcp +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_NIC_MANUAL},y) + echo -e "\nauto eth1\niface eth1 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH1_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH1_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH1_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " gateway ${SIMPLE_NETWORK_CONFIG_ETH1_GW}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + # configure bridge +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_BRIDGE},y) + echo -e "\nauto br0\niface br1 inet manual" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH1_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + #configure bridge with ip +ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_BRIDGE_IP},y) + echo -e "\nauto br0\niface br1 inet static" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " address ${SIMPLE_NETWORK_CONFIG_ETH1_IP}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " netmask ${SIMPLE_NETWORK_CONFIG_ETH1_NM}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " broadcast ${SIMPLE_NETWORK_CONFIG_ETH1_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces + echo -e " bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH1_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif + + # newline at the end of interfaces file + echo -en "\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + + # resolver config + echo -e "nameserver ${SIMPLE_NETWORK_CONFIG_RESOLV}" > ${IDIR_BASE_FILES}/etc/resolv.conf +endif + + include ${TOPDIR}/mk/pkg-bottom.mk |