aboutsummaryrefslogtreecommitdiff
path: root/fdtoverlay.c
AgeCommit message (Collapse)AuthorFilesLines
2023-04-28fdtoverlay: Drop a a repeated articleUwe Kleine-König1-1/+1
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2023-03-18fdtoverlay: Fix usage string to not mention "<type>"Uwe Kleine-König1-3/+1
fdtoverlay doesn't have a -t option, so explaining the type formats and modifier prefixes doesn't make much sense. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Message-Id: <20230315100819.13387-1-u.kleine-koenig@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-10-11fdtoverlay: Return non-zero exit code if overlays can't be appliedValter Minute1-1/+0
At present the tool terminates its execution if one of the overlays passed as command-line arguments can't be successfully read or applied, but the exit code of the process is zero, making failures hard to detect inside scripts. Signed-off-by: Valter Minute <valter.minute@toradex.com> Message-Id: <20191009123256.14248-1-valter.minute@toradex.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30fdtoverlay: Rework output allocationDavid Gibson1-16/+58
At present the fdtoverlay tool allocates space for its output based on a calculation of the worse case size based on the size of the input blobs. Except.. that certain edge cases with very long target paths can actually exceed that "worst case" calculation. This reworks the code to instead dynamically reallocate the output buffer if we run out of space at any point. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30fdtoverlay: Improve error messagesDavid Gibson1-8/+6
Make several improvements to the error messages from the fdtoverlay helper program: improve brevity, consistently quote filenames and print symbolic errors from libfdt rather than a raw error number. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-30fdtoverlay: Check for truncated overlay blobsDavid Gibson1-1/+9
The fdtoverlay helper program checks if it has read a base blob which is incomplete: that is, where the amount of data read in is less that the declared size of the blob. This applies the same check for safety to each overlay blob as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-06-21dtc: Replace GPLv2 boilerplate/reference with SPDX tagsRob Herring1-15/+1
Replace instances of GPLv2 or later boilerplate with SPDX tags. Signed-off-by: Rob Herring <robh@kernel.org> Message-Id: <20190620211944.9378-2-robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2018-06-07Use size_t for blob lengths in utilfdt_read*David Gibson1-1/+1
It's more appropriate than off_t since it is, after all, a size not an offset. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-06-07Consolidate utilfdt_read_len() variantsDavid Gibson1-2/+2
There are no less than _four_ variants on utilfdt_read() which is a bit excessive. The _len() variants are particularly pointless, since we can achieve the same thing with very little extra verbosity by using the usual convention of ignoring return parameters if they're NULL. So, get rid of them (we keep the shorter names without _len, but add now-optional len parameters). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-01-03fdtoverlay: Switch from using alloca to mallockevans@FreeBSD.org1-2/+2
alloca entails a complicated header situation when using other platforms, where some split it out in alloca.h while others include it as a standard part of stdlib.h. The cons don't seem to outweigh the pros, so switch it to malloc. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-27fdtoverlay: Sanity check blob sizeDavid Gibson1-0/+7
The fdtoverlay utility reads in the base fdt blob, then expands it to make room for all the overlays requested. However, it uses the totalsize field of the base blob without verifying that it actually read all of it in (it's possible the blob file could have been truncated). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-06-15fdtoverlay: A tool that applies overlaysPantelis Antoniou1-0/+168
Since libfdt support overlay application on FDT blobs, provide a command line tool that applies an arbitrary number of overlays, one after another to a base fdt blob and output the result in the given file. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>