charles2gan / charles2gan/firmware-mod-kit

rebuild firmware is too large

Open
#112 2 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
C
Stars
7
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
What steps will reproduce the problem?

Netcomm router firmware.
http://media.netcomm.com.au/public/assets/file/0007/98521/NB304n.zip

1. extract appears ok with no errors
2. Even if making no changes to eh tfmk directory and run ./build-firmware.sh
and it has build error with file size.
3. same result with -nopad and -min options

What is the expected output? What do you see instead?

robert@HP-PC ~/Downloads/fmk $ ./build-firmware.sh -nopad -min
Firmware Mod Kit (build) 0.99, (c)2011-2013 Craig Heffner, Jeremy Collake

Preparing tools ...
Building new squashfs file system... (this may take several minutes!)
Squahfs block size is 1024 Kb
Parallel mksquashfs: Using 2 processors
Creating 4.0 filesystem on
/home/robert/Downloads/fmk/fmk/new-filesystem.squashfs, block size 1048576.

[===============================================================================
=============================================================\] 449/449 100%
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 1048576
compressed data, compressed metadata, compressed fragments, compressed xattrs
duplicates are removed
Filesystem size 8665.59 Kbytes (8.46 Mbytes)

29.68% of uncompressed filesystem size (29196.23 Kbytes)
Inode table size 6488 bytes (6.34 Kbytes)
29.34% of uncompressed inode table size (22113 bytes)
Directory table size 7041 bytes (6.88 Kbytes)
53.55% of uncompressed directory table size (13148 bytes)
Number of duplicate files found 2
Number of inodes 711
Number of files 437
Number of fragments 18
Number of symbolic links 90
Number of device nodes 130
Number of fifo nodes 1
Number of socket nodes 0
Number of directories 53
Number of ids (unique uids + gids) 1
Number of uids 1
root (0)
Number of gids 1
root (0)
ERROR: New firmware image will be larger than original image!
Building firmware images larger than the original can brick your device!
Try re-running with the -min option, or remove any unnecessary files.
REFUSING to create new firmware image.

Original file size: 7326378
Current file size: 8876288 (plus footer of 2784 bytes)

Quitting...
robert@HP-PC ~/Downloads/fmk $

What version of the product are you using? On what operating system?
FMK build 0.99 / Linux Mint 15 x64

Please provide any additional information below

Big difference in file sizes. Can duplicate error every time. Tested as root
and standard user.

```

Original issue reported on code.google.com by `laptopt...@hotmail.com` on 11 Aug 2013 at 11:22

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with build-firmware.sh and reproduce the Netcomm NB304n build using the reported firmware archive, first without changes and then with -nopad and -min. Compare the original 7326378-byte image with the generated SquashFS and footer sizes; done means the size check behavior is corrected or the incompatibility is clearly documented and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, shell
Domain
build-system, embedded-iot, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.