From 6b8e5e9d7b1aeb421c0e96e14e181cef7e7d840b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 05:41:19 -0600 Subject: [PATCH 1/2] Upgrade trunk (#9229) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index fb2d93563..54a803206 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - checkov@3.2.497 - - renovate@42.74.2 + - renovate@42.75.0 - prettier@3.7.4 - trufflehog@3.92.4 - yamllint@1.37.1 - bandit@1.9.2 - trivy@0.68.2 - taplo@0.10.0 - - ruff@0.14.10 + - ruff@0.14.11 - isort@7.0.0 - markdownlint@0.47.0 - oxipng@10.0.0 From b002844aa014fe9c965b8099080efe335277a552 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 9 Jan 2026 11:36:53 -0600 Subject: [PATCH 2/2] Add Rak 6421 autoconf (#9010) * Add Rak 6421 autoconf * Minor memory safety hardening --- bin/config.d/lora-hat-rak-6421-pi-hat.yaml | 11 +++++++ src/platform/portduino/PortduinoGlue.cpp | 35 +++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 bin/config.d/lora-hat-rak-6421-pi-hat.yaml diff --git a/bin/config.d/lora-hat-rak-6421-pi-hat.yaml b/bin/config.d/lora-hat-rak-6421-pi-hat.yaml new file mode 100644 index 000000000..066e36a10 --- /dev/null +++ b/bin/config.d/lora-hat-rak-6421-pi-hat.yaml @@ -0,0 +1,11 @@ +Lora: + + ### RAK13300in Slot 1 + Module: sx1262 + IRQ: 22 #IO6 + Reset: 16 # IO4 + Busy: 24 # IO5 + # Ant_sw: 13 # IO3 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index ea9e2de67..986e1c340 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -6,6 +6,7 @@ #include "target_specific.h" #include "PortduinoGlue.h" +#include "SHA256.h" #include "api/ServerAPI.h" #include "linux/gpio/LinuxGPIOPin.h" #include "meshUtils.h" @@ -270,7 +271,39 @@ void portduinoSetup() } std::cout << "autoconf: Found Pi HAT+ " << hat_vendor << " " << autoconf_product << " at /proc/device-tree/hat" << std::endl; - found_hat = true; + + // potential TODO: Validate that this is a real UUID + std::ifstream hatUUID("/proc/device-tree/hat/uuid"); + char uuid[38] = {0}; + if (hatUUID.is_open()) { + hatUUID.read(uuid, 37); + hatUUID.close(); + std::cout << "autoconf: UUID " << uuid << std::endl; + SHA256 uuid_hash; + uint8_t uuid_hash_bytes[32] = {0}; + + uuid_hash.reset(); + uuid_hash.update(uuid, 37); + uuid_hash.finalize(uuid_hash_bytes, 32); + + for (int j = 0; j < 16; j++) { + portduino_config.device_id[j] = uuid_hash_bytes[j]; + } + portduino_config.has_device_id = true; + uint8_t dmac[6] = {0}; + dmac[0] = (uuid_hash_bytes[17] << 4) | 2; + dmac[1] = uuid_hash_bytes[18]; + dmac[2] = uuid_hash_bytes[19]; + dmac[3] = uuid_hash_bytes[20]; + dmac[4] = uuid_hash_bytes[21]; + dmac[5] = uuid_hash_bytes[22]; + char macBuf[13] = {0}; + snprintf(macBuf, sizeof(macBuf), "%02X%02X%02X%02X%02X%02X", dmac[0], dmac[1], dmac[2], dmac[3], dmac[4], + dmac[5]); + portduino_config.mac_address = macBuf; + found_hat = true; + } + } else { std::cout << "autoconf: Could not locate Pi HAT+ at /proc/device-tree/hat" << std::endl; }