iPXE
|
CPIO archives. More...
#include <ipxe/image.h>
Go to the source code of this file.
Data Structures | |
struct | cpio_header |
A CPIO archive header. More... | |
Macros | |
#define | CPIO_MAGIC "070701" |
CPIO magic. More... | |
#define | CPIO_ALIGN 4 |
CPIO header length alignment. More... | |
#define | INITRD_ALIGN 4096 |
Alignment for CPIO archives within an initrd. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static const char * | cpio_name (struct image *image) |
Get CPIO image name. More... | |
void | cpio_set_field (char *field, unsigned long value) |
Set field within a CPIO header. More... | |
size_t | cpio_name_len (struct image *image) |
Get CPIO image filename. More... | |
size_t | cpio_header (struct image *image, struct cpio_header *cpio) |
Construct CPIO header for image, if applicable. More... | |
CPIO archives.
Definition in file cpio.h.
#define INITRD_ALIGN 4096 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Get CPIO image name.
image | Image |
name | Image name (not NUL terminated) |
Definition at line 66 of file cpio.h.
References image::cmdline.
Referenced by bzimage_load_initrd(), cpio_name_len(), and efi_file_read_initrd().
void cpio_set_field | ( | char * | field, |
unsigned long | value | ||
) |
Set field within a CPIO header.
field | Field within CPIO header |
value | Value to set |
Definition at line 43 of file cpio.c.
References memcpy(), snprintf(), and value.
Referenced by cpio_header(), and cpio_parse_cmdline().
Get CPIO image filename.
image | Image |
len | CPIO filename length (0 for no filename) |
Definition at line 56 of file cpio.c.
References cpio_name(), len, name, strchr(), and strlen().
Referenced by bzimage_load_initrd(), cpio_header(), and efi_file_read_initrd().
size_t cpio_header | ( | struct image * | image, |
struct cpio_header * | cpio | ||
) |
Construct CPIO header for image, if applicable.
image | Image |
cpio | CPIO header to fill in |
len | Length of magic CPIO header (including filename) |
Definition at line 102 of file cpio.c.
References cpio_header::c_filesize, cpio_header::c_magic, cpio_header::c_mode, cpio_header::c_namesize, cpio_header::c_nlink, CPIO_ALIGN, CPIO_MAGIC, cpio_name_len(), cpio_parse_cmdline(), cpio_set_field(), len, image::len, memcpy(), and memset().
Referenced by bzimage_load_initrd(), and efi_file_read_initrd().