From c9a647f0dce2aa36489a02f7ac5f3cc7ebb9abcc Mon Sep 17 00:00:00 2001 From: jalr Date: Sat, 19 May 2018 20:03:18 +0200 Subject: [PATCH 1/2] 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" From 55bb5cdc7df7d0310185568a24a7aef7cc27fb49 Mon Sep 17 00:00:00 2001 From: jalr Date: Sat, 19 May 2018 21:02:41 +0200 Subject: [PATCH 2/2] Add artifact containing a list of debian packages --- packer/debian-stretch.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packer/debian-stretch.json b/packer/debian-stretch.json index b5ff69b..3541681 100644 --- a/packer/debian-stretch.json +++ b/packer/debian-stretch.json @@ -4,6 +4,7 @@ "squashfs_file": "{{env `NAME`}}.squashfs", "initramfs_file": "{{env `NAME`}}.initramfs", "linux_file": "{{env `NAME`}}.linux", + "dpkg_list_file": "{{env `NAME`}}.dpkg-list", "compression_level": "{{env `COMPRESSION_LEVEL`}}", "images": "{{env `IMAGES`}}", "ci_job_id": "{{env `CI_JOB_ID`}}", @@ -96,6 +97,7 @@ "set -x", "apt-get -y install squashfs-tools", "dpkg -L squashfs-tools liblzo2-2 | while read f; do [ -f \"$f\" ] && echo \"$f\"; done > /tmp/ignore_files", + "dpkg -l > /tmp/images/{{ user `dpkg_list_file` }}", "echo '/etc/resolv.conf' >> /tmp/ignore_files", "echo '/etc/hostname' >> /tmp/ignore_files", "echo '/etc/hosts' >> /tmp/ignore_files",