iPXE
|
CPIO archives. More...
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_MODE_FILE 0100000 |
CPIO type for regular files. More... | |
#define | CPIO_MODE_DIR 0040000 |
CPIO type for directories. 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... | |
static size_t | cpio_pad_len (size_t len) |
Get CPIO header zero-padding length. More... | |
size_t | cpio_header (struct image *image, unsigned int index, 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 73 of file cpio.h.
References image::cmdline.
Referenced by bzimage_load_initrd(), cpio_header(), cpio_max(), cpio_name_len(), and efi_file_read_initrd().
Get CPIO header zero-padding length.
len | Length of CPIO header (including name, excluding NUL) |
pad_len | Padding length |
Definition at line 84 of file cpio.h.
References CPIO_ALIGN, and len.
Referenced by bzimage_load_initrd(), and efi_file_read_initrd().
size_t cpio_header | ( | struct image * | image, |
unsigned int | index, | ||
struct cpio_header * | cpio | ||
) |
Construct CPIO header for image, if applicable.
image | Image |
index | CPIO header index |
cpio | CPIO header to fill in |
len | Length of CPIO header (including name, excluding NUL) |
Definition at line 151 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, count, CPIO_DEFAULT_DIR_MODE, CPIO_MAGIC, cpio_max(), CPIO_MODE_DIR, CPIO_MODE_FILE, cpio_name(), cpio_name_len(), cpio_parse_cmdline(), cpio_set_field(), DBGC, DBGC2_HDA, index, len, image::len, max, memcpy(), memset(), image::name, and name.
Referenced by bzimage_load_initrd(), and efi_file_read_initrd().