iPXE
Data Structures | Defines | 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...

Defines

#define CPIO_MAGIC   "070701"
 CPIO magic.

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.

Variables

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

Detailed Description

CPIO archives.

Definition in file cpio.h.


Define Documentation

#define CPIO_MAGIC   "070701"

CPIO magic.

Definition at line 49 of file cpio.h.

Referenced by bzimage_load_initrd().


Function Documentation

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.

Parameters:
fieldField within CPIO header
valueValue to set

Definition at line 42 of file cpio.c.

References memcpy(), and snprintf().

Referenced by bzimage_load_initrd(), and bzimage_parse_cpio_cmdline().

                                                         {
        char buf[9];

        snprintf ( buf, sizeof ( buf ), "%08lx", value );
        memcpy ( field, buf, 8 );
}

Variable Documentation

char c_magic[6]

The string "070701" or "070702".

Definition at line 48 of file cpio.h.

char c_ino[8]

File inode number.

Definition at line 50 of file cpio.h.

char c_mode[8]

File mode and permissions.

Definition at line 52 of file cpio.h.

char c_uid[8]

File uid.

Definition at line 54 of file cpio.h.

char c_gid[8]

File gid.

Definition at line 56 of file cpio.h.

char c_nlink[8]

Number of links.

Definition at line 58 of file cpio.h.

char c_mtime[8]

Modification time.

Definition at line 60 of file cpio.h.

char c_filesize[8]

Size of data field.

Definition at line 62 of file cpio.h.

char c_maj[8]

Major part of file device number.

Definition at line 64 of file cpio.h.

char c_min[8]

Minor part of file device number.

Definition at line 66 of file cpio.h.

char c_rmaj[8]

Major part of device node reference.

Definition at line 68 of file cpio.h.

char c_rmin[8]

Minor part of device node reference.

Definition at line 70 of file cpio.h.

char c_namesize[8]

Length of filename, including final NUL.

Definition at line 72 of file cpio.h.

char c_chksum[8]

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

Definition at line 74 of file cpio.h.