s5vi's Motorola p2k phone page
February 10, 2012, 10:20:51 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Over 30000 member ! Under heavy spammer attack ! Cleaning in progress !
V-6.0.0 with CDMA support is available now.
To become VIP: you can do it via PayPal: http://www.el-co.hu/p2k05/paypal.html
 
   Home   Help Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: SquashFS and V8/Z6  (Read 10645 times)
0 Members and 1 Guest are viewing this topic.
rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« on: August 23, 2007, 08:43:54 pm »

I am wondering if it is possible to mount the V8/Z6 as a USB device under Linux and using the squasfs as the filesystem cos both mobiles do use MOTOMAGX with squashFS.
Logged

Nothing is impossible, only miracles take a bit longer!
rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #1 on: October 07, 2007, 10:28:50 pm »

It is possible to extract the file structure of 5 CG (out of 14) from a V8 flash by mounting those CG.smg files with the squashfs filesystem.
But rebuilding an original CG52 (NO digital signature!!) with mksquashfs will not work, most likely the parameters have not been found so far. One thing is for sure squashfs does not use the lzma compression in the V8 firmware.
Logged

Nothing is impossible, only miracles take a bit longer!
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #2 on: October 08, 2007, 08:05:09 am »

Hi,
I found this: http://tldp.org/HOWTO/SquashFS-HOWTO/mksqoverview.html
In argument list i see a VERY suspicious thing: force a big or little endian file system, respectively
If you make an iemge on your PC endiannes automatically will be set little endian
I dont know wich cpu is in V8, but if it big endian (arm was big-endian in V3/E398 series)
you must use -be option

If you mount an image and re-build it with mksqasfs the new image is binary equvivalent with old one? or not. If not the phone will not work ofcourse
Logged

rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #3 on: October 08, 2007, 08:57:21 pm »

It works fine only with CG52 because there are no links or empty folders or so. So after mounting the original CG5.smg with squashfs as filesystem I can copy the everything and when I mksquashfs the copy and flash it, the V8 hangs itself at bootscreen.
Everything is the same, I even checked the folder amd file permissions, but the mksquashfs -CG52 is not the exact same size as original, even so both are shown as 10.8 MB. So far the mksquashfs CG52 is mostly bigger in size, only if I use the -nopad option then it is about 39 Bytes smaller then the original, but still it hangs the V8 at bootscreen.
I have tried quite a few options and combinations of them, but never got there.
If I could get the copy of the original CG52 mksquashfs correctly and it will flash perfect, I am a huge step closer to custom skins.

PS: I know that page in your link, but it is for an older version of squashfs, the newer one does not have a great deal of changes, but the default block size is now 65536 (64 KB).
« Last Edit: October 08, 2007, 08:59:58 pm by rasputin007 » Logged

Nothing is impossible, only miracles take a bit longer!
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #4 on: October 11, 2007, 11:21:47 am »

I tried it yesterday.
Kernel log (/var/log/messages) shows 3.1 squashfs module loaded when i mount original image
I'm on mandriva , get squashfs-tools. Its version 3.0 (will try to compile the latest frok source)
With padding the new image is slightly bigger, without padding the image is lightly smaller
I try to pack the original folder without any touch
I cannot produce same size
I try little and big endian , and i'm sure the original image is little endian
I see into image with hexeditor.
There are more differences in the first 30-40 byte
I dont know the inner structure of image file
Maybe must see the kernel module source
Logged

s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #5 on: October 12, 2007, 12:36:25 pm »

this is from squasfs source (V-3.2)

/*
 * definitions for structures on disk
 */

typedef long long      squashfs_block_t;
typedef long long      squashfs_inode_t;

struct squashfs_super_block {
   unsigned int      s_magic;
   unsigned int      inodes;
   unsigned int      bytes_used_2;
   unsigned int      uid_start_2;
   unsigned int      guid_start_2;
   unsigned int      inode_table_start_2;
   unsigned int      directory_table_start_2;
   unsigned int      s_major:16;
   unsigned int      s_minor:16;
   unsigned int      block_size_1:16;
   unsigned int      block_log:16;
   unsigned int      flags:8;
   unsigned int      no_uids:8;
   unsigned int      no_guids:8;
   unsigned int      mkfs_time /* time of filesystem creation */;
   squashfs_inode_t   root_inode;
   unsigned int      block_size;
   unsigned int      fragments;
   unsigned int      fragment_table_start_2;
   long long      bytes_used;
   long long      uid_start;
   long long      guid_start;
   long long      inode_table_start;
   long long      directory_table_start;
   long long      fragment_table_start;
   long long      lookup_table_start;
} __attribute__ ((packed));

the binary file starts with this superblock
s_magic is 4 byte identifier of squashfs ASCII "sqsh"
will try to identify what is what
I think this is important difference (the superblock) between original and hand-made image files

Logged

rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #6 on: October 13, 2007, 12:22:05 am »

I have managed to change some files in the CG52 (the only one without digital signature), but only thanks to some work done by members at faq4mobiles.de. It is squashfs version 2.1 that has been used in MOTOMAGX, that's why all attempts with squashfs 3.2 would not work.
Because 98% of modders are Windows dependent, they have HUGE problems with Linux and squashfs 2.1 support. Now at faq4mobiles.de they are thinking about to create a mini distro with squashfs 2.1 that can be run under Windows with the free VMPlayer.
Logged

Nothing is impossible, only miracles take a bit longer!
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #7 on: October 13, 2007, 01:12:06 pm »

Afaik squash filesystem has version 1 (the old) and Version 2 (the new) variants
Ofcourse mksquashfs and unsquashfs has version numbering also.
afaik mksquashfs 3.2 and 3.1 and 3.0 produce squashfs V2

btw. Vmware player image is VERY good idea....
Logged

s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #8 on: October 16, 2007, 07:07:16 pm »

Hi,
meanwhile i figured out that mksquashfs 3.x produce different superblock than 2.1
Using 2.1 version (i test it: untouch mounted folder and try to make image) the image is identical with 2 differences
- In superblock there is  creation time in unix time format (4 byte) this is different of course but can be re-copy the original 4 bytes
- size is smaller with 2048 bytes, the original file contains 2048 0xFF byte at the end

I read you can create custom CG52, this means you step over mksquashfs problem?
Logged

rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #9 on: October 16, 2007, 11:01:15 pm »

Somehow I spent hours to deinstall squashfs 3.2 and recomplie squashfs 2.1 on my Debian-amd64, always got an error somewhere.
Anyway I did a "make" on the squashfs-tools version 2.1 and got a mksquashfs executable (no unsquashfs in version 2.1), then I reinstalled squashfs 3.2 by updating Debian software now on kernel 2.6.22 and replaced the mksquashfs (version 3.2) in /usr/bin with the mksquashfs (version 2.1). Funny enough it works. I now use 3.2 to mount and 2.1 to recompress.
If I could get SBF Recalc 1.2.8.lin and RSD working under Debian I would never need to use Windows again, but that has not happend yet.
I also tried other CG's, but it always ends up in bootloader because they all have digital signature, only CG52 has not.
Logged

Nothing is impossible, only miracles take a bit longer!
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #10 on: October 17, 2007, 07:55:36 am »

You can have more mksquashfs binaries on your system
I leave original in  /usr/bin
Copy mksquashfs source into my home folder, and run "make"
If i run "/home/s5vi/squashfs-tools/mksquashfs"
2.1 will run.
if i run only "mksquashfs"
3.1 will run from /usr/bin

anyway this prob is gone, congrats for your skin re-flash

Logged

rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #11 on: October 17, 2007, 01:41:26 pm »

I just tested it on Mandrivia 2007, which has squashfs support included, as you said. So I could mount any squshfs compressed CG.
Then I copied the squashfs-tools version 2.1 into /usr/local and ran "make" the resulting mksquashfs executable I copied into /usr/bin and hey presto, now I have Mandrivia runing squashfs and compressing with mksquashfs 2.1. Brilliant!!!
Logged

Nothing is impossible, only miracles take a bit longer!
s5vi
Administrator
Hero Member
*****
Offline Offline

Posts: 769



WWW Email
« Reply #12 on: October 17, 2007, 01:46:28 pm »

Have anyone tried to compile squashfs-tools on win32 ?
As i see the source it uses only file and zlib operations.

Logged

rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #13 on: October 17, 2007, 03:57:14 pm »

Have anyone tried to compile squashfs-tools on win32 ?
As i see the source it uses only file and zlib operations.



No, not as far as I know. If that would be possible that would be a milestone!!!
Logged

Nothing is impossible, only miracles take a bit longer!
rasputin007
VIP
Jr. Member
*****
Offline Offline

Posts: 56


rasputin007@hotmail.co.uk
WWW Email
« Reply #14 on: October 18, 2007, 09:42:44 pm »

I managed to get mksquashfs 2.1 working under Windows with the help of cygwin. I just recomplied the squashfs-tools 2.1 under cygwin and copied the mksquashfs.exe into cygwin's /usr/bin and now I can create CG52 without leaving Windows. But I am still looking at unsquashfs 3.2 to work under cygwin as well, just needs a bit more work.
Logged

Nothing is impossible, only miracles take a bit longer!
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!

Bad Behavior has blocked 120 access attempts in the last 7 days.



Google visited last this page February 01, 2012, 10:11:56 am