X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=helper%2Fhelper.h;h=e0d1fbb545c5af117edbdfab902c6a70b562fed4;hb=5678972dca34f06bfa520bd7e9ee558a1a3164b4;hp=42bf824b03d684e35b0a34549cfcc97a86d2b3ad;hpb=e23a9c8f05e3646feb826d5db36d8656a80a27ab;p=febootstrap.git diff --git a/helper/helper.h b/helper/helper.h index 42bf824..e0d1fbb 100644 --- a/helper/helper.h +++ b/helper/helper.h @@ -19,12 +19,49 @@ #ifndef FEBOOTSTRAP_SUPERMIN_HELPER_H #define FEBOOTSTRAP_SUPERMIN_HELPER_H +#include +#include "fts_.h" + +struct writer { + /* Start building a new appliance. + * 'appliance' is the output appliance. + * 'initrd' is the mini-initrd to create (only used for ext2 output). + * 'modpath' is the kernel module path. + */ + void (*wr_start) (const char *hostcpu, const char *appliance, + const char *modpath, const char *initrd); + + /* Finish off the appliance. */ + void (*wr_end) (void); + + /* Append the named host file to the appliance being built. The + * wr_file_stat form is used where we have already stat'd this file, + * to avoid having to stat it a second time. The wr_fts_entry form + * is used where the caller has an FTSENT. + */ + void (*wr_file) (const char *filename); + void (*wr_file_stat) (const char *filename, const struct stat *); + void (*wr_fts_entry) (FTSENT *entry); + + /* Append the contents of cpio file to the appliance being built. */ + void (*wr_cpio_file) (const char *cpio_file); +}; + /* main.c */ extern struct timeval start_t; extern int verbose; /* appliance.c */ -extern void create_appliance (char **inputs, int nr_inputs, const char *whitelist, const char *modpath, const char *initrd); +extern void create_appliance (const char *hostcpu, char **inputs, int nr_inputs, const char *whitelist, const char *modpath, const char *initrd, const char *appliance, struct writer *writer); + +/* checksum.c */ +extern struct writer checksum_writer; + +/* cpio.c */ +extern struct writer cpio_writer; + +/* ext2.c */ +extern struct writer ext2_writer; /* kernel.c */ extern const char *create_kernel (const char *hostcpu, const char *kernel);