summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/firmware-utils/src/mktplinkfw-lib.c10
-rw-r--r--tools/firmware-utils/src/mktplinkfw.c4
-rw-r--r--tools/firmware-utils/src/mktplinkfw2.c4
3 files changed, 6 insertions, 12 deletions
diff --git a/tools/firmware-utils/src/mktplinkfw-lib.c b/tools/firmware-utils/src/mktplinkfw-lib.c
index 18da13d..b2b6de2 100644
--- a/tools/firmware-utils/src/mktplinkfw-lib.c
+++ b/tools/firmware-utils/src/mktplinkfw-lib.c
@@ -236,19 +236,13 @@ int build_fw(size_t header_size)
goto out_free_buf;
if (!combined) {
- if (rootfs_align)
- p = buf + writelen;
- else
- p = buf + rootfs_ofs;
+ p = buf + rootfs_ofs;
ret = read_to_buf(&rootfs_info, p);
if (ret)
goto out_free_buf;
- if (rootfs_align)
- writelen += rootfs_info.file_size;
- else
- writelen = rootfs_ofs + rootfs_info.file_size;
+ writelen = rootfs_ofs + rootfs_info.file_size;
if (add_jffs2_eof)
writelen = pad_jffs2(buf, writelen, layout->fw_max_len);
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 9bc112f..ef19e10 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -307,10 +307,10 @@ static int check_options(void)
if (rootfs_align) {
kernel_len += sizeof(struct fw_header);
- kernel_len = ALIGN(kernel_len, rootfs_align);
+ rootfs_ofs = ALIGN(kernel_len, rootfs_align);
kernel_len -= sizeof(struct fw_header);
- DBG("kernel length aligned to %u", kernel_len);
+ DBG("rootfs offset aligned to 0x%u", rootfs_ofs);
exceed_bytes = kernel_len + rootfs_info.file_size - (fw_max_len - sizeof(struct fw_header));
if (exceed_bytes > 0) {
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index 892c93f..b6caf8a 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -267,10 +267,10 @@ static int check_options(void)
if (rootfs_align) {
kernel_len += sizeof(struct fw_header);
- kernel_len = ALIGN(kernel_len, rootfs_align);
+ rootfs_ofs = ALIGN(kernel_len, rootfs_align);
kernel_len -= sizeof(struct fw_header);
- DBG("kernel length aligned to %u", kernel_len);
+ DBG("rootfs offset aligned to 0x%u", rootfs_ofs);
if (kernel_len + rootfs_info.file_size >
layout->fw_max_len - sizeof(struct fw_header)) {