From 9f54cae604c3969815df6f829bff219fbd112ed2 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 29 Apr 2023 18:03:05 -0700 Subject: [PATCH] more board defs --- packer/boards/cm4-router-ubuntu-22.04.2.json | 65 ++++++++++++++++++++ packer/files/netplan-router.yaml | 12 ++++ packer/files/user-data_router | 22 +++++++ 3 files changed, 99 insertions(+) create mode 100644 packer/boards/cm4-router-ubuntu-22.04.2.json create mode 100644 packer/files/netplan-router.yaml create mode 100644 packer/files/user-data_router diff --git a/packer/boards/cm4-router-ubuntu-22.04.2.json b/packer/boards/cm4-router-ubuntu-22.04.2.json new file mode 100644 index 0000000..4e9d0df --- /dev/null +++ b/packer/boards/cm4-router-ubuntu-22.04.2.json @@ -0,0 +1,65 @@ +{ + "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-router-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": [ + { + "destination": "/boot/firmware/user-data", + "source": "files/user-data_router", + "type": "file" + }, + { + "destination": "/etc/netplan/10-network.yaml", + "source": "files/netplan-router.yaml", + "type": "file" + }, + { + "scripts": [ + "scripts/setup-base.sh", + "scripts/setup-ssh.sh" + ], + "type": "shell" + } + ], + "post-processors": null +} \ No newline at end of file diff --git a/packer/files/netplan-router.yaml b/packer/files/netplan-router.yaml new file mode 100644 index 0000000..4e909e4 --- /dev/null +++ b/packer/files/netplan-router.yaml @@ -0,0 +1,12 @@ +network: + version: 2 + renderer: networkd + ethernets: + eth0: + dhcp4: yes + dhcp6: yes + eth1: + dhcp4: no + dhcp6: no + addresses: + - "192.168.4.254/24" diff --git a/packer/files/user-data_router b/packer/files/user-data_router new file mode 100644 index 0000000..fc163ea --- /dev/null +++ b/packer/files/user-data_router @@ -0,0 +1,22 @@ +#cloud-config + +# NOTE: this is a dev-environment fixture where I want a known user:pass to +# login on the serial console if things go sideways. +chpasswd: + expire: false + list: + - ubuntu:ubuntu + +hostname: controller +ssh_pwauth: true +ssh_authorized_keys: + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM47gCbb0BQOm6H4Ol8DEKD+CXTNYDJxe7QvJhdLZR/F kyle@petrichor + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGea83yMIdCi0QUUPgmhRgIrii7lS1dYxZ6LSxSsDOph kyle@europa + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEbkHs8zGZ3L6tRILjX7Cph8kXSpuw665mxe4ak2dwIx kyle@hermes + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICOCXJx+3ynRraM0JIsUy6Cin9JByPW/EUV9ggtuUCbC kyle@freeside + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINfRxWmx30LhGnsXpauLrj3GPvBWLhAKs0EznA9cNT5q kyle@deimos +ssh_deletekeys: true +ssh_genkeytypes: [rsa, ecdsa, ed25519] +disable_root: true + +resize_rootfs: true