mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Update Makefile and builder/pwnagotchi.json.pkr.hcl
This commit is contained in:
4
Makefile
4
Makefile
@ -1,6 +1,6 @@
|
|||||||
PACKER_VERSION := 1.10.0
|
PACKER_VERSION := 1.10.0
|
||||||
PWN_HOSTNAME := pwnagotchi
|
PWN_HOSTNAME := pwnagotchi
|
||||||
PWN_VERSION := $(shell cut -d"'" -f2 < pwnagotchi/_version.py)
|
PWN_VERSION := ${PWN_VERSION}
|
||||||
|
|
||||||
MACHINE_TYPE := $(shell uname -m)
|
MACHINE_TYPE := $(shell uname -m)
|
||||||
ifneq (,$(filter x86_64,$(MACHINE_TYPE)))
|
ifneq (,$(filter x86_64,$(MACHINE_TYPE)))
|
||||||
@ -56,7 +56,7 @@ $(SDIST): setup.py pwnagotchi
|
|||||||
pwnagotchi: | $(PACKER)
|
pwnagotchi: | $(PACKER)
|
||||||
|
|
||||||
# If the packer or ansible files are updated, rebuild the image.
|
# If the packer or ansible files are updated, rebuild the image.
|
||||||
pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml $(shell find builder/data -type f)
|
pwnagotchi: $(SDIST) builder/pwnagotchi.json.pkr.hcl builder/raspberrypi64.yml builder/extras/nexmon.yml $(shell find builder/data -type f)
|
||||||
|
|
||||||
cd builder && $(PACKER) init pwnagotchi.json.pkr.hcl && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json.pkr.hcl
|
cd builder && $(PACKER) init pwnagotchi.json.pkr.hcl && sudo $(UNSHARE) $(PACKER) build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json.pkr.hcl
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
# https://github.com/mkaczanowski/packer-builder-arm/pull/172
|
# https://github.com/mkaczanowski/packer-builder-arm/pull/172
|
||||||
packer {
|
packer {
|
||||||
required_plugins {
|
required_plugins {
|
||||||
#arm = {
|
arm = {
|
||||||
# version = "~> 1"
|
version = "1.0.0"
|
||||||
# source = "https://github.com/mkaczanowski/packer-builder-arm"
|
source = "github.com/cdecoux/builder-arm"
|
||||||
#}
|
}
|
||||||
ansible = {
|
ansible = {
|
||||||
source = "github.com/hashicorp/ansible"
|
source = "github.com/hashicorp/ansible"
|
||||||
version = "~> 1"
|
version = "~> 1"
|
||||||
@ -51,6 +51,57 @@ source "arm" "rpi64-pwnagotchi" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
source "arm" "rpi32-pwnagotchi" {
|
||||||
|
file_checksum_url = "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz.sha256"
|
||||||
|
file_urls = ["https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2023-05-03/2023-05-03-raspios-bullseye-armhf-lite.img.xz"]
|
||||||
|
file_checksum_type = "sha256"
|
||||||
|
file_target_extension = "xz"
|
||||||
|
file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"]
|
||||||
|
image_path = "../../pwnagotchi-rpi-bullseye-${var.pwn_version}-armhf.img"
|
||||||
|
qemu_binary_source_path = "/usr/libexec/qemu-binfmt/arm-binfmt-P"
|
||||||
|
qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/arm-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"
|
||||||
|
}
|
||||||
|
image_partitions {
|
||||||
|
name = "root"
|
||||||
|
type = "83"
|
||||||
|
start_sector = "532480"
|
||||||
|
filesystem = "ext4"
|
||||||
|
size = "0"
|
||||||
|
mountpoint = "/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
source "arm" "opi-pwnagotchi" {
|
||||||
|
file_checksum_url = "https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz.sha256"
|
||||||
|
file_urls = ["https://github.com/jayofelony/orangepi/releases/download/v1.0/orangepi-raspios.img.xz"]
|
||||||
|
file_checksum_type = "sha256"
|
||||||
|
file_target_extension = "xz"
|
||||||
|
file_unarchive_cmd = ["unxz", "$ARCHIVE_PATH"]
|
||||||
|
image_path = "../../pwnagotchi-opi-bullseye-${var.pwn_version}-arm64.img"
|
||||||
|
qemu_binary_source_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P"
|
||||||
|
qemu_binary_destination_path = "/usr/libexec/qemu-binfmt/aarch64-binfmt-P"
|
||||||
|
image_build_method = "resize"
|
||||||
|
image_size = "9G"
|
||||||
|
image_type = "dos"
|
||||||
|
image_partitions {
|
||||||
|
name = "root"
|
||||||
|
type = "83"
|
||||||
|
start_sector = "8192"
|
||||||
|
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
|
||||||
@ -74,8 +125,48 @@ build {
|
|||||||
inline = ["chmod +x /usr/bin/*"]
|
inline = ["chmod +x /usr/bin/*"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "/etc/systemd/system/"
|
||||||
|
sources = [
|
||||||
|
"data/etc/systemd/system/bettercap.service",
|
||||||
|
"data/etc/systemd/system/pwnagotchi.service",
|
||||||
|
"data/etc/systemd/system/pwngrid-peer.service",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "/etc/update-motd.d/01-motd"
|
||||||
|
source = "data/etc/update-motd.d/01-motd"
|
||||||
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = ["dpkg --add-architecture armhf"]
|
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\""]
|
||||||
|
playbook_file = "raspberrypi64.yml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
name = "Raspberry Pi 32 Pwnagotchi"
|
||||||
|
sources = ["source.arm.rpi32-pwnagotchi"]
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "/usr/bin/"
|
||||||
|
sources = [
|
||||||
|
"data/usr/bin/bettercap-launcher",
|
||||||
|
"data/usr/bin/hdmioff",
|
||||||
|
"data/usr/bin/hdmion",
|
||||||
|
"data/usr/bin/monstart",
|
||||||
|
"data/usr/bin/monstop",
|
||||||
|
"data/usr/bin/pwnagotchi-launcher",
|
||||||
|
"data/usr/bin/pwnlib",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
provisioner "shell" {
|
||||||
|
inline = ["chmod +x /usr/bin/*"]
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
@ -86,7 +177,6 @@ build {
|
|||||||
"data/etc/systemd/system/pwngrid-peer.service",
|
"data/etc/systemd/system/pwngrid-peer.service",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
destination = "/etc/update-motd.d/01-motd"
|
destination = "/etc/update-motd.d/01-motd"
|
||||||
source = "data/etc/update-motd.d/01-motd"
|
source = "data/etc/update-motd.d/01-motd"
|
||||||
@ -95,15 +185,57 @@ build {
|
|||||||
inline = ["chmod +x /etc/update-motd.d/*"]
|
inline = ["chmod +x /etc/update-motd.d/*"]
|
||||||
}
|
}
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = [
|
inline = ["apt-get -y --allow-releaseinfo-change update", "apt-get -y dist-upgrade", "apt-get install -y --no-install-recommends ansible"]
|
||||||
"apt-get -y --allow-releaseinfo-change update",
|
|
||||||
"apt-get -y dist-upgrade",
|
|
||||||
"apt-get install -y --no-install-recommends ansible"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
provisioner "ansible-local" {
|
provisioner "ansible-local" {
|
||||||
command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 PWN_VERSION=${var.pwn_version} PWN_HOSTNAME=${var.pwn_hostname} ansible-playbook"
|
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\""]
|
extra_arguments = ["--extra-vars \"ansible_python_interpreter=/usr/bin/python3\""]
|
||||||
playbook_file = "raspberrypi64.yml"
|
playbook_dir = "extras/"
|
||||||
|
playbook_file = "raspberrypi32.yml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#build {
|
||||||
|
# name = "Orange Pi Pwnagotchi"
|
||||||
|
# sources = ["source.arm.opi-pwnagotchi"]
|
||||||
|
|
||||||
|
# provisioner "file" {
|
||||||
|
# destination = "/usr/bin/"
|
||||||
|
# sources = [
|
||||||
|
# "data/usr/bin/bettercap-launcher",
|
||||||
|
# "data/usr/bin/hdmioff",
|
||||||
|
# "data/usr/bin/hdmion",
|
||||||
|
# "data/usr/bin/monstart",
|
||||||
|
# "data/usr/bin/monstop",
|
||||||
|
# "data/usr/bin/pwnagotchi-launcher",
|
||||||
|
# "data/usr/bin/pwnlib",
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# provisioner "shell" {
|
||||||
|
# inline = ["chmod +x /usr/bin/*"]
|
||||||
|
# }
|
||||||
|
|
||||||
|
# provisioner "file" {
|
||||||
|
# destination = "/etc/systemd/system/"
|
||||||
|
# sources = [
|
||||||
|
# "data/etc/systemd/system/bettercap.service",
|
||||||
|
# "data/etc/systemd/system/pwnagotchi.service",
|
||||||
|
# "data/etc/systemd/system/pwngrid-peer.service",
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# provisioner "file" {
|
||||||
|
# destination = "/etc/update-motd.d/01-motd"
|
||||||
|
# source = "data/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\""]
|
||||||
|
# playbook_file = "orangepi.yml"
|
||||||
|
# }
|
||||||
|
#}
|
Reference in New Issue
Block a user