summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-12-17 13:47:03 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-03-01 16:38:16 +0100
commitde6168e331435bc22a931fa82f82401e774f4e5d (patch)
treeea5f12ae23209d1feaae768ddb2a25c3b6840a73
parent86b76c6d43a3ea87c00235f2961d71002d4c4792 (diff)
downloadgenimage-de6168e331435bc22a931fa82f82401e774f4e5d.tar.gz
genimage-de6168e331435bc22a931fa82f82401e774f4e5d.tar.xz
genimage: support absolute output file names
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--genimage.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/genimage.c b/genimage.c
index 6fc7efe..64a7b2e 100644
--- a/genimage.c
+++ b/genimage.c
@@ -668,7 +668,11 @@ int main(int argc, char *argv[])
image->mountpoint = cfg_getstr(imagesec, "mountpoint");
image->exec_pre = cfg_getstr(imagesec, "exec-pre");
image->exec_post = cfg_getstr(imagesec, "exec-post");
- xasprintf(&image->outfile, "%s/%s", imagepath(), image->file);
+ if (image->file[0] == '/')
+ image->outfile = strdup(image->file);
+ else
+ xasprintf(&image->outfile, "%s/%s", imagepath(),
+ image->file);
if (image->mountpoint && *image->mountpoint == '/')
image->mountpoint++;
str = cfg_getstr(imagesec, "flashtype");