I have a bin file including linux file system (MIPS arch), I want to add/remove/modify some files in this bin file.
So I need to mount it with qemu but mount it is a little complicate.
This my file details
file -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
Device using this file system
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
Anyone to help me to find working qemu command?
Thanks
Problem solved!
I used firmware-mod-kit to extract firmware and rebuilt it. It's working perfectly.
it's a piece of cake with these tools!
https://github.com/rampageX/firmware-mod-kit
just two command, extract_firmware.sh to extract firmware bin file and build_firmare.sh to rebuilt it
Before you need to install some components
$ sudo apt-get install git build-essential zlib1g-dev liblzma-dev python-magic
See wiki for more information https://code.google.com/archive/p/firmware-mod-kit/wikis/Documentation.wiki
User contributions licensed under CC BY-SA 3.0