diff --git a/fdtoverlay.c b/fdtoverlay.c index 699b4f61..d300f814 100644 --- a/fdtoverlay.c +++ b/fdtoverlay.c @@ -46,6 +46,7 @@ static void *apply_one(char *base, const char *overlay, size_t *buf_len, char *tmp = NULL; char *tmpo; int ret; + bool has_symbols; /* * We take copies first, because a failed apply can trash @@ -53,6 +54,7 @@ static void *apply_one(char *base, const char *overlay, size_t *buf_len, */ tmpo = xmalloc(fdt_totalsize(overlay)); + do { tmp = xrealloc(tmp, *buf_len); ret = fdt_open_into(base, tmp, *buf_len); @@ -62,6 +64,8 @@ static void *apply_one(char *base, const char *overlay, size_t *buf_len, fdt_strerror(ret)); goto fail; } + ret = fdt_path_offset(tmp, "/__symbols__"); + has_symbols = ret >= 0; memcpy(tmpo, overlay, fdt_totalsize(overlay)); @@ -74,6 +78,11 @@ static void *apply_one(char *base, const char *overlay, size_t *buf_len, if (ret) { fprintf(stderr, "\nFailed to apply '%s': %s\n", name, fdt_strerror(ret)); + if (!has_symbols) { + fprintf(stderr, + "base blob does not have a '/__symbols__' node, " + "make sure you have compiled the base blob with '-@' option\n"); + } goto fail; }