mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-05 09:17:44 +03:00
ukify: Set fast_load option when parsing PE files
Let's skip parsing of some irrelevant information that we don't use to speed up building UKIs with large initrds from +-15s to less than 1s.
This commit is contained in:
parent
e43e735add
commit
c87ff62210
@ -80,7 +80,7 @@ def path_is_readable(s: typing.Optional[str]) -> typing.Optional[pathlib.Path]:
|
||||
def pe_next_section_offset(filename):
|
||||
import pefile
|
||||
|
||||
pe = pefile.PE(filename)
|
||||
pe = pefile.PE(filename, fast_load=True)
|
||||
section = pe.sections[-1]
|
||||
return pe.OPTIONAL_HEADER.ImageBase + section.VirtualAddress + section.Misc_VirtualSize
|
||||
|
||||
@ -457,7 +457,7 @@ def pairwise(iterable):
|
||||
def pe_validate(filename):
|
||||
import pefile
|
||||
|
||||
pe = pefile.PE(filename)
|
||||
pe = pefile.PE(filename, fast_load=True)
|
||||
|
||||
sections = sorted(pe.sections, key=lambda s: (s.VirtualAddress, s.Misc_VirtualSize))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user