[FL-2578] Updater fixes related to /int handling (#1359)
* Updater fixes related to /int handling updater: performing factory reset on update, checking for LFS free space before updating, fixed improper error handling on backup/restore operations, rebalanced update stage weights for better progress visuals scripts: added CLI output validation for selfupdate.py storage: added pointer validation in storage_int_common_fs_info desktop: fixed crash on rendering invalid slideshows * Typo fix * rpc: Updated protobuf to 0.9 * rpc: removed updater status conversion Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user