6

I'm trying to modify a firmware file by unsquashing it, editing my files and squash it again. But I got problems with the device which does not accept the file because of different squashfs types (as I suppose). Here's the output on my dev box:

original file:

user@ubuntuVM:~$ unsquashfs -s main-fs.5_0 
Reading a different endian SQUASHFS filesystem on main-fs.5_0
Found a valid big endian SQUASHFS 3:0 superblock on main-fs.5_0.
Creation or last append time Thu Aug 21 20:56:15 2008
Filesystem size 9653.75 Kbytes (9.43 Mbytes)
Block size 65536
Filesystem is not exportable via NFS
Inodes are compressed
Data is compressed
Fragments are compressed
Always_use_fragments option is not specified
Check data is not present in the filesystem
Duplicates are removed
Number of fragments 105
Number of inodes 1667
Number of uids 2
Number of gids 1

modified file: (used mksquashfs squashfs-root main-fs.test -b 64K -no-exports -no-xattrs -no-sparse -force-gid 0 -force-uid 0 as root)

user@ubuntuVM:~$ unsquashfs -s main-fs.mod
Found a valid SQUASHFS 4:0 superblock on main-fs.mod.
Creation or last append time Mon Dec  3 14:46:07 2012
Filesystem size 9654.48 Kbytes (9.43 Mbytes)
Compression gzip
Block size 65536
Filesystem is not exportable via NFS
Inodes are compressed
Data is compressed
Fragments are compressed
Always_use_fragments option is not specified
Xattrs are not stored
Duplicates are removed
Number of fragments 105
Number of inodes 1667
Number of ids 1

I think the problem is the superblock and/or SQUASHFS version. I found that it was possible to us mksquashfs -2.0 for some time, but this argument got removed and would not be so helpful because I need version 3.

So my question exactly is: How can I achieve to repack my modified files exactly as they were before? Additionally my modificated file states compression: gzip but the original states nothing about it's compression. Maybe here is a problem too, but I don't know how to get more info than the above. :-(

1 Answer 1

3

Linux kernels before 2.6.29 don't accept SquashFS version 4 filesystems (read here). This will probably the cause why your device does not boot with it.

In order to build a SquashFS v3 image, you'll need an older version of the squashfs-tools package. The latest supported release of Ubuntu including this is the old Hardy 8.04 release with the package available here. I think it's possible to just install this package on a more recent version of Ubuntu. Try that before installing the ancient Hardy release.

I'm quite astonished to see that Ubuntu has just upgraded in-place with this non-forwards and non-backwards compatible upgrade. I would expected to see both version 3 and 4 packages in the repositories.

3
  • I still got problems with squashfs-tools 3.3 from hardy (on 8.04 and 12.04). It was not able to unsquash. I did a build of 3.0 from source (on 12.04) and it looks like everything worked. unsquash -s (v4) gives the same output for both images now. I'll try to flash it onto my device later this evening. I'll keep you updated.
    – Mose
    Dec 6, 2012 at 16:43
  • everything worked
    – Mose
    Dec 6, 2012 at 23:57
  • Ok good to hear that. Still surprised Debian/Ubuntu decided not to package squashfs-tools 3 along with 4.
    – gertvdijk
    Dec 6, 2012 at 23:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .