Merge pull request #373 from 185264646/fix-wl

Enhance `wl` command.
This commit is contained in:
Bjoern Kerler 2023-02-27 11:33:58 +01:00 committed by GitHub
commit 54a132687d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -724,17 +724,17 @@ class firehose_client(metaclass=LogBase):
filenames = [] filenames = []
if self.firehose.modules is not None: if self.firehose.modules is not None:
self.firehose.modules.writeprepare() self.firehose.modules.writeprepare()
for dirName, subdirList, fileList in os.walk(directory): for fname in filter(os.path.isfile, [ os.path.join(directory, i) for i in os.listdir(directory) ]):
for fname in fileList: filenames.append(fname)
filenames.append(os.path.join(dirName, fname))
for lun in luns: for lun in luns:
data, guid_gpt = self.firehose.get_gpt(lun, int(options["--gpt-num-part-entries"]), data, guid_gpt = self.firehose.get_gpt(lun, int(options["--gpt-num-part-entries"]),
int(options["--gpt-part-entry-size"]), int(options["--gpt-part-entry-size"]),
int(options["--gpt-part-entry-start-lba"])) int(options["--gpt-part-entry-start-lba"]))
if guid_gpt is None: if guid_gpt is None:
self.error("Error: Can not fetch GPT table from device, you may need to use `edl w gpt` to write a partition table first.`")
break break
for filename in filenames: for filename in filenames:
partname = filename[filename.rfind("/") + 1:] partname = os.path.basename(filename)
if ".bin" in partname[-4:] or ".img" in partname[-4:] or ".mbn" in partname[-4:]: if ".bin" in partname[-4:] or ".img" in partname[-4:] or ".mbn" in partname[-4:]:
partname = partname[:-4] partname = partname[:-4]
if partname in skip: if partname in skip: