Python not found when using the build option in coreboot_util.sh on Librem 14

Continuing the discussion from MrChromebox UEFI firmware for Librem Devices (unofficial/unsupported):

I experience the same issue as the linked post: building the update apparently requires python but my system, after thorough updating with apt and the autoremove option apparently doesn’t have Python 2 installed any more.

Does the build triggered in coreboot_util.sh require Python 2, or could a link to Python 3 solve the issue? If Python 2 is indeed required, the python script should be ported to Python 3 or at least the Python 2 dependency should be installed with the other dependencies the build process has.

1 Like

@MrChromebox ^^ :smiley:

I just saw that python is listed as a dependency in the coreboot_util.sh script, but python is not an available package. See

$ apt list python
Listing... Done
$ apt list python2
Listing... Done
python2/byzantium 2.7.18-3 amd64
$ apt list python3
Listing... Done
python3/byzantium,now 3.9.2-3 amd64 [installed,automatic]

I’ve added an issue for this and will tackle it later this week. It should be as simple as changing the dependency from python to python2, but I want to make sure nothing breaks before pushing the change

2 Likes

Thank you @MrChromebox for picking this up. I think as a first step fixing the python2 dependency is OK. But Python 2 is now obsolete and moving to Python 3 would be a preferable solution because it doesn’t reintroduce otherwise obsolete code. I don’t know the python codebase that requires this python2 dependency and how much work it would be to port it to Python 3 and I don’t expect a solution tomorrow - whenever the fix arrives I’ll be happy, and I’ll have a small celebration in your honor if you remove the Python 2 dependency :slight_smile:

it’s not the script’s dependency, it’s coreboot’s. Only so much I can do there :slight_smile:

In that case, can you check if it works with linking Python 3 to python? If I understand the setup.py correctly in coreboots repo it should work, but there might be dependencies I am not aware of or don’t understand. So I am hesitant to trial run this assumption with my brand new L14.

worst case you just rebuild cleanly, I’m not sure there’s any big risk.

Here’s the output from building after linking python to pyton3.9. I says it can compile successfully, but it also mentions in the end that it lacks python2

$ sudo ln -s /bin/python3.9 /bin/python
[sudo] password for user: 
~/updates/coreboot$ make
Skipping submodule '3rdparty/amd_blobs'
Skipping submodule '3rdparty/blobs'
Skipping submodule '3rdparty/cmocka'
Skipping submodule '3rdparty/fsp'
Skipping submodule '3rdparty/intel-microcode'
Skipping submodule '3rdparty/qc_blobs'
    Checking out SeaBIOS revision 155821a1990b6de78dde5f98fa5ab90e802021e0
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Deleted branch coreboot (was ebd8e08).
Switched to a new branch 'coreboot'
Applying /home/user/updates/coreboot/payloads/external/SeaBIOS/patches/0001-make-bootsplash-sane.patch
Applying: make bootsplash sane
Applying /home/user/updates/coreboot/payloads/external/SeaBIOS/patches/0002-boot.c-don-t-exit-boot-menu-on-ESC.patch
Applying: boot.c: don't exit boot menu on 'ESC'
    CONFIG     SeaBIOS 155821a1990b6de78dde5f98fa5ab90e802021e0
#
# configuration written to /home/user/updates/coreboot/payloads/external/SeaBIOS/seabios/.config
#
    MAKE       SeaBIOS 155821a1990b6de78dde5f98fa5ab90e802021e0
  Build Kconfig config file
  Compile checking out/src/misc.o
  Compile checking out/src/stacks.o
  Compile checking out/src/output.o
  Compile checking out/src/string.o
  Compile checking out/src/block.o
  Compile checking out/src/cdrom.o
  Compile checking out/src/disk.o
  Compile checking out/src/mouse.o
  Compile checking out/src/kbd.o
  Compile checking out/src/system.o
  Compile checking out/src/serial.o
  Compile checking out/src/sercon.o
  Compile checking out/src/clock.o
  Compile checking out/src/resume.o
  Compile checking out/src/pnpbios.o
  Compile checking out/src/vgahooks.o
  Compile checking out/src/pcibios.o
  Compile checking out/src/apm.o
  Compile checking out/src/cp437.o
  Compile checking out/src/hw/pci.o
  Compile checking out/src/hw/timer.o
  Compile checking out/src/hw/rtc.o
  Compile checking out/src/hw/dma.o
  Compile checking out/src/hw/pic.o
  Compile checking out/src/hw/ps2port.o
  Compile checking out/src/hw/serialio.o
  Compile checking out/src/hw/usb.o
  Compile checking out/src/hw/usb-uhci.o
  Compile checking out/src/hw/usb-ohci.o
  Compile checking out/src/hw/usb-ehci.o
  Compile checking out/src/hw/usb-hid.o
  Compile checking out/src/hw/usb-msc.o
  Compile checking out/src/hw/usb-uas.o
  Compile checking out/src/hw/blockcmd.o
  Compile checking out/src/hw/floppy.o
  Compile checking out/src/hw/ata.o
  Compile checking out/src/hw/ramdisk.o
  Compile checking out/src/hw/lsi-scsi.o
  Compile checking out/src/hw/esp-scsi.o
  Compile checking out/src/hw/megasas.o
  Compile checking out/src/hw/mpt-scsi.o
  Compile checking out/src/post.o
  Compile checking out/src/e820map.o
  Compile checking out/src/malloc.o
  Compile checking out/src/romfile.o
  Compile checking out/src/x86.o
  Compile checking out/src/optionroms.o
  Compile checking out/src/pmm.o
  Compile checking out/src/font.o
  Compile checking out/src/boot.o
  Compile checking out/src/bootsplash.o
  Compile checking out/src/jpeg.o
  Compile checking out/src/bmp.o
  Compile checking out/src/tcgbios.o
  Compile checking out/src/sha1.o
  Compile checking out/src/hw/pcidevice.o
  Compile checking out/src/hw/ahci.o
  Compile checking out/src/hw/pvscsi.o
  Compile checking out/src/hw/usb-xhci.o
  Compile checking out/src/hw/usb-hub.o
  Compile checking out/src/hw/sdcard.o
  Compile checking out/src/fw/coreboot.o
  Compile checking out/src/fw/lzmadecode.o
  Compile checking out/src/fw/multiboot.o
  Compile checking out/src/fw/csm.o
  Compile checking out/src/fw/biostables.o
  Compile checking out/src/fw/paravirt.o
  Compile checking out/src/fw/shadow.o
  Compile checking out/src/fw/pciinit.o
  Compile checking out/src/fw/smm.o
  Compile checking out/src/fw/smp.o
  Compile checking out/src/fw/mtrr.o
  Compile checking out/src/fw/xen.o
  Compile checking out/src/fw/acpi.o
  Compile checking out/src/fw/mptable.o
  Compile checking out/src/fw/pirtable.o
  Compile checking out/src/fw/smbios.o
  Compile checking out/src/fw/romfile_loader.o
  Compile checking out/src/fw/dsdt_parser.o
  Compile checking out/src/hw/virtio-ring.o
  Compile checking out/src/hw/virtio-pci.o
  Compile checking out/src/hw/virtio-mmio.o
  Compile checking out/src/hw/virtio-blk.o
  Compile checking out/src/hw/virtio-scsi.o
  Compile checking out/src/hw/tpm_drivers.o
  Compile checking out/src/hw/nvme.o
  Compiling whole program out/ccode32flat.o
  Compiling whole program out/code32seg.o
  Compiling whole program out/ccode16.o
  Compiling to assembler out/src/asm-offsets.s
  Generating offset file out/asm-offsets.h
  Compiling (16bit) out/romlayout.o
  Building ld scripts
Version: rel-1.14.0-2-gebd8e08
Fixed space: 0xe05b-0x10000  total: 8101  slack: 14  Percent slack: 0.2%
16bit size:           35872
32bit segmented size: 1699
32bit flat size:      32237
32bit flat init size: 53920
Lowmem size:          2240
f-segment var size:   1392
  Linking out/rom16.o
  Stripping out/rom16.noexec.o
  Linking out/rom32seg.o
  Stripping out/rom32seg.noexec.o
  Linking out/rom.o
  Prepping out/bios.bin.prep
Total size: 131008  Fixed: 71200  Free: 64 (used 100.0% of 128KiB rom)
  Creating out/bios.bin.elf
  Compile checking out/vgasrc/vgainit.o
  Compile checking out/vgasrc/vgabios.o
  Compile checking out/vgasrc/vgafb.o
  Compile checking out/vgasrc/swcursor.o
  Compile checking out/vgasrc/vgafonts.o
  Compile checking out/vgasrc/vbe.o
  Compile checking out/vgasrc/stdvga.o
  Compile checking out/vgasrc/stdvgamodes.o
  Compile checking out/vgasrc/stdvgaio.o
  Compile checking out/vgasrc/clext.o
  Compile checking out/vgasrc/svgamodes.o
  Compile checking out/vgasrc/atiext.o
  Compile checking out/vgasrc/bochsvga.o
  Compile checking out/vgasrc/geodevga.o
  Compile checking out/vgasrc/cbvga.o
  Compile checking out/vgasrc/bochsdisplay.o
  Compile checking out/vgasrc/ramfb.o
  Compiling whole program out/vgaccode16.raw.s
  Fixup VGA rom assembler
  Compiling (16bit) out/vgaentry.o
  Precompiling out/vgasrc/vgalayout.lds
  Linking out/vgarom.o
Version: rel-1.14.0-2-gebd8e08
  Extracting binary out/vgabios.bin.raw
  Finalizing rom out/vgabios.bin
    CREATE     build/mainboard/purism/librem_cnl/cbfs-file.Q4KNOL.out (from /home/user/updates/coreboot/.config)
    IASL       build/dsdt.aml

Intel ACPI Component Architecture
ASL+ Optimizing Compiler/Disassembler version 20200925
Copyright (c) 2000 - 2020 Intel Corporation

coreboot toolchain v2021-04-06_7014f8258e
dsdt.asl    144:  Name (MCRS, ResourceTemplate ()
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0._CRS)

dsdt.asl    277:   Name (BUF0, ResourceTemplate ()
Remark   2173 -            ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.PDRC._CRS)

dsdt.asl    398:  OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.PCRR)

dsdt.asl    407:  OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.PCRA)

dsdt.asl    417:  OperationRegion (PCRD, SystemMemory, PCRB (Arg0) + Arg1, 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.PCRO)

dsdt.asl    548:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.GRXS)

dsdt.asl    558:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.GTXS)

dsdt.asl    568:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.STXS)

dsdt.asl    577:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.CTXS)

dsdt.asl    586:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.GPMO)

dsdt.asl    597:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.GTXE)

dsdt.asl    610:  OperationRegion (PREG, SystemMemory, GADD (Arg0), 4)
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.GRXE)

dsdt.asl    895:  Name (IQAA, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    900:  Name (IQAP, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    905:  Name (IQBA, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    910:  Name (IQBP, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    915:  Name (IQCA, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    920:  Name (IQCP, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    925:  Name (IQDA, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl    930:  Name (IQDP, Package () {
Remark   2173 -           ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.IRQM)

dsdt.asl   1274:  OperationRegion (PSCR, SystemMemory,
Remark   2173 -                      ^ Creation of named objects within a method is highly inefficient, use globals or method local variables instead (\_SB.PCI0.UPWE)

ASL Input:     dsdt.asl -   45156 bytes   1342 keywords   2321 source lines
AML Output:    dsdt.aml -   14541 bytes    815 opcodes     527 named objects

Compilation successful. 0 Errors, 0 Warnings, 21 Remarks, 471 Optimizations, 53 Constants Folded
    IASL       3150 2158 warning types were ignored!
    IASL       build/dsdt.aml disassembled correctly.
/bin/sh: 1: python2: not found
make: *** [src/drivers/intel/fsp2_0/Makefile.inc:79: build/Fsp_M.fd] Error 127

So changing that python2 to python3 seems to work fine:

make
Skipping submodule '3rdparty/amd_blobs'
Skipping submodule '3rdparty/blobs'
Skipping submodule '3rdparty/cmocka'
Skipping submodule '3rdparty/fsp'
Skipping submodule '3rdparty/intel-microcode'
Skipping submodule '3rdparty/qc_blobs'
    GEN        build.h
    CC         bootblock/arch/x86/id.o
    CC         bootblock/lib/version.o
    LINK       cbfs/fallback/bootblock.debug
    OBJCOPY    cbfs/fallback/bootblock.elf
    OBJCOPY    bootblock.raw.elf
    OBJCOPY    bootblock.raw.bin
    CC         romstage/lib/version.o
    LINK       cbfs/fallback/romstage.debug
    OBJCOPY    cbfs/fallback/romstage.elf
    CC         ramstage/lib/version.o
    CC         smm/lib/version.o
    OBJCOPY    ramstage/cpu/x86/smm/smm.manual
    CC         generated/ramstage.o
    CC         cbfs/fallback/ramstage.debug
    CREATE     build/mainboard/purism/librem_cnl/cbfs-file.p4JV7T.out (from /home/user/updates/coreboot/.config)
Create FSP component file 'build/Fsp_S.fd'
Create FSP component file 'build/Fsp_M.fd'
Create FSP component file 'build/Fsp_T.fd'
    MICROCODE  cpu_microcode_blob.bin
3rdparty/purism-blobs/mainboard/purism/librem_cnl/cpu_microcode_blob.bin
    CC         postcar/mainboard/purism/librem_cnl/static.o
    CC         postcar/acpi/acpi_pm.o
    CC         postcar/arch/x86/boot.o
    CC         postcar/arch/x86/cf9_reset.o
    CC         postcar/arch/x86/cpu_common.o
    CC         postcar/arch/x86/exception.o
    CC         postcar/arch/x86/exit_car.o
    CC         postcar/arch/x86/gdt_init.o
    CC         postcar/arch/x86/idt.o
    CC         postcar/arch/x86/memcpy.o
    CP         postcar/arch/x86/memlayout.ld
    CC         postcar/arch/x86/memmove.o
    CC         postcar/arch/x86/memset.o
    CC         postcar/arch/x86/mmap_boot.o
    CC         postcar/arch/x86/post.o
    CC         postcar/arch/x86/postcar.o
    CC         postcar/arch/x86/timestamp.o
    CC         postcar/commonlib/bsd/cbfs_mcache.o
    CC         postcar/commonlib/bsd/cbfs_private.o
    CC         postcar/commonlib/bsd/lz4_wrapper.o
    CC         postcar/commonlib/cbfs.o
    CC         postcar/commonlib/iobuf.o
    CC         postcar/commonlib/mem_pool.o
    CC         postcar/commonlib/region.o
    CC         postcar/console/console.o
    CC         postcar/console/die.o
    CC         postcar/console/init.o
    CC         postcar/console/post.o
    CC         postcar/console/printk.o
    CC         postcar/console/vsprintf.o
    CC         postcar/console/vtxprintf.o
    CC         postcar/cpu/x86/lapic/boot_cpu.o
    CC         postcar/cpu/x86/mtrr/debug.o
    CC         postcar/cpu/x86/pae/pgtbl.o
    CC         postcar/cpu/x86/smm/tseg_region.o
    CC         postcar/cpu/x86/tsc/delay_tsc.o
    CC         postcar/device/device_const.o
    CC         postcar/device/pci_early.o
    CC         postcar/device/pci_ops.o
    CC         postcar/drivers/i2c/designware/dw_i2c.o
    CC         postcar/drivers/intel/fsp2_0/hand_off_block.o
    CC         postcar/drivers/pc80/pc/i8254.o
    CC         postcar/drivers/pc80/rtc/mc146818rtc.o
    CC         postcar/drivers/pc80/rtc/mc146818rtc_boot.o
    CC         postcar/drivers/pc80/tpm/tis.o
    CC         postcar/drivers/spi/bitbang.o
    CC         postcar/drivers/spi/boot_device_rw_nommap.o
    CC         postcar/drivers/spi/spi-generic.o
    CC         postcar/drivers/spi/spi_flash.o
    CC         postcar/ec/purism/librem-ec/librem_ec.o
    CC         postcar/lib/boot_device.o
    CC         postcar/lib/bootmode.o
    CC         postcar/lib/cbfs.o
    CC         postcar/lib/cbmem_common.o
    CC         postcar/lib/cbmem_console.o
    CC         postcar/lib/crc_byte.o
    CC         postcar/lib/delay.o
    CC         postcar/lib/ext_stage_cache.o
    CC         postcar/lib/fmap.o
    CC         postcar/lib/gcc.o
    CC         postcar/lib/halt.o
    CC         postcar/lib/hexdump.o
    CC         postcar/lib/imd.o
    CC         postcar/lib/imd_cbmem.o
    CC         postcar/lib/libgcc.o
    CC         postcar/lib/lzma.o
    CC         postcar/lib/lzmadecode.o
    CC         postcar/lib/memchr.o
    CC         postcar/lib/memcmp.o
    CC         postcar/lib/prog_loaders.o
    CC         postcar/lib/prog_ops.o
    CP         postcar/lib/program.ld
    CC         postcar/lib/reset.o
    CC         postcar/lib/rmodule.o
    CC         postcar/lib/romstage_handoff.o
    CC         postcar/lib/string.o
    CC         postcar/lib/timestamp.o
    CC         postcar/lib/version.o
    CC         postcar/security/memory/memory.o
    CC         postcar/security/tpm/tspi/tspi.o
    CC         postcar/security/tpm/tss/tcg-1.2/tss.o
    CC         postcar/soc/intel/cannonlake/gspi.o
    CC         postcar/soc/intel/cannonlake/i2c.o
    CC         postcar/soc/intel/cannonlake/pmutil.o
    CC         postcar/soc/intel/cannonlake/spi.o
    CC         postcar/soc/intel/cannonlake/uart.o
    CC         postcar/soc/intel/common/block/chip/chip.o
    CC         postcar/soc/intel/common/block/cpu/car/exit_car.o
    CC         postcar/soc/intel/common/block/fast_spi/fast_spi.o
    CC         postcar/soc/intel/common/block/fast_spi/fast_spi_flash.o
    CC         postcar/soc/intel/common/block/gspi/gspi.o
    CC         postcar/soc/intel/common/block/i2c/i2c.o
    CC         postcar/soc/intel/common/block/lpss/lpss.o
    CC         postcar/soc/intel/common/block/pmc/pmclib.o
    CC         postcar/soc/intel/common/block/smbus/tco.o
    CC         postcar/soc/intel/common/block/smm/smm.o
    CC         postcar/soc/intel/common/block/spi/spi.o
    CC         postcar/soc/intel/common/block/systemagent/memmap.o
    CC         postcar/soc/intel/common/block/systemagent/systemagent_early.o
    CC         postcar/soc/intel/common/block/timer/timer.o
    CC         postcar/soc/intel/common/block/uart/uart.o
    CC         postcar/soc/intel/common/reset.o
    LINK       cbfs/fallback/postcar.debug
#
# configuration written to /home/user/updates/coreboot/payloads/coreinfo/.config
#
#
# configuration written to /home/user/updates/coreboot/payloads/coreinfo/.config
#
*** Default configuration is based on '/home/user/updates/coreboot/payloads/coreinfo/../libpayload/configs/defconfig-tinycurses'
#
# configuration written to /home/user/updates/coreboot/payloads/coreinfo/.lp.config
#
#
# configuration written to /home/user/updates/coreboot/payloads/coreinfo/.lp.config
#
    LPGCC      cpuinfo_module.o
    LPAS       cpuid.S.o
    LPGCC      pci_module.o
    LPGCC      coreboot_module.o
    LPGCC      nvram_module.o
    LPGCC      bootlog_module.o
    LPGCC      ramdump_module.o
    LPGCC      multiboot_module.o
    LPGCC      cbfs_module.o
    LPGCC      timestamps_module.o
    LPGCC      coreinfo.o
    CC         libpci/libpci.libpci.o
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/libpci.a
    CC         arch/x86/main.libc.o
    CC         arch/x86/sysinfo.libc.o
    CC         arch/x86/timer.libc.o
    CC         arch/x86/coreboot.libc.o
    CC         arch/x86/util.libc.o
    CC         arch/x86/exec.libc.o
    CC         arch/x86/virtual.libc.o
    CC         arch/x86/selfboot.libc.o
    CC         arch/x86/exception_asm.libc.o
    CC         arch/x86/exception.libc.o
    CC         arch/x86/delay.libc.o
    CC         crypto/sha1.libc.o
    CC         libc/malloc.libc.o
    CC         libc/printf.libc.o
    CC         libc/console.libc.o
    CC         libc/string.libc.o
    CC         libc/memory.libc.o
    CC         libc/ctype.libc.o
    CC         libc/ipchecksum.libc.o
    CC         libc/lib.libc.o
    CC         libc/libgcc.libc.o
    CC         libc/rand.libc.o
    CC         libc/time.libc.o
    CC         libc/exec.libc.o
    CC         libc/readline.libc.o
    CC         libc/getopt_long.libc.o
    CC         libc/sysinfo.libc.o
    CC         libc/args.libc.o
    CC         libc/strlcpy.libc.o
    CC         libc/qsort.libc.o
    CC         libc/hexdump.libc.o
    CC         libc/die.libc.o
    CC         libc/coreboot.libc.o
    CC         libc/fmap.libc.o
    CC         libc/fpmath.libc.o
    CC         drivers/pci.libc.o
    CC         drivers/speaker.libc.o
    CC         drivers/serial/8250.libc.o
    CC         drivers/serial/serial.libc.o
    CC         drivers/i8042/keyboard.libc.o
    CC         drivers/i8042/mouse.libc.o
    CC         drivers/i8042/i8042.libc.o
    CC         drivers/cbmem_console.libc.o
    CC         drivers/mouse_cursor.libc.o
    CC         drivers/nvram.libc.o
    CC         drivers/options.libc.o
    CC         drivers/timer/rdtsc.libc.o
    CC         drivers/video/video.libc.o
    CC         drivers/video/vga.libc.o
    CC         drivers/video/corebootfb.libc.o
    CC         drivers/video/font8x16.libc.o
    CC         drivers/video/font.libc.o
    CC         drivers/video/graphics.libc.o
    CC         drivers/storage/storage.libc.o
    CC         drivers/storage/ahci.libc.o
    CC         drivers/storage/ahci_common.libc.o
    CC         drivers/storage/nvme.libc.o
    CC         drivers/storage/ata.libc.o
    CC         drivers/storage/ahci_ata.libc.o
    CC         drivers/storage/atapi.libc.o
    CC         drivers/storage/ahci_atapi.libc.o
    CC         drivers/usb/usbinit.libc.o
    CC         drivers/usb/usb.libc.o
    CC         drivers/usb/usb_dev.libc.o
    CC         drivers/usb/quirks.libc.o
    CC         drivers/usb/generic_hub.libc.o
    CC         drivers/usb/usbhub.libc.o
    CC         drivers/usb/uhci.libc.o
    CC         drivers/usb/uhci_rh.libc.o
    CC         drivers/usb/ohci.libc.o
    CC         drivers/usb/ohci_rh.libc.o
    CC         drivers/usb/ehci.libc.o
    CC         drivers/usb/ehci_rh.libc.o
    CC         drivers/usb/xhci.libc.o
    CC         drivers/usb/xhci_debug.libc.o
    CC         drivers/usb/xhci_devconf.libc.o
    CC         drivers/usb/xhci_events.libc.o
    CC         drivers/usb/xhci_commands.libc.o
    CC         drivers/usb/xhci_rh.libc.o
    CC         drivers/usb/usbhid.libc.o
    CC         drivers/usb/usbmsc.libc.o
    CC         drivers/hid.libc.o
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/libc.a
    CC         curses/keyboard.libcurses.o
    CC         curses/tinycurses.libcurses.o
    CC         curses/colors.libcurses.o
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/libcurses.a
    CC         arch/x86/rom_media.libcbfs.o
    CC         libcbfs/cbfs.libcbfs.o
    CC         libcbfs/ram_media.libcbfs.o
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/libcbfs.a
    CC         liblzma/lzma.liblzma.o
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/liblzma.a
    CC         liblz4/lz4_wrapper.liblz4.o
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/liblz4.a
    AR         /home/user/updates/coreboot/payloads/coreinfo/libpayload/libpayload.a
    CC         arch/x86/head.head.o.o
    CP         /home/user/updates/coreboot/payloads/coreinfo/libpayload/head.o
    LPGCC      coreinfo.bin
    DEBUG      coreinfo.debug
    STRIP      coreinfo.elf
    CC+STRIP   src/cpu/intel/fit/fit_table.c
    HOSTCC     cbfstool/cbfstool.o
    HOSTCC     cbfstool/cbfs_image.o
    HOSTCC     cbfstool/cbfs-mkstage.o
    HOSTCC     cbfstool/cbfs-mkpayload.o
    HOSTCC     cbfstool/partitioned_file.o
    HOSTCC     cbfstool/platform_fixups.o
    HOSTCC     cbfstool/cbfs_private.o
    HOSTCC     cbfstool/fsp_relocate.o
    HOSTCC     cbfstool/linux_trampoline.o
    HOSTCC     cbfstool/cbfs-payload-linux.o
    HOSTCC     cbfstool/compress.o
    HOSTCC     cbfstool/lz4.o
    HOSTCC     cbfstool/lz4hc.o
    HOSTCC     cbfstool/lz4frame.o
    HOSTCC     cbfstool/xxhash.o
    HOSTCC     cbfstool/lz4_wrapper.o
    HOSTCC     cbfstool/lzma.o
    HOSTCC     cbfstool/LzFind.o
    HOSTCC     cbfstool/LzmaDec.o
    HOSTCC     cbfstool/LzmaEnc.o
    MAKE       /home/user/updates/coreboot/vboot_lib/libvboot_host.a
vboot SHA256 built with tight loops (slower, smaller code size)
    CC            cgpt/cgpt_add.o
    CC            cgpt/cgpt_boot.o
    CC            cgpt/cgpt_common.o
    CC            cgpt/cgpt_create.o
    CC            cgpt/cgpt_edit.o
    CC            cgpt/cgpt_find.o
    CC            cgpt/cgpt_prioritize.o
    CC            cgpt/cgpt_show.o
    CC            firmware/2lib/2common.o
    CC            firmware/2lib/2context.o
    CC            firmware/2lib/2crc8.o
    CC            firmware/2lib/2crypto.o
    CC            firmware/2lib/2hmac.o
    CC            firmware/2lib/2kernel.o
    CC            firmware/2lib/2nvstorage.o
    CC            firmware/2lib/2recovery_reasons.o
    CC            firmware/2lib/2rsa.o
    CC            firmware/2lib/2sha1.o
    CC            firmware/2lib/2sha256.o
    CC            firmware/2lib/2sha512.o
    CC            firmware/2lib/2sha_utility.o
    CC            firmware/2lib/2stub.o
    CC            firmware/2lib/2stub_hwcrypto.o
    CC            firmware/lib/cgptlib/cgptlib_internal.o
    CC            firmware/lib/cgptlib/crc32.o
    CC            firmware/lib/gpt_misc.o
    CC            firmware/stub/tpm_lite_stub.o
    CC            firmware/stub/vboot_api_stub.o
    CC            firmware/stub/vboot_api_stub_disk.o
    CC            futility/dump_kernel_config_lib.o
    CC            host/arch/x86_64/lib/crossystem_arch.o
    CC            host/lib/chromeos_config.o
    CC            host/lib/crossystem.o
    CC            host/lib/crypto.o
    CC            host/lib/extract_vmlinuz.o
    CC            host/lib/flashrom.o
    CC            host/lib/fmap.o
    CC            host/lib/host_misc.o
    CC            host/lib/subprocess.o
    CC            host/lib21/host_misc.o
    CC            firmware/lib/tpm_lite/tlcl.o
    RM            libvboot_host.a
    AR            libvboot_host.a
    HOSTCC     cbfstool/cbfstool (link)
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6) 
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/10/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'build/util/cbfstool/cbfstool' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/10/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/10/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper -plugin-opt=-fresolution=/tmp/ccBOn8Xl.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -o build/util/cbfstool/cbfstool /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. build/util/cbfstool/cbfstool.o build/util/cbfstool/common.o build/util/cbfstool/cbfs_image.o build/util/cbfstool/cbfs-mkstage.o build/util/cbfstool/cbfs-mkpayload.o build/util/cbfstool/elfheaders.o build/util/cbfstool/rmodule.o build/util/cbfstool/xdr.o build/util/cbfstool/partitioned_file.o build/util/cbfstool/platform_fixups.o build/util/cbfstool/cbfs_private.o build/util/cbfstool/fsp_relocate.o build/util/cbfstool/fmap.o build/util/cbfstool/kv_pair.o build/util/cbfstool/valstr.o build/util/cbfstool/linux_trampoline.o build/util/cbfstool/cbfs-payload-linux.o build/util/cbfstool/compress.o build/util/cbfstool/lz4.o build/util/cbfstool/lz4hc.o build/util/cbfstool/lz4frame.o build/util/cbfstool/xxhash.o build/util/cbfstool/lz4_wrapper.o build/util/cbfstool/lzma.o build/util/cbfstool/LzFind.o build/util/cbfstool/LzmaDec.o build/util/cbfstool/LzmaEnc.o /home/user/updates/coreboot/build/util/vboot_lib/libvboot_host.a -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld: /home/user/updates/coreboot/build/util/vboot_lib/libvboot_host.a(2crypto.o): warning: relocation in read-only section `.rodata.vb2_sig_names'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
COLLECT_GCC_OPTIONS='-v' '-o' 'build/util/cbfstool/cbfstool' '-mtune=generic' '-march=x86-64'
    HOSTCC     cbfstool/ifittool.o
    HOSTCC     cbfstool/fit.o
    HOSTCC     cbfstool/ifittool (link)
/usr/bin/ld: /home/user/updates/coreboot/build/util/vboot_lib/libvboot_host.a(2crypto.o): warning: relocation in read-only section `.rodata.vb2_sig_names'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
Created CBFS (capacity = 9367012 bytes)
    CBFS       fallback/romstage
    CBFS       cpu_microcode_blob.bin
    CBFS       intel_fit
    CBFS       fallback/ramstage
    CBFS       vgaroms/seavgabios.bin
    CBFS       config
    CBFS       revision
    CBFS       build_info
    CBFS       bootsplash.jpg
    CBFS       fallback/dsdt.aml
    CBFS       fspm.bin
    CBFS       fsps.bin
    CBFS       vbt.bin
    CBFS       fallback/postcar
    CBFS       img/coreinfo
    CBFS       fallback/payload
    CBFS       payload_config
    CBFS       payload_revision
   IFDTOOL
    DD         Adding Intel Firmware Descriptor
    IFDTOOL    me.bin -> coreboot.pre
Platform is: cnl
File build/coreboot.pre is 16777216 bytes
File 3rdparty/purism-blobs/mainboard/purism/librem_cnl/librem_14/me.bin is 3145728 bytes
Adding 3rdparty/purism-blobs/mainboard/purism/librem_cnl/librem_14/me.bin as the Intel ME section of build/coreboot.pre
Writing new image to build/coreboot.pre
    IFDTOOL    Unlocking Management Engine
Platform is: cnl
File build/coreboot.pre is 16777216 bytes
Writing new image to build/coreboot.pre
    UPDATE-FIT set FIT pointer to table
    UPDATE-FIT Microcode
    CBFS       coreboot.rom

    FIT table:
    Index  Type                 Addr             Size    
         0 Microcode            0xff7202f0      0x00000000
         1 Microcode            0xff739af0      0x00000000
         2 Microcode            0xff7532f0      0x00000000

    CBFSLAYOUT  coreboot.rom

This image contains the following sections that can be manipulated with this tool:

'RW_MRC_CACHE' (size 65536, offset 7340032)
'RW_SPD_CACHE' (size 4096, offset 7405568)
'COREBOOT' (CBFS, size 9367040, offset 7410176)

It is possible to perform either the write action or the CBFS add/remove actions on every section listed above.
To see the image's read-only sections as well, rerun with the -w option.
    CBFSPRINT  coreboot.rom

FMAP REGION: COREBOOT
Name                           Offset     Type           Size   Comp
cbfs master header             0x0        cbfs header        32 none
fallback/romstage              0x80       stage           61368 none
cpu_microcode_blob.bin         0xf0c0     microcode      303104 none
intel_fit                      0x59100    raw                80 none
fallback/ramstage              0x59180    stage          119776 LZMA (274656 decompressed)
vgaroms/seavgabios.bin         0x765c0    raw             28160 none
config                         0x7d400    raw               765 none
revision                       0x7d740    raw               735 none
build_info                     0x7da80    raw                96 none
bootsplash.jpg                 0x7db40    bootsplash      14565 none
fallback/dsdt.aml              0x81480    raw             14541 none
(empty)                        0x84d80    null               36 none
fspm.bin                       0x84dc0    fsp            581632 none
vbt.bin                        0x112e00   raw              1182 LZMA (4608 decompressed)
payload_config                 0x113300   raw              1728 none
payload_revision               0x113a00   raw               237 none
(empty)                        0x113b40   null              612 none
fsps.bin                       0x113dc0   fsp            190559 LZMA (212992 decompressed)
fallback/postcar               0x142680   stage           19496 none
img/coreinfo                   0x147300   simple elf      54548 none
fallback/payload               0x154840   simple elf      69152 none
(empty)                        0x1656c0   null          7882212 none
bootblock                      0x8e9cc0   bootblock       20704 none
    HOSTCC     cbfstool/ifwitool.o
    HOSTCC     cbfstool/ifwitool (link)

Built purism/librem_cnl (Librem 14)

Then when I run the build with the coreboot_util.sh script, it says the build does not produce the reproducible build hash. Is that expected?

WARNING: Built coreboot image hash does not match expected reproducible build hash
Built: 4bd7...
Expected: 7b4621e5d0e5abb18bdb55a9692ee20e98d9e98a6db59e993d90856acbc2f0ff

For anyone having the same issue, the following steps will result in a build that matches the reproducible build.

  1. Install Python2.7
    sudo apt install python2
  2. Link the python2 library to python
    sudo ln -s /bin/python2.7 /bin/python
  3. Build coreboot with the coreboot_util.sh script
    sudo bash coreboot_util.sh

Optionally, you can remove the dependencies added to the system for the building process after building and flashing coreboot.

  • Remove the symbolic link from python to python2.7
    sudo rm /bin/python
  • remove Python2 from the system.
    sudo apt remove --autoremove python2
1 Like

Just for the record i got this tiny issue today, i fixed by installing: python-is-python3

Purism

@carlosgonz What OS was that, and what version of coreboot_util.sh was it? (Approximate date when you downloaded, or value of RELEASES_GIT_HASH in the file, or sha256sum of the file would tell me.)

That should have been fixed by this chunk of code that went into 4.20.1-Purism-1 / PureBoot 27: Update coreboot/SeaBIOS images to 4.20.1-Purism-1/RC1 (150bc8a6) · Commits · firmware / utility · GitLab

1 Like