Skip to content

Commit

Permalink
Add safety margin on truncation
Browse files Browse the repository at this point in the history
It seems that Intel ME requires some data after the last valid byte, as
truncating the image just after the last byte does not work.
For now this "safety margin" has been set to 4 blocks (16 kB).
  • Loading branch information
corna committed Feb 17, 2017
1 parent 2987431 commit 250b2ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions me_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


min_ftpr_offset = 0x400
spared_blocks = 4
unremovable_modules = ("BUP", "ROMP")


Expand Down Expand Up @@ -469,9 +470,10 @@ def relocate_partition(f, me_start, me_end, partition_header_offset,
ftpr_offset = new_ftpr_offset

end_addr = (end_addr // 0x1000 + 1) * 0x1000
end_addr += spared_blocks * 0x1000

print("The ME minimum size is {0} bytes ({0:#x} bytes)"
.format(end_addr - me_start))
print("The ME minimum size should be {0} bytes "
"({0:#x} bytes)".format(end_addr - me_start))

if me_start > 0:
print("The ME region can be reduced up to:\n"
Expand Down

0 comments on commit 250b2ec

Please sign in to comment.