diff --git a/packer/debian-stretch.json b/packer/debian-stretch.json index 2587fa6..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", @@ -105,7 +107,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"