39#define CPIO_DEFAULT_MODE 0644
42#define CPIO_DEFAULT_DIR_MODE 0755
74 for ( p =
'/' ; ( ( ( c = *(
name++) ) ) && ( c !=
' ' ) ) ; p = c ) {
75 if ( ( p ==
'/' ) && ( c !=
'/' ) )
100 for (
len = 0, p =
'/' ; ( ( ( c =
name[
len] ) ) && ( c !=
' ' ) ) ;
102 if ( ( c ==
'/' ) && ( p !=
'/' ) && ( --depth == 0 ) )
117 unsigned int *
count ) {
128 if ( *
end && ( *
end !=
' ' ) ) {
129 DBGC (
image,
"CPIO %s strange \"mode=\" "
137 if ( *
end && ( *
end !=
' ' ) ) {
138 DBGC (
image,
"CPIO %s strange \"mkdir=\" "
184 if (
name[name_len] ==
'/' ) {
194 memset ( cpio,
'0',
sizeof ( *cpio ) );
201 for ( i = 0 ; i < name_len ; i++ )
207 return (
sizeof ( *cpio ) + name_len );
#define NULL
NULL pointer (VOID *)
pseudo_bit_t value[0x00020]
#define assert(condition)
Assert a condition at run-time.
static void cpio_parse_cmdline(struct image *image, unsigned int *mode, unsigned int *count)
Parse CPIO image parameters.
static size_t cpio_name_len(struct image *image, unsigned int depth)
Get CPIO image filename.
#define CPIO_DEFAULT_MODE
CPIO default file mode.
size_t cpio_header(struct image *image, unsigned int index, struct cpio_header *cpio)
Construct CPIO header for image, if applicable.
static void cpio_set_field(char *field, unsigned long value)
Set field within a CPIO header.
static unsigned int cpio_max(struct image *image)
Get maximum number of CPIO headers (i.e.
#define CPIO_DEFAULT_DIR_MODE
CPIO directory mode.
#define CPIO_MODE_DIR
CPIO type for directories.
#define CPIO_MAGIC
CPIO magic.
#define CPIO_MODE_FILE
CPIO type for regular files.
static const char * cpio_name(struct image *image)
Get CPIO image name.
uint16_t mode
Acceleration mode.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
const char * image_argument(struct image *image, const char *key)
Find argument within image command line.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
uint32_t end
Ending offset.
unsigned long strtoul(const char *string, char **endp, int base)
Convert string to numeric value.
size_t len
Length of raw file image.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.