iPXE
|
CPIO archives. More...
Go to the source code of this file.
Macros | |
#define | CPIO_DEFAULT_MODE 0644 |
CPIO default file mode. More... | |
#define | CPIO_DEFAULT_DIR_MODE 0755 |
CPIO directory mode. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | cpio_set_field (char *field, unsigned long value) |
Set field within a CPIO header. More... | |
static unsigned int | cpio_max (struct image *image) |
Get maximum number of CPIO headers (i.e. More... | |
static size_t | cpio_name_len (struct image *image, unsigned int depth) |
Get CPIO image filename. More... | |
static void | cpio_parse_cmdline (struct image *image, unsigned int *mode, unsigned int *count) |
Parse CPIO image parameters. 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.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Set field within a CPIO header.
field | Field within CPIO header |
value | Value to set |
Definition at line 49 of file cpio.c.
References memcpy(), snprintf(), and value.
Referenced by cpio_header().
|
static |
Get maximum number of CPIO headers (i.e.
number of path components)
image | Image |
max | Maximum number of CPIO headers |
Definition at line 62 of file cpio.c.
References c, cpio_name(), max, and name.
Referenced by cpio_header().
Get CPIO image filename.
image | Image |
depth | Path depth |
len | Filename length |
Definition at line 87 of file cpio.c.
References assert(), c, cpio_name(), len, name, and NULL.
Referenced by cpio_header().
|
static |
Parse CPIO image parameters.
image | Image |
mode | Mode to fill in |
count | Number of CPIO headers to fill in |
Definition at line 111 of file cpio.c.
References count, CPIO_DEFAULT_MODE, DBGC, end, image_argument(), and strtoul().
Referenced by cpio_header().
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().