1 #ifndef ROS_KERN_CPIO_H
2 #define ROS_KERN_CPIO_H
4 #define CPIO_NEW_ASCII 070701
5 #define CPIO_CRC_ASCII 070702
7 #define CPIO_FILE_MASK 0170000
8 #define CPIO_SOCKET 0120000
9 #define CPIO_SYMLINK 0120000
10 #define CPIO_REG_FILE 0100000
11 #define CPIO_BLK_SPEC 0060000
12 #define CPIO_DIRECTORY 0040000
13 #define CPIO_CHAR_SPEC 0020000
14 #define CPIO_FIFO_PIPE 0010000
15 #define CPIO_SUID 0004000
16 #define CPIO_SGID 0002000
17 #define CPIO_STICKY 0001000
18 #define CPIO_PERM_MASK 0000777
20 struct cpio_newc_header
29 char c_filesize[8]; /* must be 0 for FIFOs and directories */
32 char c_rdev_maj[8]; /* only valid for chr and blk special files */
33 char c_rdev_min[8]; /* only valid for chr and blk special files */
34 char c_namesize[8]; /* count includes terminating NUL in pathname */
35 char c_chksum[8]; /* for CRC format the sum of all the bytes in the file*/
38 /* Header passed around when initing a FS based on a CPIO archive */
41 unsigned long c_ino; /* FYI: we ignore this */
45 unsigned int c_nlink; /* not sure how this makes CPIO-sense, ignoring */
46 unsigned long c_mtime;
48 unsigned long c_dev_maj;
49 unsigned long c_dev_min;
50 unsigned long c_rdev_maj;
51 unsigned long c_rdev_min;
56 void parse_cpio_entries(struct super_block *sb, void *cpio_b);
58 /* Helper function: converts src non-null-term string's n bytes from base 16 to
59 * a long, using buf as space. Make sure buf is n + 1. */
60 static inline long cpio_strntol(char *buf, char *src, size_t n)
64 return strtol(buf, 0, 16);
67 #endif /* ROS_KERN_CPIO_H */