From 557f3e2702a76b460d414e82c3246b50366ecdb2 Mon Sep 17 00:00:00 2001 From: Yevhen Boichuk Date: Wed, 28 Oct 2026 21:48:55 +0200 Subject: [PATCH 1/2] fix: multiboot always uses the other Keira slot With more OTA apps in the partition table (e.g. Retro-Go next to Keira in the lilka-bootloader layout) esp_ota_get_next_update_partition() from app1 returns an app that isn't Keira's. Pick app0/app1 explicitly and fall back to the next OTA partition for other layouts. Co-Authored-By: Claude Opus 5.5 --- lib/lilka/src/lilka/multiboot.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/lilka/src/lilka/multiboot.cpp b/lib/lilka/src/lilka/multiboot.cpp index 9b6e184..9dfa4a2 100644 --- a/lib/lilka/src/lilka/multiboot.cpp +++ b/lib/lilka/src/lilka/multiboot.cpp @@ -28,6 +28,15 @@ MultiBoot::MultiBoot() : ota_handle(0), current_partition(NULL), ota_partition(NULL), path(""), bytesTotal(0), bytesWritten(0), file(NULL) { } +// The other one of app0/app1. With more apps sharing the flash (e.g. Retro-Go next to Keira) +// esp_ota_get_next_update_partition() may return a partition that belongs to them. +static const esp_partition_t* getGuestPartition(const esp_partition_t* current) { + const char* other = strcmp(current->label, "app0") == 0 ? "app1" : "app0"; + const esp_partition_t* partition = + esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, other); + return partition ? partition : esp_ota_get_next_update_partition(current); +} + void MultiBoot::begin() { // Get commandline args bool verify_kcmd_loc = &kcmd == reinterpret_cast(MULTIBOOT_KCMD_DEFAULT_LOCATION); @@ -86,7 +95,7 @@ void MultiBoot::begin() { current_partition->subtype, current_partition->size ); - ota_partition = esp_ota_get_next_update_partition(current_partition); // get ota1 (we're in ota0 now) + ota_partition = getGuestPartition(current_partition); serial.log( "OTA partition: %s, type: %d, subtype: %d, size: %d", ota_partition->label, @@ -183,7 +192,7 @@ int MultiBoot::start(String path) { current_partition->subtype, current_partition->size ); - ota_partition = esp_ota_get_next_update_partition(current_partition); // get ota1 (we're in ota0 now) + ota_partition = getGuestPartition(current_partition); if (ota_partition == NULL) { serial.err("Failed to get next OTA partition"); return -4; From 16cc669bae030513f365efbcedf4bdf1d5c924d4 Mon Sep 17 00:00:00 2001 From: Yevhen Boichuk Date: Wed, 28 Oct 2026 22:03:49 +0200 Subject: [PATCH 2/2] ci: use Python 3.11 (3.9 is gone from ubuntu-latest) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/sdk.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index bcf5ac0..662a058 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -22,9 +22,10 @@ jobs: ~/.platformio/.cache ./lib/lilka/.pio key: ${{ runner.os }}-lilka - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.9' + # 3.9 isn't available for the current ubuntu-latest image + python-version: '3.11' - name: Install PlatformIO Core run: pip install --upgrade platformio