diff options
Diffstat (limited to 'inst')
-rwxr-xr-x | inst | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -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 |