SIMG

create_simg Create an SIMG version of a file.
get_simg_contents Returns the contents of this SIMG.
get_simg_header Returns the header of this SIMG.
has_simg Returns true if this string has an SIMG header.
valid_simg Return true if this is a valid SIMG.
SIMGHeader Container for an SIMG header.
create_simg(contents, priority=0, daddr=0, skip_crc32=False, align=False, version=None)[source]

Create an SIMG version of a file.

>>> from cxmanage_api.simg import create_simg
>>> simg = create_simg(contents='foobarbaz')
>>> simg
'SIMG\x02\x00\x00\x00<\x00\x00\x00\t\x00\x00\x00\x00\x00\x00
\x00\xff\xff\xff\xffK\xf3\xea\x0c\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00foobarbaz'
Parameters:
  • contents (string) – Contents of the SIMG file.
  • priority (integer) – SIMG Header priority value.
  • daddr (integer) – SIMG Header daddr value.
  • skip_crc32 (boolean) – Flag to skip crc32 calculating.
  • align (boolean) – Flag used to turn on/off image offset of 4096.
  • version (string) – Version string.
Returns:

String representation of the SIMG file.

Return type:

string

get_simg_contents(simg)[source]

Returns the contents of this SIMG.

>>> from cxmanage_api.simg import get_simg_contents
>>> get_simg_contents(simg=simg)
'foobarbaz'
Parameters:simg (string) – Path to SIMG file.
Returns:Contents of this SIMG.
Return type:string
get_simg_header(simg)[source]

Returns the header of this SIMG.

>>> from cxmanage_api.simg import get_simg_header
>>> get_simg_header(x)
<cxmanage_api.simg.SIMGHeader instance at 0x7f4d1ce9aef0>
Parameters:simg (string) – Path to SIMG file.
Returns:The SIMG header.
Return type:string
Raises ValueError:
 If the SIMG cannot be read.
has_simg(simg)[source]

Returns true if this string has an SIMG header.

>>> from cxmanage_api.simg import create_simg
>>> simg=create_simg(contents='foobarbaz')
>>> from cxmanage_api.simg import has_simg
>>> has_simg(simg=simg)
True
Parameters:simg (string) – SIMG string (representation of a SIMG file).
Returns:Whether or not the string has a SIMG header.
Return type:boolean
valid_simg(simg)[source]

Return true if this is a valid SIMG.

>>> from cxmanage_api.simg import create_simg
>>> simg=create_simg(contents='foobarbaz')
>>> from cxmanage_api.simg import valid_simg
>>> valid_simg(simg=simg)
True
Parameters:simg (string) – SIMG string (representation of a SIMG file).
Returns:Whether or not the SIMG is valid.
Return type:boolean
class SIMGHeader(header_string=None)[source]

Container for an SIMG header.

>>> from cxmanage_api.simg import SIMGHeader
>>> simg = SIMGHeader()
Parameters:header_string (string) – SIMG Header value.

Previous topic

Tftp

Next topic

U-Boot Environment