From f15b7d89c7ecb86c43190587272c5c490617d56e Mon Sep 17 00:00:00 2001 From: jalr Date: Mon, 2 Apr 2018 04:26:52 +0200 Subject: [PATCH 1/2] Fix aria2c path --- Makefile | 1 + docker/entrypoint.sh | 2 -- packer/debian-stretch.json | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) 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", From ce82a62daefc559baa455d93ade7134c8dee0fda Mon Sep 17 00:00:00 2001 From: jalr Date: Thu, 5 Apr 2018 17:51:39 +0200 Subject: [PATCH 2/2] Add /usr/local/bin to PATH --- packer/initramfs/labsync | 1 + 1 file changed, 1 insertion(+) 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"