iPXE
Data Structures | Macros | Functions | Variables
cpio.h File Reference

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...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
struct cpio_header __attribute__ ((packed))
 
void cpio_set_field (char *field, unsigned long value)
 Set field within a CPIO header. More...
 

Variables

char c_magic [6]
 The string "070701" or "070702". More...
 
char c_ino [8]
 File inode number. More...
 
char c_mode [8]
 File mode and permissions. More...
 
char c_uid [8]
 File uid. More...
 
char c_gid [8]
 File gid. More...
 
char c_nlink [8]
 Number of links. More...
 
char c_mtime [8]
 Modification time. More...
 
char c_filesize [8]
 Size of data field. More...
 
char c_maj [8]
 Major part of file device number. More...
 
char c_min [8]
 Minor part of file device number. More...
 
char c_rmaj [8]
 Major part of device node reference. More...
 
char c_rmin [8]
 Minor part of device node reference. More...
 
char c_namesize [8]
 Length of filename, including final NUL. More...
 
char c_chksum [8]
 Checksum of data field if c_magic is 070702, othersize zero. More...
 

Detailed Description

CPIO archives.

Definition in file cpio.h.

Macro Definition Documentation

◆ CPIO_MAGIC

#define CPIO_MAGIC   "070701"

CPIO magic.

Definition at line 49 of file cpio.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ __attribute__()

struct cpio_header __attribute__ ( (packed)  )

◆ cpio_set_field()

void cpio_set_field ( char *  field,
unsigned long  value 
)

Set field within a CPIO header.

Parameters
fieldField within CPIO header
valueValue to set

Definition at line 42 of file cpio.c.

42  {
43  char buf[9];
44 
45  snprintf ( buf, sizeof ( buf ), "%08lx", value );
46  memcpy ( field, buf, 8 );
47 }
void * memcpy(void *dest, const void *src, size_t len) __nonnull
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382

References memcpy(), snprintf(), and value.

Referenced by bzimage_load_initrd(), and bzimage_parse_cpio_cmdline().

Variable Documentation

◆ c_magic

char c_magic[6]

The string "070701" or "070702".

Definition at line 12 of file cpio.h.

◆ c_ino

char c_ino[8]

File inode number.

Definition at line 14 of file cpio.h.

◆ c_mode

char c_mode[8]

File mode and permissions.

Definition at line 16 of file cpio.h.

◆ c_uid

char c_uid[8]

File uid.

Definition at line 18 of file cpio.h.

◆ c_gid

char c_gid[8]

File gid.

Definition at line 20 of file cpio.h.

◆ c_nlink

char c_nlink[8]

Number of links.

Definition at line 22 of file cpio.h.

◆ c_mtime

char c_mtime[8]

Modification time.

Definition at line 24 of file cpio.h.

◆ c_filesize

char c_filesize[8]

Size of data field.

Definition at line 26 of file cpio.h.

◆ c_maj

char c_maj[8]

Major part of file device number.

Definition at line 28 of file cpio.h.

◆ c_min

char c_min[8]

Minor part of file device number.

Definition at line 30 of file cpio.h.

◆ c_rmaj

char c_rmaj[8]

Major part of device node reference.

Definition at line 32 of file cpio.h.

◆ c_rmin

char c_rmin[8]

Minor part of device node reference.

Definition at line 34 of file cpio.h.

◆ c_namesize

char c_namesize[8]

Length of filename, including final NUL.

Definition at line 36 of file cpio.h.

◆ c_chksum

char c_chksum[8]

Checksum of data field if c_magic is 070702, othersize zero.

Definition at line 38 of file cpio.h.