2011-09-09 120 views
2

我想提取我的路由器固件,並修改它。所以我使用了bitsum的固件修改工具包。似乎沒有錯誤。我可以得到image_parts目錄還有rootfs.img(squashfs圖像)文件。但問題是我既不能裝載它,也不能裝上它。如何unsquashfs或掛載固件映像?

這是提取輸出:

# ./extract-ng.sh AirTies_Air5021RU_FW_1.2.0.16_FullImage.bin 
Firmware Mod Kit (extract-ng) 0.69 beta, (c)2011 Craig Heffner, Jeremy Collake 
http://www.bitsum.com 

Scanning firmware... 

DECIMAL HEX   DESCRIPTION 
------------------------------------------------------------------------------------------------------- 
65228  0xFECC  Squashfs filesystem, big endian, version 2.0, size: 1369418 bytes, 382 inodes, blocksize: 65536 bytes, created: Tue May 3 13:44:22 2011 

Extracting 65228 bytes of header image at offset 0 
Extracting squashfs file system at offset 65228 
Extracting 160 byte footer from offset 1972107 
Extracting squashfs files... 
Firmware extraction successful! 
Firmware parts can be found in 'fmk/*' 

安裝嘗試輸出:

fmk# ls 
image_parts logs rootfs 
fmk# cd image_parts/ 
fmk/image_parts# ls 
footer.img header.img rootfs.img 
fmk/image_parts# file rootfs.img 
rootfs.img: Squashfs filesystem, big endian, version 2.0, 1369418 bytes, 382 inodes, blocksize: 65536 bytes, created: Tue May 3 13:44:22 2011 
fmk/image_parts# mount rootfs.img /mnt/rootfs/ -o loop -t squashfs 
mount: wrong fs type, bad option, bad superblock on /dev/loop0, 
     missing codepage or helper program, or other error 
     In some cases useful info is found in syslog - try 
     dmesg | tail or so 
fmk/image_parts# dmesg | tail -n 1 
[24799.284066] SQUASHFS error: Can't find a SQUASHFS superblock on loop0 

unsquashfs嘗試輸出:

fmk/image_parts# unsquashfs rootfs.img 
Reading a different endian SQUASHFS filesystem on rootfs.img 
Parallel unsquashfs: Using 1 processor 
336 inodes (377 blocks) to write 

[=============================|                     ] 99/377 26% 
gzip uncompress failed with error code -3 

Failed to write squashfs-root/lib/libqueue.so, skipping 
[=============================|                     ] 100/377 26% 
gzip uncompress failed with error code -3 

gzip uncompress failed with error code -3 

gzip uncompress failed with error code -3 

... 


Failed to write squashfs-root/lib/modules/2.6.8.1/extra/blaa_dd.ko, skipping 
[====================================|                   ] 123/377 32% 
gzip uncompress failed with error code -3 

gzip uncompress failed with error code -3 

... 

Failed to write squashfs-root/webs/management/ui_password.html, skipping 
[========================================================|              ] 191/377 50% 
gzip uncompress failed with error code -3 

Failed to write squashfs-root/webs/index.html, skipping 
[========================================================|              ] 192/377 50% 
gzip uncompress failed with error code -3 

... 


Failed to write squashfs-root/usr/sbin/brctl, skipping 
[===============================================================================================================|] 377/377 100% 
created 188 files 
created 46 directories 
created 52 symlinks 
created 95 devices 
created 1 fifos 

我搜索 「錯誤代碼-3」,它是Z_DATA_ERROR (數據損壞或不完整)。 現在我該怎麼辦?

感謝

+0

不應該這是在serverfault,而是? –

回答

3

Bcm63xx固件映像具有類似的squashfs-LZMA的特殊格式。我有一些工具可以提取名爲bcm工具(brfwmod.exe)的固件映像。它有一個名爲lzma-unsquash的命令。我用這些工具成功解決了這個問題。

+1

嗨約瑟夫。您可以從此[鏈接]下載它(https://docs.google.com/file/d/0BzD4hxGinKcycHFhOS13NWJTMms/edit?usp=sharing)。 – kursat

+0

非常感謝您發佈這些bcm工具! 請注意,我刪除了我以前的評論,因爲它包含我的郵件地址,我無法編輯它。 – hunger

相關問題