mirror of
https://github.com/pengutronix/genimage.git
synced 2024-11-27 03:33:59 +08:00
make sure flash_type is defined for all images that need it
do this in setup do detect configuration errors as soon as possible. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
0eff6a2b29
commit
90e41d5b8a
@ -29,11 +29,6 @@ static int jffs2_generate(struct image *image)
|
||||
int ret;
|
||||
char *extraargs;
|
||||
|
||||
if (!image->flash_type) {
|
||||
printf("no flash type given for %s\n", image->file);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
extraargs = cfg_getstr(image->imagesec, "extraargs");
|
||||
|
||||
ret = systemp(image, "%s --eraseblock=%d -d %s -o %s %s",
|
||||
@ -46,6 +41,11 @@ static int jffs2_generate(struct image *image)
|
||||
|
||||
static int jffs2_setup(struct image *image, cfg_t *cfg)
|
||||
{
|
||||
if (!image->flash_type) {
|
||||
image_error(image, "no flash type given\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,11 @@ static int ubi_setup(struct image *image, cfg_t *cfg)
|
||||
int autoresize = 0;
|
||||
struct partition *part;
|
||||
|
||||
if (!image->flash_type) {
|
||||
image_error(image, "no flash type given\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
image->handler_priv = ubi;
|
||||
|
||||
list_for_each_entry(part, &image->partitions, list)
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "genimage.h"
|
||||
|
||||
@ -45,6 +46,11 @@ static int ubifs_generate(struct image *image)
|
||||
|
||||
static int ubifs_setup(struct image *image, cfg_t *cfg)
|
||||
{
|
||||
if (!image->flash_type) {
|
||||
image_error(image, "no flash type given\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user