Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-3045] Fix core2 permisions #2742

Merged
merged 5 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/flipper/assets/copro.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,23 @@ def loadCubeInfo(self, cube_dir, reference_cube_version):
def _getFileName(self, name):
return posixpath.join(self.COPRO_TAR_DIR, name)

def _addFileReadPermission(self, tarinfo):
tarinfo.mode = 0o644
return tarinfo

def addFile(self, array, filename, **kwargs):
source_file = os.path.join(self.mcu_copro, filename)
self.output_tar.add(source_file, arcname=self._getFileName(filename))
self.output_tar.add(
source_file,
arcname=self._getFileName(filename),
filter=self._addFileReadPermission,
)
array.append({"name": filename, "sha256": file_sha256(source_file), **kwargs})

def bundle(self, output_file, stack_file_name, stack_type, stack_addr=None):
self.output_tar = tarfile.open(output_file, "w:gz", format=tarfile.USTAR_FORMAT)
fw_directory = tarfile.TarInfo(self.COPRO_TAR_DIR)
fw_directory.mode = 0o755
fw_directory.type = tarfile.DIRTYPE
self.output_tar.addfile(fw_directory)

Expand Down
5 changes: 4 additions & 1 deletion scripts/flipper/assets/coprobin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class CoproFooterBase:
_SIG_BIN_COMMON_SIZE = 2 * 4

def get_version(self):
return f"Version {self.version_major}.{self.version_minor}.{self.version_sub}, branch {self.version_branch}, build {self.version_build} (magic {self.magic:X})"
return (
f"Version {self.version_major}.{self.version_minor}.{self.version_sub}, "
f"branch {self.version_branch}, build {self.version_build} (magic {self.magic:X})"
)

def get_details(self):
raise CoproException("Not implemented")
Expand Down