38 #define CPIO_DEFAULT_MODE 0644 41 #define CPIO_DEFAULT_DIR_MODE 0755 72 while ( ( (
c = *(
name++) ) ) && (
c !=
' ' ) ) {
97 if ( (
c ==
'/' ) && ( depth-- == 0 ) )
112 unsigned int *
count ) {
123 if ( *
end && ( *
end !=
' ' ) ) {
124 DBGC (
image,
"CPIO %p strange \"mode=\" " 132 if ( *
end && ( *
end !=
' ' ) ) {
133 DBGC (
image,
"CPIO %p strange \"mkdir=\" " 190 memset ( cpio,
'0',
sizeof ( *cpio ) );
197 for ( i = 0 ; i < name_len ; i++ )
203 return (
sizeof ( *cpio ) + name_len );
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static __always_inline void off_t int c
unsigned long strtoul(const char *string, char **endp, int base)
Convert string to numeric value.
#define CPIO_MODE_FILE
CPIO type for regular files.
#define CPIO_DEFAULT_DIR_MODE
CPIO directory mode.
#define CPIO_DEFAULT_MODE
CPIO default file mode.
static size_t cpio_name_len(struct image *image, unsigned int depth)
Get CPIO image filename.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
size_t cpio_header(struct image *image, unsigned int index, struct cpio_header *cpio)
Construct CPIO header for image, if applicable.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
pseudo_bit_t value[0x00020]
static unsigned int cpio_max(struct image *image)
Get maximum number of CPIO headers (i.e.
uint16_t count
Number of entries.
static void cpio_set_field(char *field, unsigned long value)
Set field within a CPIO header.
size_t len
Length of raw file image.
#define CPIO_MAGIC
CPIO magic.
const char * image_argument(struct image *image, const char *key)
Find argument within image command line.
uint32_t end
Ending offset.
static void cpio_parse_cmdline(struct image *image, unsigned int *mode, unsigned int *count)
Parse CPIO image parameters.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
#define CPIO_MODE_DIR
CPIO type for directories.
#define NULL
NULL pointer (VOID *)
void * memset(void *dest, int character, size_t len) __nonnull
static const char * cpio_name(struct image *image)
Get CPIO image name.