mirror of
https://github.com/0x1d/terraform-docker-packer.git
synced 2025-12-14 14:01:29 +01:00
61 lines
1.6 KiB
HCL
61 lines
1.6 KiB
HCL
variable "image_url" {
|
|
type = string
|
|
default = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64-lite.img.xz"
|
|
}
|
|
|
|
source "arm" "raspios-arm64" {
|
|
file_urls = ["${var.image_url}"]
|
|
file_checksum_url = "${var.image_url}.sha256"
|
|
file_checksum_type = "sha256"
|
|
file_target_extension = "xz"
|
|
file_unarchive_cmd = ["xz", "--decompress", "$ARCHIVE_PATH"]
|
|
image_build_method = "resize"
|
|
image_path = "raspios-arm64.img"
|
|
image_size = "4G"
|
|
image_type = "dos"
|
|
|
|
image_partitions {
|
|
name = "boot"
|
|
type = "c"
|
|
start_sector = "8192"
|
|
filesystem = "vfat"
|
|
size = "256M"
|
|
mountpoint = "/boot"
|
|
}
|
|
|
|
image_partitions {
|
|
name = "root"
|
|
type = "83"
|
|
start_sector = "532480"
|
|
filesystem = "ext4"
|
|
size = "0"
|
|
mountpoint = "/"
|
|
}
|
|
|
|
image_chroot_env = ["PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"]
|
|
qemu_binary_source_path = "/usr/bin/qemu-aarch64-static"
|
|
qemu_binary_destination_path = "/usr/bin/qemu-aarch64-static"
|
|
}
|
|
|
|
build {
|
|
sources = ["source.arm.raspios-arm64"]
|
|
|
|
provisioner "file" {
|
|
source = "rootfs/lib/systemd/system/firstboot.service"
|
|
destination = "/lib/systemd/system/firstboot.service"
|
|
}
|
|
|
|
provisioner "file" {
|
|
source = "rootfs/lib/firstboot.sh"
|
|
destination = "/lib/firstboot.sh"
|
|
}
|
|
|
|
provisioner "shell" {
|
|
scripts = [
|
|
"scripts/pi.sh",
|
|
"scripts/docker.sh",
|
|
"scripts/hashi.sh"
|
|
]
|
|
}
|
|
}
|