[LEDE-DEV] [PATCH] otrx: always align image to 0x1000

Rafał Miłecki zajec5 at gmail.com
Mon Nov 13 14:54:18 PST 2017


From: Rafał Miłecki <rafal at milecki.pl>

This seems to match what the original trx tool and mjn3's replacement
do.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 package/utils/otrx/src/otrx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c
index 7e117c6e0d..8833e43a89 100644
--- a/package/utils/otrx/src/otrx.c
+++ b/package/utils/otrx/src/otrx.c
@@ -408,6 +408,12 @@ static int otrx_create(int argc, char **argv) {
 			break;
 	}
 
+	sbytes = otrx_create_align(trx, curr_offset, 0x1000);
+	if (sbytes < 0)
+		fprintf(stderr, "Failed to append zeros\n");
+	else
+		curr_offset += sbytes;
+
 	hdr.length = curr_offset;
 	otrx_create_write_hdr(trx, &hdr);
 err_close:
-- 
2.11.0




More information about the Lede-dev mailing list