squashed then re-squashed give different size?
1
vote
0
answers
416
views
I extracted a
firmware.bin
using fmk mod kit and gave me 3 files: header.img , rootfs.img and footer.img
now whenever I cat and repack all the files together in firmware2.bin
again, it works and it upgrades the router. but when I unsquash the rootfs.img
using this command unsquashfs rootfs.img
into squashfs-root/
then I squash it again using mksquashfs rootfs-root/ squash_new.img -comp lzma -b 131072
"which it by the way the same compression method and block size as the original rootfs.img
" but it gives me a less size comparing to the rootfs.img
and the router gives me upgrade failed
here are the sizes of the 2 files
> squash_new.img (9,945,088 bytes)
>
> rootfs.img (9,945,232 bytes)
is there a problem with unsquashfs
or mksquashfs
?
because when I used a hex editor software, I noticed some entries are different although I have not changed anything.
**EDIT** someone suggested that the header.img
file could contain the information about the rootfs.img
file and any change could cause an upgrade failed issue unless I match it with the info inside the header.img
, how would I edit the header.img
file, I can't unsquash it, only view it as hex and all the text inside is rubbish.
Asked by Abrahim Hussein
(11 rep)
May 29, 2021, 09:19 PM