diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-05-15 18:41:48 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-05-15 18:41:48 +0000 |
commit | 63300d3d91376573cbe837e745483d9b20d77c17 (patch) | |
tree | f4b2b58543e5acadbb67f0832e323df46c4ac920 /tools | |
parent | 5015ad650c5b0586beddaa7270714c532090c2c0 (diff) | |
download | mtk-20170518-63300d3d91376573cbe837e745483d9b20d77c17.zip mtk-20170518-63300d3d91376573cbe837e745483d9b20d77c17.tar.gz mtk-20170518-63300d3d91376573cbe837e745483d9b20d77c17.tar.bz2 |
Fix broadcom squashfs images:
We switched over to appending the jffs2 eof mark to the squashfs images,
but since the squashfs is not always aligned to eraseblocksize, the eof
mark landed in the wrong place. This commit adds an extra flag to the
trx utility that can append extra data to a partition with alignment.
This is used to place the jffs2 eof mark at the right offset.
SVN-Revision: 7253
Diffstat (limited to 'tools')
-rw-r--r-- | tools/firmware-utils/src/trx.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/firmware-utils/src/trx.c b/tools/firmware-utils/src/trx.c index 787ffa8..1131238 100644 --- a/tools/firmware-utils/src/trx.c +++ b/tools/firmware-utils/src/trx.c @@ -88,7 +88,7 @@ int main(int argc, char **argv) char *ofn = NULL; char *buf; char *e; - int c, i; + int c, i, append; size_t n; uint32_t cur_len; unsigned long maxlen = TRX_MAX_LEN; @@ -110,11 +110,15 @@ int main(int argc, char **argv) in = NULL; i = 0; - while ((c = getopt(argc, argv, "-:o:m:a:b:f:")) != -1) { + while ((c = getopt(argc, argv, "-:o:m:a:b:f:A:")) != -1) { switch (c) { + case 'A': + append = 1; + /* fall through */ case 'f': case 1: - p->offsets[i++] = STORE32_LE(cur_len); + if (!append) + p->offsets[i++] = STORE32_LE(cur_len); if (!(in = fopen(optarg, "r"))) { fprintf(stderr, "can not open \"%s\" for reading\n", optarg); @@ -134,6 +138,7 @@ int main(int argc, char **argv) n += ROUND - (n & (ROUND-1)); } cur_len += n; + append = 0; break; case 'o': |