diff --git a/Makefile b/Makefile index 9fdab82..4eacf50 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,7 @@ images/debian-stretch.squashfs: images --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "${PWD}/packer:/workdir" \ + -v "${PWD}/aria2c:/workdir/aria2c" \ -v "${PWD}/images:/images" \ -e "user=`id -u`" \ -e "group=`id -g`" \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 9f3a1c3..4d44b05 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -37,8 +37,6 @@ make_torrent() { } run_packer() { - touch /aria2c - packer build "$NAME.json" if [ "$user" != "" ] && [ "$group" != "" ]; then diff --git a/packer/debian-stretch.json b/packer/debian-stretch.json index 8402847..90d6df7 100644 --- a/packer/debian-stretch.json +++ b/packer/debian-stretch.json @@ -36,7 +36,7 @@ "provisioners": [ { "type": "file", - "source": "/aria2c", + "source": "aria2c", "destination": "/usr/local/bin/aria2c" }, { @@ -64,7 +64,7 @@ "echo \"LABSYNC_PROJECT_URL='{{user `ci_project_url`}}'\" >> /etc/environment", "set -x", "sed -i 's#@@PROJECT_URL@@#{{user `ci_project_url`}}#' /etc/initramfs-tools/scripts/labsync", - "if [ -s /usr/local/bin/aria2c ]; then aria2c=/usr/local/bin/aria2c; else aria2c=/usr/bin/aria2c; fi", + "if ! [ -d /usr/local/bin/aria2c ]; then aria2c=/usr/local/bin/aria2c; else aria2c=/usr/bin/aria2c; fi", "sed -i \"s#@@ARIA2C@@#$aria2c#\" /etc/initramfs-tools/scripts/local-premount/labsync-prereqs", "apt-get update", "apt-get -y dist-upgrade", diff --git a/packer/initramfs/labsync b/packer/initramfs/labsync index d603a9d..09c4596 100755 --- a/packer/initramfs/labsync +++ b/packer/initramfs/labsync @@ -80,6 +80,7 @@ labsync_premount() { labsync_mount_root() { + export PATH="/usr/local/bin:$PATH" set -x sed -i 's/use_lvmetad = 1/use_lvmetad = 0/' /etc/lvm/lvm.conf vg_name="vglab"