static char *board_name = 0;
static char *version_name = 0;
static unsigned int rootfs_size = 0;
+static unsigned int header_length = HEADER_PARTITION_LENGTH;
static struct file_info kernel = { NULL, NULL, 0 };
static struct file_info rootfs = { NULL, NULL, 0 };
" -v <version> version string\n"
" -b <boardname> name of board to generate image for\n"
" -o <out_name> name of output image\n"
+ " -l <hdr_length> length of header, default 65536\n"
" -h show this screen\n"
);
board_header = generate_board_header(kernel_header, rootfs_header, board_name);
/* Prepare output file */
- out.size = HEADER_PARTITION_LENGTH + rootfs_out.size;
+ out.size = header_length + rootfs_out.size;
if (kernel.name)
out.size += kernel.size;
out.data = malloc(out.size);
memcpy(out.data + ROOTFS_HEADER_LEN, board_header, BOARD_HEADER_LEN);
if (kernel.name)
memcpy(out.data + ROOTFS_HEADER_LEN + BOARD_HEADER_LEN, kernel_header, KERNEL_HEADER_LEN);
- ptr = HEADER_PARTITION_LENGTH;
+ ptr = header_length;
memcpy(out.data + ptr, rootfs_out.data, rootfs_out.size);
ptr += rootfs_out.size;
if (kernel.name)
while (1) {
int c;
- c = getopt(argc, argv, "b:k:o:r:s:v:h");
+ c = getopt(argc, argv, "b:k:o:r:s:v:l:h");
if (c == -1)
break;
case 'v':
version_name = optarg;
break;
+ case 'l':
+ sscanf(optarg, "%u", &header_length);
+ break;
default:
usage(EXIT_FAILURE);
break;