diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-04 18:06:16 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-04 18:06:49 +0200 |
commit | 97886e9ba7ad1f967ba9790a18d2e05fd80915e7 (patch) | |
tree | a24a1bd4fd20f83037aff23c5028b0384d1d77de /package/base-files/Makefile | |
parent | 964ea295ab3bf6f64e8eb8b75fe119a115550f06 (diff) |
rework simple network config, allow to configure one gateway
Diffstat (limited to 'package/base-files/Makefile')
-rw-r--r-- | package/base-files/Makefile | 107 |
1 files changed, 44 insertions, 63 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 6dea5f4dc..ef9bdafd4 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk PKG_NAME:= base-files PKG_VERSION:= 1.0 -PKG_RELEASE:= 97 +PKG_RELEASE:= 98 PKG_SECTION:= base/apps PKG_DESCR:= basic files and scripts @@ -90,69 +90,50 @@ 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 dhcp -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 manual ip -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 wlan0 -ifeq (${SIMPLE_NETWORK_CONFIG_WLAN0_TYPE_NIC},y) - echo -e "\nauto wlan0\niface wlan0 inet dhcp" >> ${IDIR_BASE_FILES}/etc/network/interfaces -endif - # network config eth1 - # configure nic with dhcp -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 manual ip -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 - printf "\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces - # resolver config + printf "auto lo\niface lo inet loopback\n" > ${IDIR_BASE_FILES}/etc/network/interfaces + +ifeq (${ADK_SIMPLE_NETWORK_CONFIG_ETH0_DHCP},y) + printf "\nauto eth0\niface eth0 inet dhcp\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif +ifeq (${ADK_SIMPLE_NETWORK_CONFIG_ETH0_STATIC},y) + printf "\nauto eth0\niface eth0 inet static\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " address ${ADK_SIMPLE_NETWORK_CONFIG_ETH0_IP}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " netmask ${ADK_SIMPLE_NETWORK_CONFIG_ETH0_NM}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " broadcast +\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +ifneq (${ADK_SIMPLE_NETWORK_CONFIG_ETH0_GW},) + printf " gateway ${ADK_SIMPLE_NETWORK_CONFIG_ETH0_GW}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif +endif + +ifeq (${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_DHCP},y) + printf "\nauto wlan0\niface wlan0 inet dhcp\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif +ifeq (${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_STATIC},y) + printf "\nauto wlan0\niface wlan0 inet static\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " address ${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_IP}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " netmask ${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_NM}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " broadcast +\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +ifneq (${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_GW},) + printf " gateway ${ADK_SIMPLE_NETWORK_CONFIG_WLAN0_GW}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif +endif + +ifeq (${ADK_SIMPLE_NETWORK_CONFIG_ETH1_DHCP},y) + printf "\nauto eth1\niface eth1 inet dhcp\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif +ifeq (${ADK_SIMPLE_NETWORK_CONFIG_ETH1_STATIC},y) + printf "\nauto eth1\niface eth1 inet static\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " address ${ADK_SIMPLE_NETWORK_CONFIG_ETH1_IP}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " netmask ${ADK_SIMPLE_NETWORK_CONFIG_ETH1_NM}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + printf " broadcast +\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +ifneq (${ADK_SIMPLE_NETWORK_CONFIG_ETH1_GW},) + printf " gateway ${ADK_SIMPLE_NETWORK_CONFIG_ETH1_GW}\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces +endif +endif + printf "\n" >> ${IDIR_BASE_FILES}/etc/network/interfaces + rm ${IDIR_BASE_FILES}/etc/resolv.conf - echo -e "nameserver ${SIMPLE_NETWORK_CONFIG_RESOLV}" > ${IDIR_BASE_FILES}/etc/resolv.conf + printf "nameserver ${ADK_SIMPLE_NETWORK_CONFIG_NS}\n" > ${IDIR_BASE_FILES}/etc/resolv.conf endif include ${TOPDIR}/mk/pkg-bottom.mk |