Skip to content

Bootloader is no longer building in 2022 #5

@dns13

Description

@dns13

Building the bootloader is failing in do_boot_tail because the generated checksum for years >= 2022 is to big to be represented as unsigned int.

DEBUG: Executing python function do_boot_tail
NOTE: Calculating boot tail given V: US02HSXXB00000000
ERROR: Error executing a python function in /public/Work/build/../git/meta-exor-us02/recipes-bsp/bootloader/bootloader_git.bb:

The stack trace of python calls that resulted in this exception/failure was:
File: 'do_boot_tail', lineno: 82, function: <module>
     0078:        finally:
     0079:            loaderfile.close()
     0080:
     0081:
 *** 0082:do_boot_tail(d)
     0083:
File: 'do_boot_tail', lineno: 42, function: do_boot_tail
     0038:    for i in range(0,len(s)/4):
     0039:        chksum += struct.unpack('I', s[i*4:i*4+4])[0]
     0040:
     0041:    # append checksum to header and it's ready
 *** 0042:    s += struct.pack('I', chksum)
     0043:
     0044:    hexs = binascii.hexlify(s)
     0045:    bb.note("tail (hex): %s" % hexs)
     0046:
Exception: error: 'I' format requires 0 <= number <= 4294967295

DEBUG: Python function do_boot_tail finished
ERROR: Function failed: do_boot_tail

This is working fine, if today.year in exorint-boottail.bbclass is 2021, but no longer for 2022 as the chksum is exceeding the four byte integer size.

I've "fixed" this by giving it another 20 years to overflow again by changing line 40 of exorint-boottail.bbclass from

chr(today.year-2000),

to

chr(today.year-2020),

This is working fine but raises the question what is this checksum for? Is it read anywhere? Why is there no hash function used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions