02-03-2010, 11:34 AM | #46 |
Junior Member
Posts: 6
Karma: 38
Join Date: Feb 2010
Device: V5
|
I´ve only tried to decompress the image and not mount it. I think that if you can decompress to a directory, make changes and recreate a valid image then you can do everything you need (mounting the image is a more easy way, but I´m a newbie in too many things to attack this option.
Actual state: A very simple modification to the cramfs.h file from the diskutil package let you decompress the ro.fs.v5 without problem. The package can be found in http://packages.debian.org/es/sid/util-linux and download the sources. The modification is in the i-node definition section #define CRAMFS_MODE_WIDTH 16 #define CRAMFS_UID_WIDTH 16 #define CRAMFS_SIZE_WIDTH 24 #define CRAMFS_GID_WIDTH 8 #define CRAMFS_NAMELEN_WIDTH 24 #define CRAMFS_OFFSET_WIDTH 32 /* * Reasonably terse representation of the inode data. */ struct cramfs_inode { u32 mode:16, uid:16; /* SIZE for device files is i_rdev */ u32 size:24, gid:8; /* NAMELEN is the length of the file name, divided by 4 and rounded up. (cramfs doesn't support hard links.) */ /* OFFSET: For symlinks and non-empty regular files, this contains the offset (divided by 4) of the file data in compressed form (starting with an array of block pointers; see README). For non-empty directories it is the offset (divided by 4) of the inode of the first file in that directory. For anything else, offset is zero. */ u32 unknown:8, namelen:24; u32 offset:32; }; I don´t know the sense of the unknown field. The root.fs.v5 has another problem. There is a file with excess of pointers to blocks (exactly 8192). The cramfs format is Header: Information about the file, number of files, blocks,... I-node zone:Structured data with i-nodes followed for name of files/directories. The i-nodes contain the offset to the file data. Data zone: Every file has 1) a number of pointers (file size / page_size +1 aprox.) pointing the next byte after the last data of this block 2) the data for every block In the root.fs.v5 image I've found that the /root/adobe has a special format. In the buggins 20091005 the inode states a size of 2423580 so 592 pointers are needed, but in offset+592*4 there are more pointers. The real data starts in offset+592*4+8192*4. Moreover the last teorical block of the adobe file has a decompressed size of 4096 bytes but to complete the file only last 1800 (or so) bytes, and the 8192th block has the right decompressed size to finish the adobe file. So if the adobe file has 592 pointers you can find in the file p1 p2 p3 ... p591 p592 p1+ ... p8192+ where p1 to p591 and p8192+ are for adobe file p592 to p8191+ create a file non described in the inode structure and a decompressed size about 32MB. This file is identified as data by "file -s" command. I´ve checked two firmwares and this file is different. The root.fs.v5 has a padding after the data zone; the data are padded with 00 to 4096 bytes round, and the file to a size of 0x730000 bytes is FF padded. Unresolved questions: ¿Is there mistakes in the inode estimated structure? ¿What is the 32 MB file? ¿why is inserted in the adobe file? ¿Is it really needed? Waiting for your ideas. Regards Qbspin Last edited by Qbspin; 02-04-2010 at 01:41 AM. |
02-04-2010, 05:42 AM | #47 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: Hanlin v5
|
Hello,
Thanks Qbspin! Following Qbspin's instructions, and using cramfs tools I could unpack both ro.fs.v5 and root.fs.v5 (with some errors though): ro.fs.v5 Code:
root@ubuntu:~/cramfs-1.1$ ./cramfsck -x /tmp/ro.fs.v5 ../firmware-tools/ro.fs.v5; ls -Rla /tmp/ro.fs.v5 warning: file extends past end of filesystem ./cramfsck: mknod failed: /tmp/ro.fs.v5/dev/console: Operation not permitted /tmp/ro.fs.v5: total 44 drwxr-xr-x 4 root root 4096 2010-02-04 11:24 . drwxrwxrwt 16 root root 24576 2010-02-04 11:24 .. drwxr-xr-x 2 root root 4096 2010-02-04 11:24 bin -rw-r--r-- 1 root root 775 1970-01-01 01:00 control.txt drwxr-xr-x 2 root root 4096 1970-01-01 01:00 dev /tmp/ro.fs.v5/bin: total 1092 drwxr-xr-x 2 root root 4096 2010-02-04 11:24 . drwxr-xr-x 4 root root 4096 2010-02-04 11:24 .. lrwxrwxrwx 1 root root 7 2010-02-04 11:24 addgroup -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 adduser -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ash -> busybox -rwxr-xr-x 1 root root 73 1970-01-01 01:00 autologin -rwxr-xr-x 1 root root 712608 1970-01-01 01:00 busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 cat -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 catv -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 chattr -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 chgrp -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 chmod -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 chown -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 cp -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 cpio -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 date -> busybox -rwxr-xr-x 1 root root 7396 1970-01-01 01:00 dbus-cleanup-sockets -rwxr-xr-x 1 root root 277248 1970-01-01 01:00 dbus-daemon -rwxr-xr-x 1 root root 14748 1970-01-01 01:00 dbus-launch -rwxr-xr-x 1 root root 10532 1970-01-01 01:00 dbus-monitor -rwxr-xr-x 1 root root 13420 1970-01-01 01:00 dbus-send -rwxr-xr-x 1 root root 5264 1970-01-01 01:00 dbus-uuidgen lrwxrwxrwx 1 root root 7 2010-02-04 11:24 dd -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 delgroup -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 deluser -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 df -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 dmesg -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 dumpkmap -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 echo -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ed -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 egrep -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 false -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 fdflush -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 fgrep -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 getopt -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 grep -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 gunzip -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 gzip -> busybox -rwxr-xr-x 1 root root 3392 1970-01-01 01:00 hardwatchdog lrwxrwxrwx 1 root root 7 2010-02-04 11:24 hostname -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ip -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ipaddr -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ipcalc -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 iplink -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 iproute -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 iprule -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 iptunnel -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 kill -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ln -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 login -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ls -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 lsattr -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mkdir -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mknod -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mktemp -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 more -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mount -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mountpoint -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mt -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 mv -> busybox -rwxr-xr-x 1 root root 45092 1970-01-01 01:00 nanowm lrwxrwxrwx 1 root root 7 2010-02-04 11:24 netstat -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 nice -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 pidof -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ping -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ping6 -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 pipe_progress -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 printenv -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 ps -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 pwd -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 rm -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 rmdir -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 rpm -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 run-parts -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 sed -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 sh -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 sleep -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 stat -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 stty -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 su -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 sync -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 tar -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 touch -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 true -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 umount -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 uname -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 uncompress -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 usleep -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 vi -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 watch -> busybox lrwxrwxrwx 1 root root 7 2010-02-04 11:24 zcat -> busybox Code:
root@ubuntu:~/cramfs-1.1$ ./cramfsck -x /tmp/root.fs.v5 ../firmware-tools/root.fs.v5; ls -Rla /tmp/root.fs.v5 warning: file extends past end of filesystem ./cramfsck: data block too large /tmp/root.fs.v5: total 36 drwxr-xr-x 3 root root 4096 2010-02-04 11:25 . drwxrwxrwt 17 root root 24576 2010-02-04 11:25 .. drwxr-xr-x 2 root root 4096 2010-02-04 11:25 root /tmp/root.fs.v5/root: total 4868 drwxr-xr-x 2 root root 4096 2010-02-04 11:25 . drwxr-xr-x 3 root root 4096 2010-02-04 11:25 .. lrwxrwxrwx 1 root root 4 2010-02-04 11:25 abook -> /mnt -rwxr-xr-x 1 root root 0 2010-02-04 11:25 adobe -rw-r--r-- 1 root root 12964 1970-01-01 01:00 .muttrc -rw-r--r-- 1 root root 4958208 1970-01-01 01:00 Resource.irf lrwxrwxrwx 1 root root 25 2010-02-04 11:25 System.ttf -> fonts/truetype/simsun.ttf To be honest I don't know if the inode structure is correct. As far as I know: File sizes are limited to less than 16MB. (via wikipedia). That adobe file may be related to the Adobe® Digital Editions software.. Regards, Paul. |
02-04-2010, 07:14 AM | #48 |
Junior Member
Posts: 6
Karma: 38
Join Date: Feb 2010
Device: V5
|
The reason for "data block too large" error is that the program don´t care about the extras pointers so think the first block begin 0x8000 byte before, so the block is larger than 4096 bytes.
user.fs.v5 file has a jffs2 filesystem, so is not a cramfs. To mount a jffs2 (see http://www.esubuntu.com/how_to_mount_a_jffs2_image that refer to http://alanren.com/archives/12 ) you can $ mknod /tmp/mtdblock0 b 31 0 $ modprobe mtdblock $ modprobe mtdram total_size=65536 erase_size=256 $ modprobe jffs2 $ dd if=/path_to_image/image_name of=/tmp/mtdblock0 $ mkdir /media/jffs2 $ mount -t jffs2 /tmp/mtdblock0 /media/jffs2 But I think the user.fs.v5 file is useless. Libraries and exec are in root.fs.v5 Regards. Qbspin |
02-04-2010, 08:37 AM | #49 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: Hanlin v5
|
Hello,
Maybe those files have been compressed using Cromfs: Compressed ROM filesystem for Linux (user-space). At least, that's what the file command says: Code:
$ file root.fs.v5 root.fs.v5: Linux Compressed ROM File System data, little endian size 76468224 version #2 sorted_dirs CRC 0x9c06a023, edition 0, 30018 blocks, 459 files Regards |
02-05-2010, 06:12 AM | #50 |
Researcher and Consultant
Posts: 210
Karma: 364
Join Date: Nov 2008
Location: Bangkok, THAILAND
Device: MACBOOKPRO17" HP2400TX SONYUX27
|
This is what i stuck over months for non-standard cramfs with v5 (due to russian information, BUGGIN)
Only can make now is disassemble and assemble with new logo. |
02-05-2010, 05:04 PM | #51 |
Junior Member
Posts: 6
Karma: 38
Join Date: Feb 2010
Device: V5
|
I think I got it. The adobe file wasn´t composed with a very large file: the adobe file is bigger than 32 Mb and the size in i-node is only 24 bits. The solution is used the "data block too large" as a flag of a >32MB file.
I´ve just try to decompress the image, add a file, recompress (with mkcram_32M) and pack it AND works... The firmware load and boot normally. I´d published a new version of tools (including the decompressor) in this link http://www.megaupload.com/?d=7MRYIZDG The unpack_v5 extracts files from image, decompress ro.fs.v5 and root.fs.v5 files in rofs.v5 and rootfs.v5 directories. The pack_v5 compress rofs.v5 and root.fs.v5 directories in ro.fs.v5 and root.fs.v5, and creates the v5setup.bin file. I hope you´ll find useful. QBspin Last edited by Qbspin; 02-05-2010 at 05:52 PM. |
02-05-2010, 06:52 PM | #52 | |
Wizard
Posts: 1,047
Karma: 203682
Join Date: Oct 2009
Device: Libre 2
|
Quote:
Well done, I only tried the unpack so far, and it worked. |
|
02-06-2010, 09:54 AM | #53 |
Junior Member
Posts: 6
Karma: 38
Join Date: Feb 2010
Device: V5
|
Thanks jusmee.
Previous implementation only deals with files >32MB and <48MB. Actual release v1.1 will accept files <64MB. http://www.megaupload.com/?d=C8L4PPKA Qbspin Last edited by Qbspin; 02-07-2010 at 05:53 AM. |
02-08-2010, 12:03 PM | #54 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: Hanlin v5
|
Hello,
Hey! It's great that you finally found out how to decompress the image. I'll try to apply the patch to fsck.cramfs and see what the binary contains... Thanks a lot! Paul. |
02-09-2010, 03:12 AM | #55 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: Hanlin v5
|
Hello,
I'm trying to patch cramfsck in Ubuntu. I have downloaded cramfs tools, but I can't patch cramfsck.c. Looks like it's a diferent file: fsck.cramfs.c... Could you please explain how to apply the patch? Thanks again! Paul. |
02-09-2010, 01:15 PM | #56 |
Junior Member
Posts: 6
Karma: 38
Join Date: Feb 2010
Device: V5
|
The patch is for fsck.cramfs.c included in the util-linux package. You can find the sources http://packages.debian.org/es/sid/util-linux . Is a big package to only use the cramfs files.
Here you can find version 1.2 with patch for cramfstools. http://www.megaupload.com/?d=LX34XPF5 Bye QBSpin Last edited by Qbspin; 02-11-2010 at 10:29 AM. |
02-11-2010, 12:39 PM | #57 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2010
Device: Hanlin v5
|
Thanks!
You're a crack! I'll try that tomorrow. Regards |
02-14-2010, 10:35 AM | #58 |
∂₪≈☼
Posts: 113
Karma: 550104
Join Date: Jan 2010
Device: ιη.σιγ.ηιφι.κα
|
Does anybody know if it is possible to change the steps for moving the window to left/right (</> keys)? At the zoom level I am working with in landscape, it moves the window all the way to the left/right. It would be nice if the program had a "center view" option (using the rarely used bookmark keys 1-4) and even better, a continuous page shifting mode. Yet, it is still an awesome development that made me choose Hanlin V3 over a couple more elegant/larger devices with lack of such a powerful support.
Thank you Tigran! |
02-15-2010, 12:02 AM | #59 |
∂₪≈☼
Posts: 113
Karma: 550104
Join Date: Jan 2010
Device: ιη.σιγ.ηιφι.κα
|
I'm not sure about this but I think the reason you can't move the page (to left/right) after it is fully contained within the screen (horizontally) is b/c of the conditions Tigran has put in lines 754 and 767 of libdjvu.c file. I think if you make those conditions trivial then you could move the page to left/right indefinitely. Unfortunately I am not running Linux on my machine these days and can't compile the files to check it.
|
02-19-2010, 03:50 AM | #60 | |
Zealot
Posts: 140
Karma: 23528
Join Date: Nov 2009
Location: London
Device: Kobo Aura One,HD,H2O,Touch,Mini,Kindle 3+DXG,Nook Simple Touch
|
Quote:
1. Press "OK" to open menu and select "Enter horizontal step". 2. Enter some small value (e.g. 1% is the closest to your desired "continuous movement" mode). 3. Now try pressing > and < buttons on the left side (i.e. NOT '9' and '0'). The window will shift horizontally. |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
iLiad My djvu viewer | ericshliao | iRex Developer's Corner | 8 | 10-17-2010 08:28 AM |
iLiad DJVU Viewer in Java on the iLiad | scotty1024 | iRex Developer's Corner | 61 | 07-14-2010 10:36 PM |
iLiad has a djvu viewer for Chinese fiimware ? | laozhang | iRex Developer's Corner | 0 | 04-26-2010 08:56 PM |
Full-Screen Panning Picture bug on Kindle 2 | forkyfork | Amazon Kindle | 5 | 05-21-2009 04:27 PM |
iLiad DJVU viewer? | riccioberto | iRex Developer's Corner | 5 | 01-06-2008 10:23 AM |