1 typedef int (*initcall_t) (void);
11 Start, Collect, GotHeader, SkipIt, GotName, CopyFile, GotSymlink, Reset
14 long long this_header, next_header;
25 if (memcmp(collected, "070707", 6) == 0) {
26 error("incorrect cpio method used: use -H newc option");
45 int (*actions[]) (void) =
47 [Start] = do_start,[Collect] = do_collect,[GotHeader] =
48 do_header,[SkipIt] = do_skip,[GotName] =
49 do_name,[CopyFile] = do_copy,[GotSymlink] =
50 do_symlink,[Reset] = do_reset,};
52 write_buffer(char *buf,
55 while (!actions[state] ()) ;
58 unpack_to_rootfs(char *buf,
63 while (!message && len) {
64 if (*buf == '0' && !(this_header & 3)) {
65 written = write_buffer(buf, len);
68 error("junk in gzipped archive");
71 extern char __initramfs_start[], __initramfs_end[];
72 int populate_rootfs(void)
75 unpack_to_rootfs(__initramfs_start,
76 __initramfs_end - __initramfs_start, 0);
78 initcall_t __initcall_populate_rootfsrootfs __attribute__ ((__used__))