Merge branch 'fix-hosts-file' into 'master'

Fix hosts file; Debian packages artifact

See merge request fablab/labsync!26
This commit is contained in:
jalr 2018-06-06 18:41:47 +00:00
commit b370d72cab
2 changed files with 4 additions and 2 deletions

View file

@ -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",

View file

@ -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"