From b3c1c83677a1232a27f6a42c16c3b83007082d4b Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Thu, 18 Jan 2024 13:59:44 -0600 Subject: [PATCH] Remove time from PPFW filename and modify Flash app to support .tar (#1783) * Update timestamp in PPFW filename * Only include today's DATE in filename * Remove date from PPFW filename * Allow any .tar file name in FIRMWARE folder * Add files via upload * Removed unnecessary lines per ufoka --- CMakeLists.txt | 11 ----------- firmware/CMakeLists.txt | 1 + firmware/application/apps/ui_flash_utility.cpp | 4 ++-- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ec0f8b6..23826711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,6 @@ if ("${VERSION}" STREQUAL "") set(VERSION_NOHASH "dev") else() set(VERSION_NOHASH "${VERSION}") - set(PPFW_FILENAME "portapack-mayhem.ppfw.tar") endif() execute_process( @@ -55,16 +54,6 @@ execute_process( ) set(VERSION_MD5 "0x${VERSION_MD5}") -if (NOT DEFINED PPFW_FILENAME) - # Funny business here: trying to generate unique names to prevent renaming of shared test-drive builds by the browser on download to .ppfw-42.tar as it wont be recognized by the flasher - execute_process( - COMMAND date "+%y%m%d-%H%M" - OUTPUT_VARIABLE PPFW_FILENAME - ) - string(STRIP ${PPFW_FILENAME} PPFW_FILENAME) - set(PPFW_FILENAME "portapack-mayhem_${PPFW_FILENAME}_OCI.ppfw.tar") -endif() - message("Building version: ${VERSION} MD5: ${VERSION_MD5}") set(LICENSE_PATH ${CMAKE_CURRENT_LIST_DIR}/LICENSE) diff --git a/firmware/CMakeLists.txt b/firmware/CMakeLists.txt index 05db9caf..cfa680f8 100644 --- a/firmware/CMakeLists.txt +++ b/firmware/CMakeLists.txt @@ -35,6 +35,7 @@ set(LZ4 lz4) set(FIRMWARE_NAME portapack-h1_h2-mayhem) set(FIRMWARE_FILENAME ${FIRMWARE_NAME}.bin) +set(PPFW_FILENAME "portapack-mayhem_OCI.ppfw.tar") # In our current build container cmake need a little help to get the version :) if(NOT DEFINED ${CMAKE_CXX_COMPILER_VERSION}) diff --git a/firmware/application/apps/ui_flash_utility.cpp b/firmware/application/apps/ui_flash_utility.cpp index a4116ff7..a3658c3e 100644 --- a/firmware/application/apps/ui_flash_utility.cpp +++ b/firmware/application/apps/ui_flash_utility.cpp @@ -50,7 +50,7 @@ FlashUtilityView::FlashUtilityView(NavigationView& nav) this->firmware_selected(path); }}); } - for (const auto& entry : std::filesystem::directory_iterator(firmware_folder, u"*.ppfw.tar")) { + for (const auto& entry : std::filesystem::directory_iterator(firmware_folder, u"*.tar")) { auto filename = entry.path().filename(); auto path = entry.path().native(); @@ -108,7 +108,7 @@ std::filesystem::path FlashUtilityView::extract_tar(std::filesystem::path::strin } void FlashUtilityView::flash_firmware(std::filesystem::path::string_type path) { - if (endsWith(path, u".ppfw.tar")) { + if (endsWith(path, u".tar")) { // extract, then update path = extract_tar(u'/' + path).native(); if (path.empty()) return;