From d0f91512d9ca6d361d8a4a387094c48aab00e111 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 19 Apr 2016 15:10:50 +0200 Subject: fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup --- bootstrap.d/20-networking.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'bootstrap.d/20-networking.sh') diff --git a/bootstrap.d/20-networking.sh b/bootstrap.d/20-networking.sh index bd6e8db..16e06f2 100644 --- a/bootstrap.d/20-networking.sh +++ b/bootstrap.d/20-networking.sh @@ -6,37 +6,37 @@ . ./functions.sh # Install and setup hostname -install_readonly files/network/hostname "$R/etc/hostname" -sed -i "s/^rpi2-jessie/${HOSTNAME}/" "$R/etc/hostname" +install_readonly files/network/hostname "${ETCDIR}/hostname" +sed -i "s/^rpi2-jessie/${HOSTNAME}/" "${ETCDIR}/hostname" # Install and setup hosts -install_readonly files/network/hosts "$R/etc/hosts" -sed -i "s/rpi2-jessie/${HOSTNAME}/" "$R/etc/hosts" +install_readonly files/network/hosts "${ETCDIR}/hosts" +sed -i "s/rpi2-jessie/${HOSTNAME}/" "${ETCDIR}/hosts" # Setup hostname entry with static IP if [ "$NET_ADDRESS" != "" ] ; then NET_IP=$(echo "${NET_ADDRESS}" | cut -f 1 -d'/') - sed -i "s/^127.0.1.1/${NET_IP}/" "$R/etc/hosts" + sed -i "s/^127.0.1.1/${NET_IP}/" "${ETCDIR}/hosts" fi # Remove IPv6 hosts if [ "$ENABLE_IPV6" = false ] ; then - sed -i -e "/::[1-9]/d" -e "/^$/d" "$R/etc/hosts" + sed -i -e "/::[1-9]/d" -e "/^$/d" "${ETCDIR}/hosts" fi # Install hint about network configuration -install_readonly files/network/interfaces "$R/etc/network/interfaces" +install_readonly files/network/interfaces "${ETCDIR}/network/interfaces" # Install configuration for interface eth0 -install_readonly files/network/eth.network "$R/etc/systemd/network/eth.network" +install_readonly files/network/eth.network "${ETCDIR}/systemd/network/eth.network" if [ "$ENABLE_DHCP" = true ] ; then # Enable DHCP configuration for interface eth0 - sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "$R/etc/systemd/network/eth.network" + sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETCDIR}/systemd/network/eth.network" # Set DHCP configuration to IPv4 only if [ "$ENABLE_IPV6" = false ] ; then - sed -i "s/DHCP=.*/DHCP=v4/" "$R/etc/systemd/network/eth.network" + sed -i "s/DHCP=.*/DHCP=v4/" "${ETCDIR}/systemd/network/eth.network" fi else # ENABLE_DHCP=false @@ -50,23 +50,23 @@ else # ENABLE_DHCP=false -e "s|Domains=\$|Domains=${NET_DNS_DOMAINS}|"\ -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_NTP_1}|"\ -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_NTP_2}|"\ - "$R/etc/systemd/network/eth.network" + "${ETCDIR}/systemd/network/eth.network" fi # Remove empty settings from network configuration -sed -i "/.*=\$/d" "$R/etc/systemd/network/eth.network" +sed -i "/.*=\$/d" "${ETCDIR}/systemd/network/eth.network" # Enable systemd-networkd service chroot_exec systemctl enable systemd-networkd # Install host.conf resolver configuration -install_readonly files/network/host.conf "$R/etc/host.conf" +install_readonly files/network/host.conf "${ETCDIR}/host.conf" # Enable network stack hardening if [ "$ENABLE_HARDNET" = true ] ; then # Install sysctl.d configuration files - install_readonly files/sysctl.d/82-rpi-net-hardening.conf "$R/etc/sysctl.d/82-rpi-net-hardening.conf" + install_readonly files/sysctl.d/82-rpi-net-hardening.conf "${ETCDIR}/sysctl.d/82-rpi-net-hardening.conf" # Setup resolver warnings about spoofed addresses - sed -i "s/^# spoof warn/spoof warn/" "$R/etc/host.conf" + sed -i "s/^# spoof warn/spoof warn/" "${ETCDIR}/host.conf" fi -- cgit v1.2.3