mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-08 10:57:39 +00:00
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
This commit is contained in:
parent
fcbc3b4d75
commit
b3c1c83677
@ -46,7 +46,6 @@ if ("${VERSION}" STREQUAL "")
|
|||||||
set(VERSION_NOHASH "dev")
|
set(VERSION_NOHASH "dev")
|
||||||
else()
|
else()
|
||||||
set(VERSION_NOHASH "${VERSION}")
|
set(VERSION_NOHASH "${VERSION}")
|
||||||
set(PPFW_FILENAME "portapack-mayhem.ppfw.tar")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
@ -55,16 +54,6 @@ execute_process(
|
|||||||
)
|
)
|
||||||
set(VERSION_MD5 "0x${VERSION_MD5}")
|
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}")
|
message("Building version: ${VERSION} MD5: ${VERSION_MD5}")
|
||||||
|
|
||||||
set(LICENSE_PATH ${CMAKE_CURRENT_LIST_DIR}/LICENSE)
|
set(LICENSE_PATH ${CMAKE_CURRENT_LIST_DIR}/LICENSE)
|
||||||
|
@ -35,6 +35,7 @@ set(LZ4 lz4)
|
|||||||
|
|
||||||
set(FIRMWARE_NAME portapack-h1_h2-mayhem)
|
set(FIRMWARE_NAME portapack-h1_h2-mayhem)
|
||||||
set(FIRMWARE_FILENAME ${FIRMWARE_NAME}.bin)
|
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 :)
|
# In our current build container cmake need a little help to get the version :)
|
||||||
if(NOT DEFINED ${CMAKE_CXX_COMPILER_VERSION})
|
if(NOT DEFINED ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
@ -50,7 +50,7 @@ FlashUtilityView::FlashUtilityView(NavigationView& nav)
|
|||||||
this->firmware_selected(path);
|
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 filename = entry.path().filename();
|
||||||
auto path = entry.path().native();
|
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) {
|
void FlashUtilityView::flash_firmware(std::filesystem::path::string_type path) {
|
||||||
if (endsWith(path, u".ppfw.tar")) {
|
if (endsWith(path, u".tar")) {
|
||||||
// extract, then update
|
// extract, then update
|
||||||
path = extract_tar(u'/' + path).native();
|
path = extract_tar(u'/' + path).native();
|
||||||
if (path.empty()) return;
|
if (path.empty()) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user