Building coreboot from source (official script)

I’m running into this issue on my Librem 13v2 as well. I’m also running Arch, so it might be worth revisiting whether that is the cause.

Built purism/librem13v2 (Librem 13 v2)
File build/coreboot.rom is 16777216 bytes
  Flash Region 0 (Flash Descriptor): 00000000 - 00000fff 
  Flash Region 1 (BIOS): 00200000 - 00ffffff 
  Flash Region 2 (Intel ME): 00001000 - 001fffff 
  Flash Region 3 (GbE): 07fff000 - 00000fff (unused)
  Flash Region 4 (Platform Data): 07fff000 - 00000fff (unused)
  Flash Region 5 (Reserved): 07fff000 - 00000fff (unused)
  Flash Region 6 (Reserved): 07fff000 - 00000fff (unused)
  Flash Region 7 (Reserved): 07fff000 - 00000fff (unused)
  Flash Region 8 (EC): 07fff000 - 00000fff (unused)
Cloning into 'me_cleaner'...
remote: Counting objects: 217, done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 217 (delta 126), reused 157 (delta 89)
Receiving objects: 100% (217/217), 68.56 KiB | 403.00 KiB/s, done.
Resolving deltas: 100% (126/126), done.
Note: checking out 'origin/extra_partitions'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 9facf98... Change debug line to avoid confusion with new --extra-partitions argument
Full image detected
The ME/TXE region goes from 0x1000 to 0x200000
Found FPT header at 0x1010
Found 11 partition(s)
Found FTPR header: FTPR partition spans from 0x2000 to 0xa9000
Found FTPR manifest at 0x2478
ME/TXE firmware version 11.0.18.1002
Removing unused partitions...
 b'FTPR'	 (0x1000   - 0xa8000  (0xa7000  total bytes)): removed
 b'FTUP'	 (0x110000 - 0x1bc000 (0xac000  total bytes)): removed
 b'DLMP'	 (0x0      - 0x0      (0x0      total bytes)): removed
 b'PSVN'	 (0xe00    - 0x1000   (0x200    total bytes)): removed
 b'IVBP'	 (0x10c000 - 0x110000 (0x4000   total bytes)): removed
 b'MFS\x00'	 (0xa8000  - 0x10c000 (0x64000  total bytes)): removed
 b'NFTP'	 (0x110000 - 0x1bc000 (0xac000  total bytes)): removed
 b'ROMB'	 (0x0      - 0x0      (0x0      total bytes)): removed
 b'FLOG'	 (0x1bc000 - 0x1bd000 (0x1000   total bytes)): removed
 b'UTOK'	 (0x1bd000 - 0x1bf000 (0x2000   total bytes)): removed
 b'ISHC'	 (0x0      - 0x0      (0x0      total bytes)): removed
Removing unused partition entries in FPT...
Traceback (most recent call last):
  File "./me_cleaner/me_cleaner.py", line 638, in <module>
    mef.write_to(me_start + 0x14, pack("<I", len(new_partitions) / 0x20))
struct.error: required argument is not an integer

EDIT: This is because some of me_cleaner.py is incompatible with Python 3, which Arch uses by default – see this thread for details. Until this is fixed, a temporary workaround is to hardcode me_cleaner.py to use Python 2 instead.