Skip to main content

Module media

Module media 

Expand description

Helpers for the on-flash UBI structures in ubi-media.h.

ConstantsΒ§

HEADER_CRC πŸ”’
Offset of the CRC in both headers. The CRC covers the bytes before it.
HEADER_SIZE πŸ”’
Size of the erase counter header and the volume identifier header.
MAX_VOLUMES πŸ”’
Number of user volumes. Internal volumes have IDs from super::LAYOUT_VOLUME_ID on.
VERSION πŸ”’
The only UBI version.

FunctionsΒ§

array πŸ”’
Returns N bytes at offset.
be_u32 πŸ”’
be_u64 πŸ”’
check_crc πŸ”’
Checks the CRC at offset against the bytes before it.
checked_header πŸ”’
Returns the first header of data after checking its magic number and its CRC, in the order of the kernel.
field πŸ”’
Returns a FormatError::Field.
flag πŸ”’
Converts a flag that must be 0 or 1.
is_erased πŸ”’
Returns whether all bytes are 0xFF, the value of erased flash.
non_negative πŸ”’
Returns value if the kernel, which reads it as a signed 32-bit integer, sees a value that isn’t negative.
put πŸ”’
Copies bytes into buffer at offset.
seal_header πŸ”’
Stores the magic number, the version and the CRC of a header.