--- trunk/installer/include/prepare_networking.sh 2011/08/03 13:39:14 1476 +++ trunk/installer/include/prepare_networking.sh 2011/08/03 14:07:36 1477 @@ -27,9 +27,13 @@ dhcp) add_network_config ${NETWORK_NIC} 'ONBOOT="yes"' add_network_config ${NETWORK_NIC} 'NETWORKING="dhcp"' - add_network_config ${NETWORK_NIC} 'DHCP_PROG="/sbin/dhcpcd"' - add_network_config ${NETWORK_NIC} 'DHCP_START="-t 10"' - add_network_config ${NETWORK_NIC} 'DHCP_STOP="-k"' + # add this only if no default networking was found which is provided by newer initscripts + if [[ ! -f ${INSTALL_ROOT}/conf.d/network ]] + then + add_network_config ${NETWORK_NIC} 'DHCP_PROG="/sbin/dhcpcd"' + add_network_config ${NETWORK_NIC} 'DHCP_START="-t 10"' + add_network_config ${NETWORK_NIC} 'DHCP_STOP="-k"' + fi ;; none) add_network_config ${NETWORK_NIC} 'ONBOOT="no"' @@ -37,11 +41,14 @@ esac echo "${NETWORK_HOSTNAME}" > ${INSTALL_ROOT}/etc/hostname +# setup head file with the right domainname for resolv.conf +echo "domain ${NETWORK_DOMAIN}" > ${INSTALL_ROOT}/etc/resolv.conf.head if [[ ${NETWORK_METHOD} = static ]] then - # the 'a' in the sed line appends a line after the regex (127.0.0.1.*localhost) + # the 'a' in the sed line appends a line after the regex (127.0.0.1.*localhost) (really needed?) sed -i "/127.0.0.1.*localhost/ a \${NETWORK_IP}\t${NETWORK_HOSTNAME}.${NETWORK_DOMAIN}\t${NETWORK_HOSTNAME}" ${INSTALL_ROOT}/etc/hosts else - sed -i "s:^\(127.0.0.1.*localhost\):\1\t${NETWORK_HOSTNAME}.${NETWORK_DOMAIN}\t${NETWORK_HOSTNAME}:" ${INSTALL_ROOT}/etc/hosts + # the 'a' in the sed line appends a line after the regex (127.0.0.1.*localhost) (really needed?) + sed -i "/127.0.0.1.*localhost/ a \127.0.0.1\t${NETWORK_HOSTNAME}.${NETWORK_DOMAIN}\t${NETWORK_HOSTNAME}" ${INSTALL_ROOT}/etc/hosts fi