diff options
| author | jacqueline <me@jacqueline.id.au> | 2025-07-25 13:33:07 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2025-07-25 13:33:07 +1000 |
| commit | c8e79a926620e48830778714cfe4b2ea2453fcaf (patch) | |
| tree | 8c756e08e01b8e147cf72bec128026f46bd854c5 /lib/fatfs/fatfsparse.py | |
| parent | 237136f3e93cb6b5be24670d7520adb17cc0fa36 (diff) | |
| download | tangara-fw-c8e79a926620e48830778714cfe4b2ea2453fcaf.tar.gz | |
Update forked idf components
Diffstat (limited to 'lib/fatfs/fatfsparse.py')
| -rwxr-xr-x | lib/fatfs/fatfsparse.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/fatfs/fatfsparse.py b/lib/fatfs/fatfsparse.py index de50f2fe..13c9a056 100755 --- a/lib/fatfs/fatfsparse.py +++ b/lib/fatfs/fatfsparse.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import argparse import os @@ -100,7 +100,7 @@ def remove_wear_levelling_if_exists(fs_: bytes) -> bytes: boot_sector__.parse_boot_sector(fs_) if boot_sector__.boot_sector_state.size == len(fs_): return fs_ - except construct.core.ConstError: + except (UnicodeDecodeError, construct.core.StringError): pass plain_fs: bytes = remove_wl(fs_) return plain_fs @@ -124,6 +124,9 @@ if __name__ == '__main__': default=None, help="If detection doesn't work correctly, " 'you can force analyzer to or not to assume WL.') + argument_parser.add_argument('--verbose', + action='store_true', + help='Prints details about FAT image.') args = argument_parser.parse_args() @@ -157,6 +160,10 @@ if __name__ == '__main__': boot_sector_ = BootSector() boot_sector_.parse_boot_sector(fs) + + if args.verbose: + print(str(boot_sector_)) + fat = FAT(boot_sector_.boot_sector_state, init_=False) boot_dir_start_ = boot_sector_.boot_sector_state.root_directory_start |
