This is a more technical question for those that know the deep dark secrets of the CAMv3 firmware and uBoot booting process.
Using a more recent firmware image (demo_wcv3_4.36.14.3497.bin.zip) I am trying to extract the kernel image from the file.
I can use binwalk to extract down to jz_fw.bin just fine. When I do that, if I look at the structure for the image it looks something like this:
--------------------------------------------------------------------------------------------------------------------------------------------------------------
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------------------------------------------------------------------------------------
0 0x0 uImage firmware image, header size: 64 bytes, data size: 1882651 bytes, compression:
lzma, CPU: MIPS32, OS: Linux, image type: OS Kernel Image, load address: 0x80010000,
entry point: 0x8040F090, creation time: 2022-05-28 09:15:24, image name:
"Linux-3.10.14__isvp_swan_1.0__"
2031616 0x1F0000 SquashFS file system, little endian, version: 4.0, compression: xz, inode count: 362,
block size: 131072, image size: 2969780 bytes, created: 2025-05-07 22:58:29
6029312 0x5C0000 SquashFS file system, little endian, version: 4.0, compression: xz, inode count: 160,
block size: 131072, image size: 3542882 bytes, created: 2025-05-07 22:58:30
--------------------------------------------------------------------------------------------------------------------------------------------------------------
I then extract the kernel image skipping the 64byte header as such:
dd if=jz_fw.bin bs=1 skip=64 count=1882651 of=kernel.lzma
That SHOULD render me a clean, LZMA compressed image. I can confirm this by executing file on the output, which renders:
kernel.lzma: LZMA compressed data, streamed
However, when I try to decompress it using lzma -d kernel.lzma, it tells me it’s corrupt:
lzma: kernel.lzma: Compressed data is corrupt
I’m obviously missing something here, but I am not sure what.
Can anyone shed some light on this, and help me understand how to get a clean kernel image out of the firmware bundle?