4 * Copyright (C) 2008 Jordan Crouse <jordan@cosmicpenguin.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
25 void create_usage(void)
27 printf("create SIZE BOOTBLOCKSIZE BOOTBLOCK [ALIGN]\tCreate a ROM file\n");
30 int create_handler(struct rom *rom, int argc, char **argv)
33 char *bootblock = NULL;
41 size = get_size(argv[0]);
43 bootblocksize = get_size(argv[1]);
48 align = strtoul(argv[3], NULL, 0);
51 if (size < bootblocksize) {
52 ERROR("Cannot create a rom %d smaller then bootblock size %d\n", size, bootblocksize);
57 ERROR("Cannot create with an align size of 0\n");
61 if (create_rom(rom, rom->name, size, bootblock, bootblocksize, align))