From 6c421cd0335f6e91517792f6a82510aa9756404c Mon Sep 17 00:00:00 2001 From: JuliusLongmind <5893405+JuliusLongmind@users.noreply.github.com> Date: Fri, 10 Jun 2022 22:33:21 +0200 Subject: [PATCH 1/3] Fixing mirrorlist, network interfaces before reboot --- arch-template.json | 2 +- scripts/install-base.sh | 2 +- wrapacker | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch-template.json b/arch-template.json index ff74f8b..dc32c40 100644 --- a/arch-template.json +++ b/arch-template.json @@ -83,7 +83,7 @@ "http_directory": "srv", "boot_wait": "5s", "boot_command": [ - "", + "", "/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/enable-ssh.sh", "/usr/bin/curl -O http://{{ .HTTPIP }}:{{ .HTTPPort }}/poweroff.timer", "/usr/bin/bash ./enable-ssh.sh" diff --git a/scripts/install-base.sh b/scripts/install-base.sh index 08dfc23..02ea14c 100644 --- a/scripts/install-base.sh +++ b/scripts/install-base.sh @@ -120,6 +120,6 @@ echo ">>>> install-base.sh: Completing installation.." # Turning network interfaces down to make sure SSH session was dropped on host. # More info at: https://www.packer.io/docs/provisioners/shell.html#handling-reboots echo '==> Turning down network interfaces and rebooting' -for i in $(/usr/bin/netstat -i | /usr/bin/tail +3 | /usr/bin/awk '{print $1}'); do /usr/bin/ip link set ${i} down; done +for i in $(/usr/bin/ip -o link show | /usr/bin/awk -F': ' '{print $2}'); do /usr/bin/ip link set ${i} down; done /usr/bin/systemctl reboot echo ">>>> install-base.sh: Installation complete!" diff --git a/wrapacker b/wrapacker index 6ae77a5..64aaefd 100755 --- a/wrapacker +++ b/wrapacker @@ -265,7 +265,7 @@ fi if [[ $country ]]; then if validate_country "$country"; then - MIRRORLIST="https://www.archlinux.org/mirrorlist/?country=${country}&protocol=http&protocol=https&ip_version=4&use_mirror_status=on" + MIRRORLIST="https://archlinux.org/mirrorlist/?country=${country}&protocol=http&protocol=https&ip_version=4&use_mirror_status=on" MIRROR=$(curl -s "$MIRRORLIST" | awk '/#Server/{ print $3; exit }' | sed 's|/$repo.*||') else warn 'INVALID COUNTRY SPECIFIED - %s' "$country" From 4dbd460443cc33ba66f6016ad36bf54ea5b8a196 Mon Sep 17 00:00:00 2001 From: JuliusLongmind <5893405+JuliusLongmind@users.noreply.github.com> Date: Thu, 15 Sep 2022 01:07:10 +0200 Subject: [PATCH 2/3] The wrapper and the template has been fixed --- arch-template.json | 4 ++-- wrapacker | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch-template.json b/arch-template.json index dc32c40..6019930 100644 --- a/arch-template.json +++ b/arch-template.json @@ -1,7 +1,7 @@ { "variables": { - "iso_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso", - "iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/sha1sums.txt", + "iso_url": "https://mirrors.kernel.org/archlinux/iso/latest/archlinux-x86_64.iso", + "iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/latest/sha1sums.txt", "ssh_timeout": "20m", "country": "US", "write_zeros": "true", diff --git a/wrapacker b/wrapacker index 64aaefd..024296d 100755 --- a/wrapacker +++ b/wrapacker @@ -279,7 +279,7 @@ else fi ISO_CHECKSUM_URL="${MIRROR}/iso/latest/sha1sums.txt" -ISO_NAME=$(curl -sL "$ISO_CHECKSUM_URL" | awk '/-x86_64.iso/{ print $2 }') +ISO_NAME=$(curl -sL "$ISO_CHECKSUM_URL" | awk '/-x86_64.iso/{ print $2 }' | tail -n 1) ISO_URL="${MIRROR}/iso/latest/${ISO_NAME}" if [[ $timeout ]]; then From b14e8362387775ab4e46ab0f3a65a8a638394171 Mon Sep 17 00:00:00 2001 From: JuliusLongmind <5893405+JuliusLongmind@users.noreply.github.com> Date: Mon, 3 Oct 2022 20:58:09 +0200 Subject: [PATCH 3/3] Checksum links has been fixed --- arch-template.json | 2 +- wrapacker | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch-template.json b/arch-template.json index 6019930..e36b8d6 100644 --- a/arch-template.json +++ b/arch-template.json @@ -1,7 +1,7 @@ { "variables": { "iso_url": "https://mirrors.kernel.org/archlinux/iso/latest/archlinux-x86_64.iso", - "iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/latest/sha1sums.txt", + "iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/latest/sha256sums.txt", "ssh_timeout": "20m", "country": "US", "write_zeros": "true", diff --git a/wrapacker b/wrapacker index 024296d..4595a62 100755 --- a/wrapacker +++ b/wrapacker @@ -278,7 +278,7 @@ else country='US' fi -ISO_CHECKSUM_URL="${MIRROR}/iso/latest/sha1sums.txt" +ISO_CHECKSUM_URL="${MIRROR}/iso/latest/sha256sums.txt" ISO_NAME=$(curl -sL "$ISO_CHECKSUM_URL" | awk '/-x86_64.iso/{ print $2 }' | tail -n 1) ISO_URL="${MIRROR}/iso/latest/${ISO_NAME}"