bl2/ext/mcuboot/scripts/imgtool_lib/image.py
def pad_to(self, size, align):
        """Pad the image to the given size, with the given flash alignment."""
        tsize = trailer_sizes[align]
        padding = size - (len(self.payload) + tsize)
        if padding < 0:
            msg = "Image size (0x{:x}) + trailer (0x{:x}) exceeds requested size 0x{:x}".format(
                    len(self.payload), tsize, size)
            raise Exception(msg)
        pbytes  = b'\xff' * padding
        pbytes += b'\xff' * (tsize - len(boot_magic))
        pbytes += boot_magic
        self.payload += pbytes
Pad the image to the given size, with the given flash alignment.
Pad the image to the given size, with the given flash alignment.
Pad the image to the given size with the given flash alignment .
def pad_to(self, size, align):
        tsize = trailer_sizes[align]
        padding = size - (len(self.payload) + tsize)
        if padding < 0:
            msg = "Image size (0x{:x}) + trailer (0x{:x}) exceeds requested size 0x{:x}".format(
                    len(self.payload), tsize, size)
            raise Exception(msg)
        pbytes  = b'\xff' * padding
        pbytes += b'\xff' * (tsize - len(boot_magic))
        pbytes += boot_magic
        self.payload += pbytes
def pad_to ( self , size , align ) : tsize = trailer_sizes [ align ] padding = size - ( len ( self . payload ) + tsize ) if padding < 0 : msg = "Image size (0x{:x}) + trailer (0x{:x}) exceeds requested size 0x{:x}" . format ( len ( self . payload ) , tsize , size ) raise Exception ( msg ) pbytes = b'\xff' * padding pbytes += b'\xff' * ( tsize - len ( boot_magic ) ) pbytes += boot_magic self . payload += pbytes
Pad the image to the given size, with the given flash alignment.
Pad the image to the given size with the given flash alignment .
"""Pad the image to the given size, with the given flash alignment."""
self
size
align