summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/cpio.h
diff options
context:
space:
mode:
authorMichael Brown2007-08-02 00:10:30 +0200
committerMichael Brown2007-08-02 00:10:30 +0200
commit726e366e8f1772c3f77ed37a8838270649dd36c1 (patch)
tree4655599966f3d07e10579a281c8e60b8fd5158ee /src/include/gpxe/cpio.h
parentInitrd concatenation now working (diff)
downloadipxe-726e366e8f1772c3f77ed37a8838270649dd36c1.tar.gz
ipxe-726e366e8f1772c3f77ed37a8838270649dd36c1.tar.xz
ipxe-726e366e8f1772c3f77ed37a8838270649dd36c1.zip
Add code for constructing single-file cpio archives on the fly
Diffstat (limited to 'src/include/gpxe/cpio.h')
-rw-r--r--src/include/gpxe/cpio.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/include/gpxe/cpio.h b/src/include/gpxe/cpio.h
new file mode 100644
index 000000000..ba6f844a5
--- /dev/null
+++ b/src/include/gpxe/cpio.h
@@ -0,0 +1,51 @@
+#ifndef _GPXE_CPIO_H
+#define _GPXE_CPIO_H
+
+/** @file
+ *
+ * CPIO archives
+ *
+ */
+
+/** A CPIO archive header
+ *
+ * All field are hexadecimal ASCII numbers padded with '0' on the
+ * left to the full width of the field.
+ */
+struct cpio_header {
+ /** The string "070701" or "070702" */
+ char c_magic[6];
+ /** File inode number */
+ char c_ino[8];
+ /** File mode and permissions */
+ char c_mode[8];
+ /** File uid */
+ char c_uid[8];
+ /** File gid */
+ char c_gid[8];
+ /** Number of links */
+ char c_nlink[8];
+ /** Modification time */
+ char c_mtime[8];
+ /** Size of data field */
+ char c_filesize[8];
+ /** Major part of file device number */
+ char c_maj[8];
+ /** Minor part of file device number */
+ char c_min[8];
+ /** Major part of device node reference */
+ char c_rmaj[8];
+ /** Minor part of device node reference */
+ char c_rmin[8];
+ /** Length of filename, including final NUL */
+ char c_namesize[8];
+ /** Checksum of data field if c_magic is 070702, othersize zero */
+ char c_chksum[8];
+} __attribute__ (( packed ));
+
+/** CPIO magic */
+#define CPIO_MAGIC "070701"
+
+extern void cpio_set_field ( char *field, unsigned long value );
+
+#endif /* _GPXE_CPIO_H */