1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

Merge branch 'fz-dev' into dev

This commit is contained in:
Eng1n33r
2022-07-04 21:57:40 +03:00
62 changed files with 1405 additions and 221 deletions

View File

@@ -76,12 +76,15 @@ class Main(App):
manifest_name, pkg_name = manifest_path.parts[-1], manifest_path.parts[-2]
pkg_dir_name = self.args.pkg_dir_name or pkg_name
flipper_update_path = f"/ext/update/{pkg_dir_name}"
update_root = "/ext/update"
flipper_update_path = f"{update_root}/{pkg_dir_name}"
self.logger.info(f'Installing "{pkg_name}" from {flipper_update_path}')
# if not os.path.exists(self.args.manifest_path):
# self.logger.error("Error: package not found")
if not self.mkdir_on_storage(storage, flipper_update_path):
if not self.mkdir_on_storage(
storage, update_root
) or not self.mkdir_on_storage(storage, flipper_update_path):
self.logger.error(f"Error: cannot create {storage.last_error}")
return -2
@@ -99,6 +102,14 @@ class Main(App):
storage.send_and_wait_eol(
f"update install {flipper_update_path}/{manifest_name}\r"
)
result = storage.read.until(storage.CLI_EOL)
if not b"Verifying" in result:
self.logger.error(f"Unexpected response: {result.decode('ascii')}")
return -4
result = storage.read.until(storage.CLI_EOL)
if not result.startswith(b"OK"):
self.logger.error(result.decode("ascii"))
return -5
break
return 0
finally: