From feabdd195c3b7e5efb62e4c71ec996cd6aceeccd Mon Sep 17 00:00:00 2001 From: Ladar Levison Date: Thu, 21 Sep 2023 05:30:16 -0500 Subject: [PATCH] Updated the Alpine install ISOs. --- generic-hyperv.json | 12 +++++----- generic-libvirt.json | 12 +++++----- generic-parallels.json | 12 +++++----- generic-virtualbox.json | 12 +++++----- generic-vmware.json | 12 +++++----- packer-cache.json | 12 +++++----- res/providers/providers-v7.sh | 3 +++ res/providers/providers-v8.sh | 3 +++ res/providers/providers-v9.sh | 3 +++ robox.sh | 41 +++++++++++++++++++++++++++++++---- 10 files changed, 82 insertions(+), 40 deletions(-) diff --git a/generic-hyperv.json b/generic-hyperv.json index 4d820f076..6c34d84b6 100644 --- a/generic-hyperv.json +++ b/generic-hyperv.json @@ -6178,8 +6178,8 @@ "memory": 2048, "cpus": 2, "http_directory": "http", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.8-x86_64.iso", - "iso_checksum": "sha256:5d14f2cb237d213c5055d9df5655f475ec7a5077252994693192154b9217b346", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.10-x86_64.iso", + "iso_checksum": "sha256:e76a44fed0f0e3f4ff909e20706ae226411fbd00810e7fadcee52f3edab1b1f2", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, @@ -6489,8 +6489,8 @@ "memory": 2048, "cpus": 2, "http_directory": "http", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.5-x86_64.iso", - "iso_checksum": "sha256:bf98c7a0fe722a8419222e5ac4e933768cf50e053af8bc53bfd748c99c7d952f", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.7-x86_64.iso", + "iso_checksum": "sha256:6b447e9b2e2ca561c01b03a7b21b6839c718ed85323d2d100ff2e10ea5191470", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, @@ -6816,8 +6816,8 @@ "memory": 2048, "cpus": 2, "http_directory": "http", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso", - "iso_checksum": "sha256:3ae1f6304346ce99e5eafddf0132c86c0fc7136ffad767a2c725501d8a9d5c04", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso", + "iso_checksum": "sha256:d3aec585da8327095edb37b4b7b5eed4623a993196edf12e74641ee5f16291f6", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, diff --git a/generic-libvirt.json b/generic-libvirt.json index 435edcc2d..5abde9f18 100644 --- a/generic-libvirt.json +++ b/generic-libvirt.json @@ -6153,8 +6153,8 @@ "memory": 2048, "http_directory": "http", "headless": true, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.8-x86_64.iso", - "iso_checksum": "sha256:5d14f2cb237d213c5055d9df5655f475ec7a5077252994693192154b9217b346", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.10-x86_64.iso", + "iso_checksum": "sha256:e76a44fed0f0e3f4ff909e20706ae226411fbd00810e7fadcee52f3edab1b1f2", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, @@ -6474,8 +6474,8 @@ "memory": 2048, "http_directory": "http", "headless": true, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.5-x86_64.iso", - "iso_checksum": "sha256:bf98c7a0fe722a8419222e5ac4e933768cf50e053af8bc53bfd748c99c7d952f", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.7-x86_64.iso", + "iso_checksum": "sha256:6b447e9b2e2ca561c01b03a7b21b6839c718ed85323d2d100ff2e10ea5191470", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, @@ -6816,8 +6816,8 @@ "memory": 2048, "http_directory": "http", "headless": true, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso", - "iso_checksum": "sha256:3ae1f6304346ce99e5eafddf0132c86c0fc7136ffad767a2c725501d8a9d5c04", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso", + "iso_checksum": "sha256:d3aec585da8327095edb37b4b7b5eed4623a993196edf12e74641ee5f16291f6", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, diff --git a/generic-parallels.json b/generic-parallels.json index b571739b8..56a70d972 100644 --- a/generic-parallels.json +++ b/generic-parallels.json @@ -8055,8 +8055,8 @@ "hard_drive_interface": "ide", "guest_os_type": "linux", "http_directory": "http", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.8-x86_64.iso", - "iso_checksum": "sha256:5d14f2cb237d213c5055d9df5655f475ec7a5077252994693192154b9217b346", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.10-x86_64.iso", + "iso_checksum": "sha256:e76a44fed0f0e3f4ff909e20706ae226411fbd00810e7fadcee52f3edab1b1f2", "skip_compaction": false, "ssh_username": "root", "ssh_password": "vagrant", @@ -8602,8 +8602,8 @@ "hard_drive_interface": "ide", "guest_os_type": "linux", "http_directory": "http", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.5-x86_64.iso", - "iso_checksum": "sha256:bf98c7a0fe722a8419222e5ac4e933768cf50e053af8bc53bfd748c99c7d952f", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.7-x86_64.iso", + "iso_checksum": "sha256:6b447e9b2e2ca561c01b03a7b21b6839c718ed85323d2d100ff2e10ea5191470", "skip_compaction": false, "ssh_username": "root", "ssh_password": "vagrant", @@ -9159,8 +9159,8 @@ "hard_drive_interface": "ide", "guest_os_type": "linux", "http_directory": "http", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso", - "iso_checksum": "sha256:3ae1f6304346ce99e5eafddf0132c86c0fc7136ffad767a2c725501d8a9d5c04", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso", + "iso_checksum": "sha256:d3aec585da8327095edb37b4b7b5eed4623a993196edf12e74641ee5f16291f6", "skip_compaction": false, "ssh_username": "root", "ssh_password": "vagrant", diff --git a/generic-virtualbox.json b/generic-virtualbox.json index fe9adcc53..e1321b3b5 100644 --- a/generic-virtualbox.json +++ b/generic-virtualbox.json @@ -6660,8 +6660,8 @@ "vrdp_bind_address": "127.0.0.1", "vrdp_port_min": 11000, "vrdp_port_max": 12000, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.8-x86_64.iso", - "iso_checksum": "sha256:5d14f2cb237d213c5055d9df5655f475ec7a5077252994693192154b9217b346", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.10-x86_64.iso", + "iso_checksum": "sha256:e76a44fed0f0e3f4ff909e20706ae226411fbd00810e7fadcee52f3edab1b1f2", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, @@ -7089,8 +7089,8 @@ "vrdp_bind_address": "127.0.0.1", "vrdp_port_min": 11000, "vrdp_port_max": 12000, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.5-x86_64.iso", - "iso_checksum": "sha256:bf98c7a0fe722a8419222e5ac4e933768cf50e053af8bc53bfd748c99c7d952f", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.7-x86_64.iso", + "iso_checksum": "sha256:6b447e9b2e2ca561c01b03a7b21b6839c718ed85323d2d100ff2e10ea5191470", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, @@ -7558,8 +7558,8 @@ "vrdp_bind_address": "127.0.0.1", "vrdp_port_min": 11000, "vrdp_port_max": 12000, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso", - "iso_checksum": "sha256:3ae1f6304346ce99e5eafddf0132c86c0fc7136ffad767a2c725501d8a9d5c04", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso", + "iso_checksum": "sha256:d3aec585da8327095edb37b4b7b5eed4623a993196edf12e74641ee5f16291f6", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, diff --git a/generic-vmware.json b/generic-vmware.json index b6f08906b..9f7980442 100644 --- a/generic-vmware.json +++ b/generic-vmware.json @@ -6701,8 +6701,8 @@ "vnc_disable_password": true, "vnc_bind_address": "127.0.0.1", "vmx_remove_ethernet_interfaces": true, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.8-x86_64.iso", - "iso_checksum": "sha256:5d14f2cb237d213c5055d9df5655f475ec7a5077252994693192154b9217b346", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.10-x86_64.iso", + "iso_checksum": "sha256:e76a44fed0f0e3f4ff909e20706ae226411fbd00810e7fadcee52f3edab1b1f2", "skip_compaction": false, "ssh_username": "root", "ssh_password": "vagrant", @@ -7082,8 +7082,8 @@ "vnc_disable_password": true, "vnc_bind_address": "127.0.0.1", "vmx_remove_ethernet_interfaces": true, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.5-x86_64.iso", - "iso_checksum": "sha256:bf98c7a0fe722a8419222e5ac4e933768cf50e053af8bc53bfd748c99c7d952f", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.7-x86_64.iso", + "iso_checksum": "sha256:6b447e9b2e2ca561c01b03a7b21b6839c718ed85323d2d100ff2e10ea5191470", "skip_compaction": false, "ssh_username": "root", "ssh_password": "vagrant", @@ -7479,8 +7479,8 @@ "vnc_disable_password": true, "vnc_bind_address": "127.0.0.1", "vmx_remove_ethernet_interfaces": true, - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso", - "iso_checksum": "sha256:3ae1f6304346ce99e5eafddf0132c86c0fc7136ffad767a2c725501d8a9d5c04", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso", + "iso_checksum": "sha256:d3aec585da8327095edb37b4b7b5eed4623a993196edf12e74641ee5f16291f6", "skip_compaction": false, "ssh_username": "root", "ssh_password": "vagrant", diff --git a/packer-cache.json b/packer-cache.json index 480aaa335..5d130cb96 100644 --- a/packer-cache.json +++ b/packer-cache.json @@ -1203,8 +1203,8 @@ { "name": "alpine315", "output_directory": "output/alpine315", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.8-x86_64.iso", - "iso_checksum": "sha256:5d14f2cb237d213c5055d9df5655f475ec7a5077252994693192154b9217b346", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.15/releases/x86_64/alpine-virt-3.15.10-x86_64.iso", + "iso_checksum": "sha256:e76a44fed0f0e3f4ff909e20706ae226411fbd00810e7fadcee52f3edab1b1f2", "boot_wait": "5s", "disk_size": 1, "headless": true, @@ -1323,8 +1323,8 @@ { "name": "alpine316", "output_directory": "output/alpine316", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.5-x86_64.iso", - "iso_checksum": "sha256:bf98c7a0fe722a8419222e5ac4e933768cf50e053af8bc53bfd748c99c7d952f", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.7-x86_64.iso", + "iso_checksum": "sha256:6b447e9b2e2ca561c01b03a7b21b6839c718ed85323d2d100ff2e10ea5191470", "boot_wait": "5s", "disk_size": 1, "headless": true, @@ -1458,8 +1458,8 @@ { "name": "alpine317", "output_directory": "output/alpine317", - "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.3-x86_64.iso", - "iso_checksum": "sha256:3ae1f6304346ce99e5eafddf0132c86c0fc7136ffad767a2c725501d8a9d5c04", + "iso_url": "https://mirrors.edge.kernel.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.5-x86_64.iso", + "iso_checksum": "sha256:d3aec585da8327095edb37b4b7b5eed4623a993196edf12e74641ee5f16291f6", "boot_wait": "5s", "disk_size": 1, "headless": true, diff --git a/res/providers/providers-v7.sh b/res/providers/providers-v7.sh index 8093daff7..bb5f983b8 100755 --- a/res/providers/providers-v7.sh +++ b/res/providers/providers-v7.sh @@ -355,6 +355,9 @@ function provide-packer() { PACKER_PLUGIN_PATH=/usr/local/bin/ /usr/local/bin/packer plugins install github.com/hashicorp/parallels PACKER_PLUGIN_PATH=/usr/local/bin/ /usr/local/bin/packer plugins install github.com/hashicorp/virtualbox + mv `find /usr/local/bin/github.com/ -type f` /usr/local/bin/ + rm -rf /usr/local/bin/github.com/ + } function provide-setup() { diff --git a/res/providers/providers-v8.sh b/res/providers/providers-v8.sh index 32517c797..f9fd52d32 100755 --- a/res/providers/providers-v8.sh +++ b/res/providers/providers-v8.sh @@ -387,6 +387,9 @@ function provide-packer() { PACKER_PLUGIN_PATH=/usr/local/bin/ /usr/local/bin/packer plugins install github.com/hashicorp/parallels PACKER_PLUGIN_PATH=/usr/local/bin/ /usr/local/bin/packer plugins install github.com/hashicorp/virtualbox + mv `find /usr/local/bin/github.com/ -type f` /usr/local/bin/ + rm -rf /usr/local/bin/github.com/ + } function provide-setup() { diff --git a/res/providers/providers-v9.sh b/res/providers/providers-v9.sh index fc3327c25..949229b07 100755 --- a/res/providers/providers-v9.sh +++ b/res/providers/providers-v9.sh @@ -390,6 +390,9 @@ function provide-packer() { PACKER_PLUGIN_PATH=/usr/local/bin/ /usr/local/bin/packer plugins install github.com/hashicorp/parallels PACKER_PLUGIN_PATH=/usr/local/bin/ /usr/local/bin/packer plugins install github.com/hashicorp/virtualbox + mv `find /usr/local/bin/github.com/ -type f` /usr/local/bin/ + rm -rf /usr/local/bin/github.com/ + } function provide-setup() { diff --git a/robox.sh b/robox.sh index 9cd907b21..ef144f591 100755 --- a/robox.sh +++ b/robox.sh @@ -922,19 +922,52 @@ function iso() { # Replace the existing ISO and hash values with the update values. sed --in-place "s/$ISO_URL/$URL/g" $ROBOX_FILES - sed --in-place "s/$ISO_CHECKSUM/sha256:$SHA/g" $ROBOX_FILES + sed --in-place "s/$ISO_CHECKSUM/sha256:$SHA/g" $ROBOX_FILES + + elif [ "$1" == "alpine" ]; then + + # Build a loop with all of the Alpine ISO names. + cat "$BASE/packer-cache.json" | jq -r -c ".builders[] | select( .name | contains(\"alpine\")) | .name" | grep -v alpine35-hyperv | while read NAME; do + + ISO_URL=`cat "$BASE/packer-cache.json" | jq -r -c ".builders[] | select( .name == \"$NAME\") | .iso_url" 2>/dev/null` + ISO_CHECKSUM=`cat "$BASE/packer-cache.json" | jq -r -c ".builders[] | select( .name == \"$NAME\") | .iso_checksum" 2>/dev/null` + + # Find the new Alpine ISO URL and check whether the URL is valid. + URL="$(echo $ISO_URL | perl -pe 's/^((.*\d+\.)*)(\d+)(.*)$/$1.($3+1).$4/e')" + ISO=`${CURL} --fail --head --silent --location --output /dev/null --write-out "%{exitcode}" "${URL}"` + if [ "$ISO" == "0" ]; then + + # Download the ISO file and calculate the new hash value. + set -o pipefail + SHA=`${CURL} --fail --speed-time 60 --speed-limit 1024 --silent --location "${URL}" | sha256sum | awk -F' ' '{print $1}'` + if [ $? != 0 ] || [ "$SHA" == "" ]; then + tput setaf 1; printf "\nThe Alpine ISO update failed.\n\n"; tput sgr0 + return 1 + fi + set +o pipefail + + # Escape the URL strings. + URL=`echo $URL | sed "s/\//\\\\\\\\\//g"` + ISO_URL=`echo $ISO_URL | sed "s/\//\\\\\\\\\//g"` + + # Replace the existing ISO and hash values with the update values. + sed --in-place "s/$ISO_URL/$URL/g" $ROBOX_FILES + sed --in-place "s/$ISO_CHECKSUM/sha256:$SHA/g" $ROBOX_FILES + fi + + done elif [ "$1" == "hardened" ] || [ "$1" == "hardenedbsd" ]; then iso hardenedbsd13 iso hardenedbsd14 - elif [ "$1" == "stream" ] || [ "$1" == "streams" ]; then + elif [ "$1" == "stream" ] || [ "$1" == "streams" ]; then iso centos8s iso centos9s elif [ "$1" == "all" ]; then iso arch - iso centos8s - iso centos9s iso gentoo + iso alpine + iso streams iso hardenedbsd fi