From 9db26f5ccab37fb7dd61566368b3a3135fdd74d5 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 06 Mar 2016 14:57:03 -0500 Subject: Networking --- (limited to 'inst') diff --git a/inst b/inst index a9e0f3f..10eb4fc 100755 --- a/inst +++ b/inst @@ -181,8 +181,30 @@ do_chroot_setup() EOF chmod a+rx "${target}/sbin/start-stop-daemon" || return 1 - for file in /etc/network/interfaces /etc/networks /etc/hostname \ - /etc/resolv.conf /etc/hosts; do + printf '%s\n' "${hostname}" >"${target}/etc/hostname" + + cat >"${target}/etc/hosts" <<-EOF + 127.0.0.1 localhost + + # The following lines are desirable for IPv6 capable hosts + ::1 ip6-localhost ip6-loopback + fe00::0 ip6-localnet + ff00::0 ip6-mcastprefix + ff02::1 ip6-allnodes + ff02::2 ip6-allrouters + EOF + + mkdir -p "${target}/etc/network" || return 1 + cat >"${target}/etc/network/interfaces" <<-EOF + # This file describes the network interfaces available on your system + # and how to activate them. For more information, see interfaces(5). + + # The loopback network interface + auto lo + iface lo inet loopback + EOF + + for file in /etc/networks /etc/resolv.conf; do if ! [ -f "${file}" ]; then continue fi @@ -375,8 +397,7 @@ do_chroot_cleanup() info 'Cleaning up system' - for file in /etc/network/interfaces /etc/networks /etc/hostname \ - /etc/resolv.conf /etc/hosts; do + for file in /etc/networks /etc/resolv.conf; do if [ -f "${target}${file}.REAL" ]; then mv "${target}${file}.REAL" "${target}${file}" fi -- cgit v0.9.1