From 69f04d8b0f438b81531d56392b1e8814d1300d2c Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Wed, 12 Apr 2023 06:03:09 +0000 Subject: [PATCH] packer: clean up Bazel build --- packer/BUILD.bazel | 25 +++++---- .../cm4-cluster-ubuntu-22.04.2.img.json | 54 +++++++++++++++++++ 2 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 packer/boards/cm4-cluster-ubuntu-22.04.2.img.json diff --git a/packer/BUILD.bazel b/packer/BUILD.bazel index 54dcdb3..2139a7e 100644 --- a/packer/BUILD.bazel +++ b/packer/BUILD.bazel @@ -1,18 +1,23 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_binary") -go_library( - name = "packer_lib", +#go_library( +# name = "packer_lib", +# srcs = ["ubuntu-board-gen.go"], +# importpath = "git.wntrmute.dev/kyle/bladerunner/packer", +# visibility = ["//visibility:private"], +# deps = [ +# "//packer/packerlib", +# "@ht_sr_git_kisom_goutils//die", +# ], +#) + +go_binary( + name = "ubuntu-board-gen", srcs = ["ubuntu-board-gen.go"], importpath = "git.wntrmute.dev/kyle/bladerunner/packer", - visibility = ["//visibility:private"], + visibility = ["//visibility:public"], deps = [ "//packer/packerlib", "@ht_sr_git_kisom_goutils//die", ], ) - -go_binary( - name = "ubuntu-board-gen", - embed = [":packer_lib"], - visibility = ["//visibility:public"], -) diff --git a/packer/boards/cm4-cluster-ubuntu-22.04.2.img.json b/packer/boards/cm4-cluster-ubuntu-22.04.2.img.json new file mode 100644 index 0000000..72a52de --- /dev/null +++ b/packer/boards/cm4-cluster-ubuntu-22.04.2.img.json @@ -0,0 +1,54 @@ +{ + "variables": {}, + "builders": [ + { + "type": "arm", + "file_urls": [ + "build/ubuntu-22.04.2-preinstalled-server-arm64+raspi.img.xz", + "https://cdimage.ubuntu.com/releases/22.04.2/release/ubuntu-22.04.2-preinstalled-server-arm64+raspi.img.xz" + ], + "file_checksum_url": "http://cdimage.ubuntu.com/releases/22.04.2/release/SHA256SUMS", + "file_checksum_type": "sha256", + "file_target_extension": "xz", + "file_unarchive_cmd": [ + "xz", + "--decompress", + "$ARCHIVE_PATH" + ], + "image_build_method": "reuse", + "image_path": "build/cm4-cluster-ubuntu-22.04.2.img", + "image_size": "32G", + "image_type": "dos", + "image_partitions": [ + { + "name": "boot", + "type": "c", + "start_sector": 2048, + "size": "256M", + "mountpoint": "/boot/firmware" + }, + { + "name": "root", + "type": "83", + "start_sector": 526336, + "size": "31.7G", + "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" + } + ], + "provisioners": [ + { + "scripts": [ + "scripts/install-base.sh" + ], + "type": "shell" + } + ], + "post-processors": null +} \ No newline at end of file