Changeset 15801


Ignore:
Timestamp:
2009-05-12T15:20:36+02:00 (9 years ago)
Author:
florian
Message:

[tools] fix padding between end of the kernel and beginning of the rootfs in imagetag (#5108)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/firmware-utils/src/imagetag.c

    r15253 r15801  
    154154        struct kernelhdr khdr; 
    155155        FILE *kernelfile = NULL, *rootfsfile = NULL, *binfile; 
    156         size_t kerneloff, kernellen, rootfsoff, rootfslen, read, imagelen; 
     156        size_t kerneloff, kernellen, rootfsoff, rootfslen, read, imagelen, rootfsoffpadlen; 
    157157        uint8_t readbuf[1024]; 
    158158        uint32_t crc = IMAGETAG_CRC_START; 
     
    204204        rootfslen = (rootfslen % flash_bs) > 0 ? (((rootfslen / flash_bs) + 1) * flash_bs) : rootfslen; 
    205205        imagelen = rootfsoff + rootfslen - kerneloff + sizeof(deadcode); 
     206        rootfsoffpadlen = rootfsoff - (kerneloff + kernellen); 
    206207 
    207208        /* Seek to the start of the kernel */ 
     
    261262        if (kernelfile) { 
    262263                sprintf(tag.kernel.address, "%lu", kerneloff); 
    263                 sprintf(tag.kernel.len, "%lu", kernellen); 
     264                sprintf(tag.kernel.len, "%lu", kernellen + rootfsoffpadlen); 
    264265        } 
    265266 
Note: See TracChangeset for help on using the changeset viewer.