diff options
author | P. J. McDermott <pj@pehjota.net> | 2016-03-06 14:57:03 (EST) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2016-03-06 14:57:03 (EST) |
commit | 9db26f5ccab37fb7dd61566368b3a3135fdd74d5 (patch) | |
tree | 93d90b61ea5328d4fe611b8aaf438b7854e6c6a8 /inst | |
parent | dfb8e89a1409e2e165e1acd7ec53b27c19d47b50 (diff) | |
download | pc-inst-9db26f5ccab37fb7dd61566368b3a3135fdd74d5.zip pc-inst-9db26f5ccab37fb7dd61566368b3a3135fdd74d5.tar.gz pc-inst-9db26f5ccab37fb7dd61566368b3a3135fdd74d5.tar.bz2 |
Networking
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 |