mirror of
https://github.com/ipxe/ipxe
synced 2026-02-03 06:34:32 +03:00
[gzip] Add support for gzip archive images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -303,6 +303,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#define ERRFILE_pem ( ERRFILE_IMAGE | 0x00090000 )
|
||||
#define ERRFILE_archive ( ERRFILE_IMAGE | 0x000a0000 )
|
||||
#define ERRFILE_zlib ( ERRFILE_IMAGE | 0x000b0000 )
|
||||
#define ERRFILE_gzip ( ERRFILE_IMAGE | 0x000c0000 )
|
||||
|
||||
#define ERRFILE_asn1 ( ERRFILE_OTHER | 0x00000000 )
|
||||
#define ERRFILE_chap ( ERRFILE_OTHER | 0x00010000 )
|
||||
|
||||
71
src/include/ipxe/gzip.h
Normal file
71
src/include/ipxe/gzip.h
Normal file
@@ -0,0 +1,71 @@
|
||||
#ifndef _IPXE_GZIP_H
|
||||
#define _IPXE_GZIP_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* gzip compressed images
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ipxe/image.h>
|
||||
|
||||
/** gzip header */
|
||||
struct gzip_header {
|
||||
/** Magic ID */
|
||||
uint16_t magic;
|
||||
/** Compression method */
|
||||
uint8_t method;
|
||||
/** Flags */
|
||||
uint8_t flags;
|
||||
/** Modification time */
|
||||
uint32_t mtime;
|
||||
/** Extra flags */
|
||||
uint8_t extra;
|
||||
/** Operating system */
|
||||
uint8_t os;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** Magic ID */
|
||||
#define GZIP_MAGIC 0x1f8b
|
||||
|
||||
/** Compression method */
|
||||
#define GZIP_METHOD_DEFLATE 0x08
|
||||
|
||||
/** CRC header is present */
|
||||
#define GZIP_FL_HCRC 0x02
|
||||
|
||||
/** Extra header is present */
|
||||
#define GZIP_FL_EXTRA 0x04
|
||||
|
||||
/** File name is present */
|
||||
#define GZIP_FL_NAME 0x08
|
||||
|
||||
/** File comment is present */
|
||||
#define GZIP_FL_COMMENT 0x10
|
||||
|
||||
/** gzip extra header */
|
||||
struct gzip_extra_header {
|
||||
/** Extra header length (excluding this field) */
|
||||
uint16_t len;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** gzip CRC header */
|
||||
struct gzip_crc_header {
|
||||
/** CRC-16 */
|
||||
uint16_t crc;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** gzip footer */
|
||||
struct gzip_footer {
|
||||
/** CRC-32 */
|
||||
uint32_t crc;
|
||||
/** Uncompressed size (modulo 2^32) */
|
||||
uint32_t len;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
extern struct image_type gzip_image_type __image_type ( PROBE_NORMAL );
|
||||
|
||||
#endif /* _IPXE_GZIP_H */
|
||||
Reference in New Issue
Block a user