Skip to content
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
3 changes: 2 additions & 1 deletion dumpyara/dumpyara.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dumpyara.steps.prepare_images import prepare_images

try:
import firmware_parsers # noqa: F401

Check failure on line 18 in dumpyara/dumpyara.py

View workflow job for this annotation

GitHub Actions / pyright

Import "firmware_parsers" could not be resolved (reportMissingImports)

_HAS_FIRMWARE_PARSERS = True
except ImportError:
Expand Down Expand Up @@ -77,7 +77,8 @@
# Create all_files.txt
LOGI("Creating all_files.txt")
(output_path / "all_files.txt").write_text(
"\n".join([str(file) for file in files_list]) + "\n"
"\n".join([str(file) for file in files_list]) + "\n",
encoding="utf-8"
)

return output_path
Expand Down
22 changes: 13 additions & 9 deletions dumpyara/utils/partitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,23 @@ def prepare_raw_images(files_path: Path, raw_images_path: Path):
def fix_aliases(images_path: Path):
"""Move aliased partitions to their generic name."""
for alt_name, name in ALTERNATIVE_PARTITION_NAMES.items():
alt_path = images_path / f"{alt_name}.img"
alt_paths = [
images_path / f"{alt_name}.img",
images_path / f"{alt_name}.bin",
]
partition_path = images_path / f"{name}.img"

if not alt_path.exists():
continue
for alt_path in alt_paths:
if not alt_path.exists():
continue

if partition_path.exists():
LOGI(f"Ignoring {alt_name} ({name} already extracted)")
alt_path.unlink()
continue
if partition_path.exists():
LOGI(f"Ignoring {alt_name} ({name} already extracted)")
alt_path.unlink()
continue

LOGI(f"Fixing alias {alt_name} -> {name}")
move(alt_path, partition_path)
LOGI(f"Fixing alias {alt_name} -> {name}")
move(alt_path, partition_path)


def get_filename_suffixes(file: Path):
Expand Down
Loading