我有一个包含linux文件系统(MIPS arch)的bin文件,我想在这个bin文件中添加/删除/修改一些文件。
所以我需要用 qemu 来安装它,但安装它有点复杂。
这是我的文件详细信息
文件-k zCore.bin
u-boot legacy uImage, MIPS OpenWrt Linux-4.14.105, Linux/MIPS, OS Kernel Image (lzma), 1569261 bytes, Tue Mar 12 17:26:59 2019, Load Address: 0x80000000, Entry Point: 0x80000000, Header CRC: 0xF13AB2B0, Data CRC: 0x159DCB10\012- data
binwalk zCore.bin
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0xF13AB2B0, created: 2019-03-12 17:26:59, image size: 1569261 bytes, Data Address: 0x80000000, Entry Point: 0x80000000, data CRC: 0x159DCB10, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "MIPS OpenWrt Linux-4.14.105"
64 0x40 LZMA compressed data, properties: 0x6D, dictionary size: 8388608 bytes, uncompressed size: 4938420 bytes
1569325 0x17F22D Squashfs filesystem, little endian, version 4.0, compression:xz, size: 12400814 bytes, 2493 inodes, blocksize: 262144 bytes, created: 2019-03-12 17:26:59
使用该文件系统的设备
cat /proc/cpuinfo
system type : MediaTek MT7628AN ver:1 eco:2
machine : WRTnode2P
processor : 0
cpu model : MIPS 24KEc V5.5
BogoMIPS : 380.92
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa : mips1 mips2 mips32r1 mips32r2
ASEs implemented : mips16 dsp
Options implemented : tlb 4kex 4k_cache prefetch mcheck ejtag llsc pindexed_dcache userlocal vint perf_cntr_intr_bit nan_legacy nan_2008 perf
shadow register sets : 1
kscratch registers : 0
package : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available
谁能帮我找到可用的 qemu 命令?
谢谢
答案1
问题解决了!
我使用 firmware-mod-kit 提取固件并重建它。它运行正常。
有了这些工具,一切都是小菜一碟!
https://github.com/rampageX/firmware-mod-kit
只需两个命令,extract_firmware.sh 用于提取固件 bin 文件,build_firmare.sh 用于重建它
在安装一些组件之前
$ sudo apt-get install git build-essential zlib1g-dev liblzma-dev python-magic
请参阅 wiki 了解更多信息 https://code.google.com/archive/p/firmware-mod-kit/wikis/Documentation.wiki