2024-02-25 12:58:40 +01:00
|
|
|
packer {
|
|
|
|
required_plugins {
|
2024-07-01 20:15:45 +02:00
|
|
|
arm-image = {
|
|
|
|
source = "github.com/solo-io/arm-image"
|
|
|
|
version = ">= 0.0.1"
|
|
|
|
}
|
2024-02-25 12:58:40 +01:00
|
|
|
ansible = {
|
|
|
|
source = "github.com/hashicorp/ansible"
|
2024-02-26 21:27:10 +01:00
|
|
|
version = ">= 1.1.1"
|
2024-02-25 12:58:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "pwn_hostname" {
|
|
|
|
type = string
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "pwn_version" {
|
|
|
|
type = string
|
|
|
|
}
|
|
|
|
|
2024-07-01 07:51:18 +02:00
|
|
|
source "arm-image" "rpi64-pwnagotchi" {
|
|
|
|
image_type = "raspberrypi"
|
2024-07-26 23:28:59 +02:00
|
|
|
iso_url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz"
|
|
|
|
iso_checksum = "sha256:43d150e7901583919e4eb1f0fa83fe0363af2d1e9777a5bb707d696d535e2599"
|
2024-07-01 07:51:18 +02:00
|
|
|
output_filename = "../../../pwnagotchi-64bit.img"
|
|
|
|
qemu_binary = "qemu-aarch64-static"
|
2024-07-02 15:10:17 +02:00
|
|
|
target_image_size = 19969908736
|
2024-02-25 12:58:40 +01:00
|
|
|
}
|
|
|
|
|
2024-07-01 07:51:18 +02:00
|
|
|
source "arm-image" "rpi32-pwnagotchi" {
|
|
|
|
image_type = "raspberrypi"
|
2024-07-26 23:28:59 +02:00
|
|
|
iso_url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-07-04/2024-07-04-raspios-bookworm-armhf-lite.img.xz"
|
|
|
|
iso_checksum = "sha256:df9c192d66d35e1ce67acde33a5b5f2b81ff02d2b986ea52f1f6ea211d646a1b"
|
2024-07-01 07:51:18 +02:00
|
|
|
output_filename = "../../../pwnagotchi-32bit.img"
|
|
|
|
qemu_binary = "qemu-arm-static"
|
|
|
|
qemu_args = ["-cpu", "arm1176"]
|
|
|
|
image_arch = "arm"
|
2024-07-02 15:10:17 +02:00
|
|
|
target_image_size = 19969908736
|
2024-02-25 12:58:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# a build block invokes sources and runs provisioning steps on them. The
|
|
|
|
# documentation for build blocks can be found here:
|
|
|
|
# https://www.packer.io/docs/from-1.5/blocks/build
|
|
|
|
build {
|
|
|
|
name = "Raspberry Pi 64 Pwnagotchi"
|
2024-07-01 07:51:18 +02:00
|
|
|
sources = ["source.arm-image.rpi64-pwnagotchi"]
|
2024-02-25 12:58:40 +01:00
|
|
|
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/usr/bin/"
|
|
|
|
sources = [
|
|
|
|
"data/64bit/usr/bin/bettercap-launcher",
|
|
|
|
"data/64bit/usr/bin/hdmioff",
|
|
|
|
"data/64bit/usr/bin/hdmion",
|
|
|
|
"data/64bit/usr/bin/monstart",
|
|
|
|
"data/64bit/usr/bin/monstop",
|
|
|
|
"data/64bit/usr/bin/pwnagotchi-launcher",
|
|
|
|
"data/64bit/usr/bin/pwnlib",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["chmod +x /usr/bin/*"]
|
|
|
|
}
|
2024-06-02 12:47:51 +02:00
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["mkdir -p /usr/local/src/pwnagotchi"]
|
|
|
|
}
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/usr/local/src/pwnagotchi/"
|
|
|
|
source = "../"
|
|
|
|
}
|
2024-02-25 12:58:40 +01:00
|
|
|
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/etc/systemd/system/"
|
|
|
|
sources = [
|
|
|
|
"data/64bit/etc/systemd/system/bettercap.service",
|
|
|
|
"data/64bit/etc/systemd/system/pwnagotchi.service",
|
|
|
|
"data/64bit/etc/systemd/system/pwngrid-peer.service",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/etc/update-motd.d/01-motd"
|
|
|
|
source = "data/64bit/etc/update-motd.d/01-motd"
|
|
|
|
}
|
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["chmod +x /etc/update-motd.d/*"]
|
|
|
|
}
|
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"]
|
|
|
|
}
|
|
|
|
provisioner "ansible-local" {
|
|
|
|
command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook"
|
|
|
|
extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""]
|
2024-03-19 09:25:17 +01:00
|
|
|
playbook_file = "raspberrypi64.yml"
|
2024-02-25 12:58:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
build {
|
|
|
|
name = "Raspberry Pi 32 Pwnagotchi"
|
2024-07-01 07:51:18 +02:00
|
|
|
sources = ["source.arm-image.rpi32-pwnagotchi"]
|
2024-02-25 12:58:40 +01:00
|
|
|
provisioner "file" {
|
|
|
|
destination = "/usr/bin/"
|
|
|
|
sources = [
|
|
|
|
"data/32bit/usr/bin/bettercap-launcher",
|
|
|
|
"data/32bit/usr/bin/hdmioff",
|
|
|
|
"data/32bit/usr/bin/hdmion",
|
|
|
|
"data/32bit/usr/bin/monstart",
|
|
|
|
"data/32bit/usr/bin/monstop",
|
|
|
|
"data/32bit/usr/bin/pwnagotchi-launcher",
|
|
|
|
"data/32bit/usr/bin/pwnlib",
|
|
|
|
]
|
|
|
|
}
|
2024-06-02 12:47:51 +02:00
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["mkdir -p /usr/local/src/pwnagotchi"]
|
|
|
|
}
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/usr/local/src/pwnagotchi/"
|
|
|
|
source = "../"
|
|
|
|
}
|
2024-02-25 12:58:40 +01:00
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["chmod +x /usr/bin/*"]
|
|
|
|
}
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/etc/systemd/system/"
|
|
|
|
sources = [
|
|
|
|
"data/32bit/etc/systemd/system/bettercap.service",
|
|
|
|
"data/32bit/etc/systemd/system/pwnagotchi.service",
|
|
|
|
"data/32bit/etc/systemd/system/pwngrid-peer.service",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
provisioner "file" {
|
|
|
|
destination = "/etc/update-motd.d/01-motd"
|
|
|
|
source = "data/32bit/etc/update-motd.d/01-motd"
|
|
|
|
}
|
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["chmod +x /etc/update-motd.d/*"]
|
|
|
|
}
|
|
|
|
provisioner "shell" {
|
|
|
|
inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"]
|
|
|
|
}
|
|
|
|
provisioner "ansible-local" {
|
|
|
|
command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook"
|
|
|
|
extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""]
|
2024-03-19 09:25:17 +01:00
|
|
|
playbook_file = "raspberrypi32.yml"
|
2024-02-25 12:58:40 +01:00
|
|
|
}
|
|
|
|
}
|