Compare commits

...

2 Commits

Author SHA1 Message Date
rootzoll
3ac7c70486 use qemu 2024-08-19 21:48:13 +02:00
rootzoll
79fce786c6 deactivate arm-plugin 2024-08-19 21:31:10 +02:00
2 changed files with 32 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ variable "image_link" { default = "https://downloads.raspberrypi.org/raspios_arm
variable "image_checksum" { default = "7e53a46aab92051d523d7283c080532bebb52ce86758629bf1951be9b4b0560f" }
variable "image_size" { default = "24G" }
source "arm" "raspiblitz-arm64-rpi" {
source "qemu" "raspiblitz-arm64-rpi" {
file_checksum_type = "sha256"
file_checksum = var.image_checksum
file_target_extension = "xz"
@@ -34,6 +34,15 @@ source "arm" "raspiblitz-arm64-rpi" {
image_type = "dos"
qemu_binary_destination_path = "/usr/bin/qemu-arm-static"
qemu_binary_source_path = "/usr/bin/qemu-arm-static"
# If required, you can specify CPU and memory settings
qemuargs = [
["-m", "1024M"], # Set memory to 1GB
["-smp", "4"] # Set the number of CPU cores
]
# Use the same architecture as the host (ARM)
accelerator = "none"
headless = true
}
build {

View File

@@ -30,32 +30,32 @@ if ! packer version 2>/dev/null; then
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository -y "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update -y && sudo apt-get install packer=1.10.0-1 -y || exit 1
else
echo "# Packer is installed"
fi
echo -e "\n# Install Go"
export PATH=$PATH:/usr/local/go/bin
# https://go.dev/dl/
GOVERSION="1.20.6"
GOHASH="b945ae2bb5db01a0fb4786afde64e6fbab50b67f6fa0eb6cfa4924f16a7ff1eb"
if ! go version 2>/dev/null | grep "${GOVERSION}"; then
wget --progress=bar:force https://go.dev/dl/go${GOVERSION}.linux-amd64.tar.gz
echo "${GOHASH} go${GOVERSION}.linux-amd64.tar.gz" | sha256sum -c - || exit 1
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go${GOVERSION}.linux-amd64.tar.gz
sudo rm -rf go${GOVERSION}.linux-amd64.tar.gz
else
echo "# Go ${GOVERSION} is installed"
fi
# echo -e "\n# Install Go"
# export PATH=$PATH:/usr/local/go/bin
# # https://go.dev/dl/
# GOVERSION="1.20.6"
# GOHASH="b945ae2bb5db01a0fb4786afde64e6fbab50b67f6fa0eb6cfa4924f16a7ff1eb"
# if ! go version 2>/dev/null | grep "${GOVERSION}"; then
# wget --progress=bar:force https://go.dev/dl/go${GOVERSION}.linux-amd64.tar.gz
# echo "${GOHASH} go${GOVERSION}.linux-amd64.tar.gz" | sha256sum -c - || exit 1
# sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go${GOVERSION}.linux-amd64.tar.gz
# sudo rm -rf go${GOVERSION}.linux-amd64.tar.gz
#else
# echo "# Go ${GOVERSION} is installed"
#fi
echo -e "\n# Download the packer-builder-arm plugin"
git clone https://github.com/mkaczanowski/packer-builder-arm
cd packer-builder-arm
# https://github.com/mkaczanowski/packer-builder-arm/releases
git reset --hard "v1.0.9"
echo -e "\n# Build the packer-builder-arm plugin"
go mod download
go build || exit 1
# echo -e "\n# Download the packer-builder-arm plugin"
# git clone https://github.com/mkaczanowski/packer-builder-arm
# cd packer-builder-arm
# # https://github.com/mkaczanowski/packer-builder-arm/releases
# git reset --hard "v1.0.9"
# echo -e "\n# Build the packer-builder-arm plugin"
# go mod download
# go build || exit 1
# set vars
echo "# Setting the variables: $*"