From c9a647f0dce2aa36489a02f7ac5f3cc7ebb9abcc Mon Sep 17 00:00:00 2001 From: jalr Date: Sat, 19 May 2018 20:03:18 +0200 Subject: [PATCH] Fix /etc/hosts --- packer/debian-stretch.json | 2 +- packer/initramfs/labsync | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packer/debian-stretch.json b/packer/debian-stretch.json index 2587fa6..b5ff69b 100644 --- a/packer/debian-stretch.json +++ b/packer/debian-stretch.json @@ -105,7 +105,7 @@ { "type": "file", "source": "hosts", - "destination": "/tmp/extra/etc/hosts" + "destination": "/etc/hosts.template" }, { "type": "shell", diff --git a/packer/initramfs/labsync b/packer/initramfs/labsync index 8d2ee35..565aa50 100755 --- a/packer/initramfs/labsync +++ b/packer/initramfs/labsync @@ -199,7 +199,7 @@ PARTTABLE hostname=$(ip -o link show | sed -ne 's#^.*link/ether \([0-9a-f:]*\).*$#\1#p' | sed -ne '1{s/://g;p}') echo $hostname > ${rootmnt}/etc/hostname - sed -i "s/@@HOSTNAME@@/$hostname/" ${rootmnt}/etc/hosts + sed "s/@@HOSTNAME@@/$hostname/" ${rootmnt}/etc/hosts.template > ${rootmnt}/etc/hosts if [ -z "$labsync_localboot" ]; then labsync_set_environment LABSYNC "$torrent_name"