raspiblitz/ci/amd64/packer.build.amd64-debian.sh
openoms 0d0e5581a5
ci: UEFI image generation and build updates (#4033)
* ci: use uefi for amd64 image, debian 12.1.0
* build: add amd64 legacyboot image action
* ci: store var values in config, update readme
* fix: add raspi repo on aarch64 only
fixes: https://github.com/raspiblitz/raspiblitz/issues/4029
* docs: guide to extend the root partition
2023-07-30 10:51:33 +02:00

29 lines
842 B
Bash

#!/bin/bash -e
# install packer
if ! packer version 2>/dev/null; then
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update
echo -e "\nInstalling packer..."
sudo apt-get install -y packer
else
echo "# Packer is installed"
fi
# install qemu
echo -e "\nInstalling qemu..."
sudo apt-get install -y qemu-system
# set vars
source ../set_variables.sh
set_variables "$@"
# Build the image
echo -e "\nBuilding the image..."
cd debian
packer init -upgrade .
command="PACKER_LOG=1 packer build ${vars} -only=qemu packer.build.amd64-debian.hcl"
echo "# Running: $command"
if [ ${#vars} -eq 0 ];then exit 1;fi
PACKER_LOG=1 packer build ${vars} -only=qemu.debian build.amd64-debian.pkr.hcl || exit 1