lib: Add early cpio decoder
Commit-ID: e6459606b04e6385ccd3c2060fc10f78a92c7700 Gitweb: http://git.kernel.org/tip/e6459606b04e6385ccd3c2060fc10f78a92c7700 Author: H. Peter Anvin <[email protected]> AuthorDate: Mon, 1 Oct 2012 00:23:52 +0200 Committer: H. Peter Anvin <[email protected]> CommitDate: Sun, 30 Sep 2012 18:02:20 -0700
lib: Add early cpio decoder
Add a simple cpio decoder without library dependencies for the purpose of extracting components from the initramfs blob for early kernel uses. Intended consumers so far are microcode and ACPI override.
Signed-off-by H. Peter Anvin <[email protected]>
Cc Len Brown <[email protected]>
Cc Fenghua Yu <[email protected]>
Signed-off-by Thomas Renninger <[email protected]>
Signed-off-by H. Peter Anvin <[email protected]>
--- include/linux/earlycpio.h | 17 +++++ lib/Makefile | 2 +- lib/earlycpio.c | 145 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 1 deletions(-)
include/linux/earlycpio.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef _LINUX_EARLYCPIO_H +#define _LINUX_EARLYCPIO_H + +#include <linux/types.h> + +#define MAX_CPIO_FILE_NAME 18 + +struct cpio_data { +void *data; +size_t size; +char name[MAX_CPIO_FILE_NAME ]; +}; + +struct cpio_data find_cpio_data (const char *path,void *data,size_t len, +long *offset); + +#endif /* _LINUX_EARLYCPIO_H */
lib/Makefile +1 -1
@@ -12,7 +12,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ idr.o int_sqrt.o extable.o prio_tree.o \ sha1.o md5.o irq_regs.o reciprocal_div.o argv_split.o \ proportions.o flex_proportions.o prio_heap.o ratelimit.o show_mem.o \ - is_single_threaded.o plist.o decompress.o + is_single_threaded.o plist.o decompress.o earlycpio.o lib-$(CONFIG_MMU) += ioremap.o lib-$(CONFIG_SMP) += cpumask.o
lib/earlycpio.c new file +145 -0
145 lines not on this page · raw message