From 2a522c91c4b87cfb35f132a03d7c4afc2f3e0210 Mon Sep 17 00:00:00 2001 From: Mike Appleby Date: Tue, 30 Oct 2018 16:28:00 -0600 Subject: [PATCH 1/3] Don't call pacman-optimize in cleanup.sh The pacman-optimize script has been removed from pacman. https://git.archlinux.org/pacman.git/commit/?id=d590a45795b30a14cdb697754749c85907053570 This was causing the installer to complain "/usr/bin/pacman-optimize: No such file or directory". --- scripts/cleanup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index 0646e67..0ef52b1 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -2,7 +2,6 @@ # Clean the pacman cache. /usr/bin/yes | /usr/bin/pacman -Scc -/usr/bin/pacman-optimize # Write zeros to improve virtual disk compaction. zerofile=$(/usr/bin/mktemp /zerofile.XXXXX) From 1e25ccf7c6ab5c9e4dbfd3e35df1ea173194081f Mon Sep 17 00:00:00 2001 From: Mike Appleby Date: Tue, 30 Oct 2018 16:31:57 -0600 Subject: [PATCH 2/3] Tell curl to follow redirects when fetching ISO_CHECKSUM_URL mirrors.kernel.org is redirecting to mirrors.edge.kernel.org, causing ISO_NAME to be set to an empty string. This resulted in ISO_URL being set to the wrong value and packer failing to download the iso. --- wrapacker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrapacker b/wrapacker index 7329d88..e0a10c5 100755 --- a/wrapacker +++ b/wrapacker @@ -244,7 +244,7 @@ else fi ISO_CHECKSUM_URL="${MIRROR}/iso/latest/sha1sums.txt" -ISO_NAME=$(curl -s "$ISO_CHECKSUM_URL" | awk '/-x86_64.iso/{ print $2 }') +ISO_NAME=$(curl -sL "$ISO_CHECKSUM_URL" | awk '/-x86_64.iso/{ print $2 }') ISO_URL="${MIRROR}/iso/latest/${ISO_NAME}" if [[ $timeout ]]; then From e54e34cda1b6cf05121a707f025052ccb0026ad0 Mon Sep 17 00:00:00 2001 From: Mike Appleby Date: Tue, 30 Oct 2018 16:43:35 -0600 Subject: [PATCH 3/3] Check for existence of packer-io command before setting PACKER_BIN In older versions of arch linux, the hashicorp packer package (and binary) was named packer-io to avoid clashing with a pre-existing AUR helper called packer. Recently, the AUR helper package was renamed to packer-aur and the old packer-io (and corresponding binary) was renamed to packer. https://www.archlinux.org/packages/community/x86_64/packer/ Previously, the wrapacker script would unconditionally set PACKER_BIN to "packer-io" if the file /etc/arch-release existed. We now instead the check for the existence of a packer-io command, and fall back to the default "packer" in case that doesn't exist. --- wrapacker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrapacker b/wrapacker index e0a10c5..d4eb302 100755 --- a/wrapacker +++ b/wrapacker @@ -17,8 +17,8 @@ # country codes supported by https://www.archlinux.org/mirrorlist/ readonly VALID_COUNTRIES=(AT AU BD BE BG BR BY CA CH CL CN CO CZ DE DK EC ES FR GB GR HR HU ID IE IL IN IR IS IT JP KR KZ LT LU LV MK NC NL NO NZ PH PL PT RO RS RU SE SG SK TR TW UA US VN ZA) -# use the correct binary if running from arch linux -if [[ -f /etc/arch-release ]]; then +if command -v packer-io > /dev/null 2>&1; then + # Older arch linux versions called the packer binary packer-io. readonly PACKER_BIN='packer-io' else readonly PACKER_BIN='packer'