68 len -=
sizeof ( *footer );
74 data +=
sizeof ( *header );
75 len -=
sizeof ( *header );
80 DBGC (
image,
"GZIP %s overlength extra header\n",
85 data +=
sizeof ( *extra );
86 len -=
sizeof ( *extra );
88 if (
len < extra_len ) {
89 DBGC (
image,
"GZIP %s overlength extra header\n",
103 while ( strings-- ) {
105 if ( string_len ==
len ) {
106 DBGC (
image,
"GZIP %s overlength name/comment\n",
110 data += ( string_len + 1 );
111 len -= ( string_len + 1 );
116 if (
len <
sizeof ( *
crc ) ) {
117 DBGC (
image,
"GZIP %s overlength CRC header\n",
121 data +=
sizeof ( *crc );
122 len -=
sizeof ( *crc );
128 DBGC (
image,
"GZIP %s could not presize: %s\n",
135 extracted ) ) != 0 ) {
136 DBGC (
image,
"GZIP %s could not decompress: %s\n",
struct arbelprm_rc_send_wqe rc
int image_extract_exec(struct image *image)
Extract and execute image.
#define assert(condition)
Assert a condition at run-time.
DEFLATE decompression algorithm.
@ DEFLATE_RAW
Raw DEFLATE data (no header or footer)
uint8_t data[48]
Additional event data.
struct ena_llq_option header
Header locations.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ENOEXEC
Exec format error.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
static int gzip_extract(struct image *image, struct image *extracted)
Extract gzip image.
static int gzip_probe(struct image *image)
Probe gzip image.
#define GZIP_FL_EXTRA
Extra header is present.
#define GZIP_FL_HCRC
CRC header is present.
#define GZIP_FL_COMMENT
File comment is present.
#define GZIP_FL_NAME
File name is present.
#define GZIP_MAGIC
Magic ID.
int image_set_len(struct image *image, size_t len)
Set image length.
#define PROBE_NORMAL
Normal image probe priority.
#define __image_type(probe_order)
An executable image type.
#define cpu_to_be16(value)
#define le16_to_cpu(value)
#define le32_to_cpu(value)
uint8_t extra
Signature extra byte.
char * strerror(int errno)
Retrieve string representation of error number.
size_t strnlen(const char *src, size_t max)
Get length of string.
An executable image type.
const void * data
Read-only data.
size_t len
Length of raw file image.
int zlib_deflate(enum deflate_format format, const void *data, size_t len, struct image *extracted)
Extract compressed data to image.