Update build

Signed-off-by: jayofelony <oudshoorn.jeroen@gmail.com>
This commit is contained in:
jayofelony
2024-07-01 07:51:18 +02:00
parent 087fd9cf09
commit 702d463194
4 changed files with 47 additions and 134 deletions

View File

@ -44,6 +44,7 @@ packer:
curl https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_amd64.zip -o /tmp/packer.zip curl https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_amd64.zip -o /tmp/packer.zip
unzip -o /tmp/packer.zip -d /tmp unzip -o /tmp/packer.zip -d /tmp
sudo mv /tmp/packer /usr/bin/packer sudo mv /tmp/packer /usr/bin/packer
/usr/bin/packer plugins install github.com/solo-io/arm-image
image: packer image: packer
export LC_ALL=en_GB.UTF-8 export LC_ALL=en_GB.UTF-8
@ -51,7 +52,7 @@ image: packer
32bit: packer 32bit: packer
export LC_ALL=en_GB.UTF-8 export LC_ALL=en_GB.UTF-8
cd builder && sudo /usr/bin/packer init raspberrypi32.json.pkr.hcl && QEMU_CPU=arm1176 sudo -E $(UNSHARE) /usr/bin/packer build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" raspberrypi32.json.pkr.hcl cd builder && sudo /usr/bin/packer init raspberrypi32.json.pkr.hcl && sudo $(UNSHARE) /usr/bin/packer build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" raspberrypi32.json.pkr.hcl
64bit: packer 64bit: packer
export LC_ALL=en_GB.UTF-8 export LC_ALL=en_GB.UTF-8

View File

@ -1,9 +1,5 @@
packer { packer {
required_plugins { required_plugins {
arm = {
version = "1.0.0"
source = "github.com/cdecoux/builder-arm"
}
ansible = { ansible = {
source = "github.com/hashicorp/ansible" source = "github.com/hashicorp/ansible"
version = ">= 1.1.1" version = ">= 1.1.1"
@ -19,64 +15,26 @@ variable "pwn_version" {
type = string type = string
} }
source "arm" "rpi64-pwnagotchi" { source "arm-image" "rpi64-pwnagotchi" {
file_checksum_url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz.sha256" image_type = "raspberrypi"
file_urls = ["https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz"] iso_url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz"
file_checksum_type = "sha256" iso_checksum = "sha256:58a3ec57402c86332e67789a6b8f149aeeb4e7bb0a16c9388a66ea6e07012e45"
file_target_extension = "xz" output_filename = "../../../pwnagotchi-64bit.img"
file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] qemu_binary = "qemu-aarch64-static"
image_path = "../../../pwnagotchi-64bit.img" image_mounts = ["/boot/firmware","/"]
qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" target_image_size = 9969908736
qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P"
image_build_method = "resize"
image_size = "9G"
image_type = "dos"
image_partitions {
name = "boot"
type = "c"
start_sector = "8192"
filesystem = "fat"
size = "256M"
mountpoint = "/boot/firmware"
}
image_partitions {
name = "root"
type = "83"
start_sector = "532480"
filesystem = "ext4"
size = "0"
mountpoint = "/"
}
} }
source "arm" "rpi32-pwnagotchi" { source "arm-image" "rpi32-pwnagotchi" {
file_checksum_url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz.sha256" image_type = "raspberrypi"
file_urls = ["https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz"] iso_url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz"
file_checksum_type = "sha256" iso_checksum = "sha256:4fa99737265ac338a9ed0643f502246b97b928e5dfffa92939242e26e290638d"
file_target_extension = "xz" output_filename = "../../../pwnagotchi-32bit.img"
file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] qemu_binary = "qemu-arm-static"
image_path = "../../../pwnagotchi-32bit.img" qemu_args = ["-cpu", "arm1176"]
qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" image_arch = "arm"
qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" image_mounts = ["/boot/firmware","/"]
image_build_method = "resize" target_image_size = 9969908736
image_size = "9G"
image_type = "dos"
image_partitions {
name = "boot"
type = "c"
start_sector = "8192"
filesystem = "fat"
size = "256M"
mountpoint = "/boot/firmware"
}
image_partitions {
name = "root"
type = "83"
start_sector = "532480"
filesystem = "ext4"
size = "0"
mountpoint = "/"
}
} }
# a build block invokes sources and runs provisioning steps on them. The # a build block invokes sources and runs provisioning steps on them. The
@ -84,7 +42,7 @@ source "arm" "rpi32-pwnagotchi" {
# https://www.packer.io/docs/from-1.5/blocks/build # https://www.packer.io/docs/from-1.5/blocks/build
build { build {
name = "Raspberry Pi 64 Pwnagotchi" name = "Raspberry Pi 64 Pwnagotchi"
sources = ["source.arm.rpi64-pwnagotchi"] sources = ["source.arm-image.rpi64-pwnagotchi"]
provisioner "file" { provisioner "file" {
destination = "/usr/bin/" destination = "/usr/bin/"
@ -136,7 +94,7 @@ build {
build { build {
name = "Raspberry Pi 32 Pwnagotchi" name = "Raspberry Pi 32 Pwnagotchi"
sources = ["source.arm.rpi32-pwnagotchi"] sources = ["source.arm-image.rpi32-pwnagotchi"]
provisioner "file" { provisioner "file" {
destination = "/usr/bin/" destination = "/usr/bin/"
sources = [ sources = [

View File

@ -1,9 +1,9 @@
packer { packer {
required_plugins { required_plugins {
arm = { #arm = {
version = ">=1.0.0" # version = ">=1.0.0"
source = "github.com/michalfita/cross" # source = "github.com/michalfita/cross"
} #}
ansible = { ansible = {
source = "github.com/hashicorp/ansible" source = "github.com/hashicorp/ansible"
version = ">= 1.1.1" version = ">= 1.1.1"
@ -19,41 +19,21 @@ variable "pwn_version" {
type = string type = string
} }
source "arm" "rpi32-pwnagotchi" { source "arm-image" "rpi32-pwnagotchi" {
file_checksum_url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz.sha256" image_type = "raspberrypi"
file_urls = ["https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz"] iso_url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz"
file_checksum_type = "sha256" iso_checksum = "sha256:4fa99737265ac338a9ed0643f502246b97b928e5dfffa92939242e26e290638d"
file_target_extension = "xz" output_filename = "../../../pwnagotchi-32bit.img"
file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] qemu_binary = "qemu-arm-static"
image_path = "../../../pwnagotchi-32bit.img" qemu_args = ["-cpu", "arm1176"]
qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" image_arch = "arm"
qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P" image_mounts = ["/boot/firmware","/"]
image_build_method = "resize" target_image_size = 9969908736
image_size = "9G"
image_type = "dos"
image_partitions {
name = "boot"
type = "c"
start_sector = "8192"
filesystem = "fat"
size = "256M"
mountpoint = "/boot/firmware"
}
image_partitions {
name = "root"
type = "83"
start_sector = "532480"
filesystem = "ext4"
size = "0"
mountpoint = "/"
}
} }
build { build {
name = "Raspberry Pi 32 Pwnagotchi" name = "Raspberry Pi 32 Pwnagotchi"
sources = ["source.arm.rpi32-pwnagotchi"] sources = ["source.arm-image.rpi32-pwnagotchi"]
provisioner "shell" {
inline = ["uname -m"]
}
provisioner "file" { provisioner "file" {
destination = "/usr/bin/" destination = "/usr/bin/"
sources = [ sources = [

View File

@ -1,9 +1,5 @@
packer { packer {
required_plugins { required_plugins {
arm = {
version = ">=1.0.0"
source = "github.com/michalfita/cross"
}
ansible = { ansible = {
source = "github.com/hashicorp/ansible" source = "github.com/hashicorp/ansible"
version = ">= 1.1.1" version = ">= 1.1.1"
@ -19,44 +15,22 @@ variable "pwn_version" {
type = string type = string
} }
source "arm" "rpi64-pwnagotchi" { source "arm-image" "rpi64-pwnagotchi" {
file_checksum_url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz.sha256" image_type = "raspberrypi"
file_urls = ["https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz"] iso_url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz"
file_checksum_type = "sha256" iso_checksum = "sha256:58a3ec57402c86332e67789a6b8f149aeeb4e7bb0a16c9388a66ea6e07012e45"
file_target_extension = "xz" output_filename = "../../../pwnagotchi-64bit.img"
file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"] qemu_binary = "qemu-aarch64-static"
image_path = "../../../pwnagotchi-64bit.img" image_mounts = ["/boot/firmware","/"]
qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P" target_image_size = 9969908736
qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P"
image_build_method = "resize"
image_size = "9G"
image_type = "dos"
image_partitions {
name = "boot"
type = "c"
start_sector = "8192"
filesystem = "fat"
size = "256M"
mountpoint = "/boot/firmware"
} }
image_partitions {
name = "root"
type = "83"
start_sector = "532480"
filesystem = "ext4"
size = "0"
mountpoint = "/"
}
}
# a build block invokes sources and runs provisioning steps on them. The # a build block invokes sources and runs provisioning steps on them. The
# documentation for build blocks can be found here: # documentation for build blocks can be found here:
# https://www.packer.io/docs/from-1.5/blocks/build # https://www.packer.io/docs/from-1.5/blocks/build
build { build {
name = "Raspberry Pi 64 Pwnagotchi" name = "Raspberry Pi 64 Pwnagotchi"
sources = ["source.arm.rpi64-pwnagotchi"] sources = ["source.arm-image.rpi64-pwnagotchi"]
provisioner "file" { provisioner "file" {
destination = "/usr/bin/" destination = "/usr/bin/"