include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mtd
-PKG_RELEASE:=17
+PKG_RELEASE:=18
PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME)
STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS)
pad(erasesize);
free(buf);
- if (trx_fixup) {
- trx_fixup(outfd, mtd);
- }
return (mtdofs - ofs);
}
ssize_t r, w, e;
ssize_t skip = 0;
uint32_t offset = 0;
+ int jffs2_replaced = 0;
#ifdef FIS_SUPPORT
static struct fis_part new_parts[MAX_ARGS];
fprintf(stderr, "\nAppending jffs2 data from %s to %s...", jffs2file, mtd);
/* got an EOF marker - this is the place to add some jffs2 data */
skip = mtd_replace_jffs2(mtd, fd, e, jffs2file);
+ jffs2_replaced = 1;
/* don't add it again */
jffs2file = NULL;
offset = 0;
}
+ if (jffs2_replaced && trx_fixup) {
+ trx_fixup(fd, mtd);
+ }
+
if (!quiet)
fprintf(stderr, "\b\b\b\b ");
force = 0;
buflen = 0;
quiet = 0;
- no_erase = 0;
+ no_erase = 0;
while ((ch = getopt(argc, argv,
#ifdef FIS_SUPPORT
if (quiet < 2)
fprintf(stderr, "Trying to fix trx header in %s at 0x%x...\n", mtd, offset);
- block_offset = offset & ~(erasesize - 1);
- offset -= block_offset;
-
fd = mtd_check_open(mtd);
if(fd < 0) {
fprintf(stderr, "Could not open mtd device: %s\n", mtd);
exit(1);
}
+ block_offset = offset & ~(erasesize - 1);
+ offset -= block_offset;
+
if (block_offset + erasesize > mtdsize) {
fprintf(stderr, "Offset too large, device size 0x%x\n", mtdsize);
exit(1);