Jump to content


Photo

Rk29xx ImageTools V2.1


  • Please log in to reply
89 replies to this topic

#21 sstavross

sstavross

    Member

  • Jr. Member
  • PipPip
  • 15 posts

Posted 15 September 2011 - 11:43 AM

Hi!

I don't know if I am off topic, but I've just purchased an android tv box based on rockchip 2918(R-box says the model). Anyway I have found nothing about this box, no upgrade instructions no firmware updates or download. Is there any option to somehow "extract" the current firmware image from the device and open it with this tool? It is my first android device so excuse my ignorance...

#22 Aiah

Aiah

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 106 posts

Posted 16 September 2011 - 06:11 AM

Hi!

I don't know if I am off topic, but I've just purchased an android tv box based on rockchip 2918(R-box says the model). Anyway I have found nothing about this box, no upgrade instructions no firmware updates or download. Is there any option to somehow "extract" the current firmware image from the device and open it with this tool? It is my first android device so excuse my ignorance...



(1) There are way's to extract the current firmware parts from a running device
But you will need root access for that.

(2) The firmware parts extracted that way will not be the complete firmware and therefore wont be compatible with this tool.

#23 TYZ

TYZ

    Newbie

  • Jr. Member
  • Pip
  • 4 posts

Posted 16 September 2011 - 07:49 AM

using the firmwaretool it extracts

boot.img
kernel.img
misc.img
recovery.img
system.img (system img is a cramfs filesystem)


boot.img and recovery.img are cpio initrd files encapsulated in a head and a footer...

contents of boot.img
bytes 0..3 KNRL (header) (?KRNL) (removed ok)
bytes 4..7 size of initrd data (header) (removed ok)
bytes 8..# initrd data (?#)
bytes #+1..#+4 4bytes check code (footer) (?#+1..#+4)


Does anyone know how to calculate the footer value ?

filling own request:
rkcrc tool from https://sites.google...let/apad-irobot seems to work.


Hi Aiah.

im am trying to make my own boot image.
could you give me some more info on how to remove the footer.
i removed the header files unpack ok.
but when i make no changes and re cpio and gzip the file and make image with rkcrc the files are not the same.
it is a little bit bigger.
i did change the header to KRNL.
its the remove footer that did not do.dont understand how to.

fview 7" pro rooted

#24 Aiah

Aiah

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 106 posts

Posted 16 September 2011 - 09:21 AM

Hi Aiah.

im am trying to make my own boot image.
could you give me some more info on how to remove the footer.
i removed the header files unpack ok.


[update]
ungzipping the boot.img with header removed but with the footer in place will also work.
it will only generate an warning about traling garbage
removeing the footer will create a clean gzipped initrd witch unpackes without an error
[/update]

** unpacking initrd.gz for boot.img **
1) use hexeditor to retrieve bytes 3..4 from header "3f 68 02 00" = 157759 decimal
2) dd if=boot.img of=initrd.gz skip=8 bs=1 count=157759
3) verify for errors gzip -t initrd.gz
- there should be no errors
4) mkdir root;cd root;zcat ../initrd.gz|cpio -idm

but when i make no changes and re cpio and gzip the file and make image with rkcrc the files are not the same.
it is a little bit bigger.



Its almost impossible to recreate the exact initrd.gz
Your newly created initrd.gz is probaby also different in size then then original initrd.gz

** rebuilding (an almost exact initrd.gz) **
1) cd root
2) find . -exec touch -d "1970-01-01 01:00" {} \;
3) find . ! -name "."|sort|cpio -oa -H newc --owner=root:root|gzip -n >../newinitrd.gz
4) cd ..

P.S. if you unzip the new and the old initrd.gz and compare them you will see that the cpio headers are different an some places

i did change the header to KRNL.
its the remove footer that did not do.dont understand how to.

fview 7" pro rooted


dont forget the -p argument

1) rkcrc -p initrd.gz newboot.img
p.s. rebuilding an unmodified initrd.gz should give identical boot.img

Edited by Aiah, 16 September 2011 - 12:27 PM.


#25 sstavross

sstavross

    Member

  • Jr. Member
  • PipPip
  • 15 posts

Posted 16 September 2011 - 10:44 AM

(1) There are way's to extract the current firmware parts from a running device
But you will need root access for that.

(2) The firmware parts extracted that way will not be the complete firmware and therefore wont be compatible with this tool.


Dear Aiah,

Thank you for your detail answer! So I'll have to wait until I'll find an updated firmware for download.

#26 fun_

fun_

    Advanced Member

  • Hero Member
  • PipPipPip
  • 525 posts

Posted 16 September 2011 - 09:14 PM

(2) The firmware parts extracted that way will not be the complete firmware and therefore wont be compatible with this tool.


hi

I'm guessing RKDeviceManage.exe can also handle update.img, but I'm not sure some things about new rom format/tool for RK2918.

I checked T760 official ROM. as you know it contains 2 file, bootloader and update.img. but update.img also contains bootloader inside in it. these 2 bootloaders are different (at least in 2.03 rom for T760), 1st one says 400MHz and 2nd one says 333MHz(probably DDR2 speed). probably 1st one is actually used/flashed. and, comparing to rk28x8, HWDEF file is missing.

if RKDeviceManage can flash update.img, all we need is prepare update.img properly.
does someone try to load update.img into RKDeviceManage.exe?
(for now, I don't say about flashing update.img into tablet, just loading it to windows program)

----
btw someone has interest about cyanogenmod on RK2918? I don't have any RK2918 tablet(I want T760 but bit expensive in local shop), but probably I can help a little someone who want to make it.
http://androtab.info/

#27 jkpjj

jkpjj

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 130 posts

Posted 17 September 2011 - 04:47 PM

I have some interest for cyanogenmod (I've been using it on a couple of android phones), but might be hard to get it to build as cyanogenmod doesn't seem to have the rk2918 stuff. But hopefully they or at least part of them will show up at git://gitorious.org/archos/archos-gpl-gen9-kernel.git

btw someone has interest about cyanogenmod on RK2918? I don't have any RK2918 tablet(I want T760 but bit expensive in local shop), but probably I can help a little someone who want to make it.



#28 fun_

fun_

    Advanced Member

  • Hero Member
  • PipPipPip
  • 525 posts

Posted 19 September 2011 - 03:52 AM

I have some interest for cyanogenmod (I've been using it on a couple of android phones), but might be hard to get it to build as cyanogenmod doesn't seem to have the rk2918 stuff. But hopefully they or at least part of them will show up at git://gitorious.org/archos/archos-gpl-gen9-kernel.git


I'm not sure how that repo helps to make CM. if kernel source for target tablet is available(I don't think so), it's very nice. but CM can be made without it. it may not be "perfect", but I don't think I can make perfect ROM with or without it. it's really hard work.

what I said is I think I can make CM7 for RK2918 as (hopefully)same level as I made/am making it for RK2818 and Telechips tablets. anyway, I don't have any RK2918 tablet, and no answer yet. I can do it without real tablet (as I did) but there is no reason to do it without real user :(

sorry for noise.
http://androtab.info/

#29 extraterrestrial

extraterrestrial

    Newbie

  • Jr. Member
  • Pip
  • 1 posts

Posted 21 September 2011 - 01:52 PM

Dear Aiah thank you!
I long time seek how extract boot.img and recovery.img.

And can extract kernel.img?
I want try boot android in QEMU and debugging my firmware in QEMU

#30 Aiah

Aiah

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 106 posts

Posted 22 September 2011 - 02:07 PM

Dear Aiah thank you!
I long time seek how extract boot.img and recovery.img.

And can extract kernel.img?
I want try boot android in QEMU and debugging my firmware in QEMU



check entry #24 boot.img kernel.img work the same way.
i dont know about recovery.img (but i'm guesing its the same as hot system.img works)

Edited by Aiah, 22 September 2011 - 02:08 PM.


#31 jkpjj

jkpjj

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 130 posts

Posted 27 September 2011 - 05:08 AM

Ah, sorry, my mistake - yes, of course kernel is not a requirement, I was talking nonsense.

I installed cyanogenmod on the Motorola Milestone, seems to work OK, though there was one android reboot so far in a couple of days.

If you put together a cyanogen distribution for rk2918, I'm willing to test it, and perhaps start using it as a regular - there are advantages to having similar setups on different devices.

I'm not sure how that repo helps to make CM. if kernel source for target tablet is available(I don't think so), it's very nice. but CM can be made without it. it may not be "perfect", but I don't think I can make perfect ROM with or without it. it's really hard work.

what I said is I think I can make CM7 for RK2918 as (hopefully)same level as I made/am making it for RK2818 and Telechips tablets. anyway, I don't have any RK2918 tablet, and no answer yet. I can do it without real tablet (as I did) but there is no reason to do it without real user :(



#32 sstavross

sstavross

    Member

  • Jr. Member
  • PipPip
  • 15 posts

Posted 30 September 2011 - 11:11 AM

I tried to unpack a P71 rom i found somewhere on the www.teclast.com bbs board. [teclast-P71-V2.08-026F.rar]

Your tools unpack the firmware.img
but fails to extract the system.img cramfs [cramfsck: bad root offset (0)]
The file header does look like a valid cramfs

Any idea's. on how to unpack (and repack) this cramfs type ?


Hi Aiah!

I tried also to unpack a firmware I found for my google tv box and I get the same message [cramfsck: bad root offset (0)]. Did you find a solution for this?

#33 Aiah

Aiah

    Advanced Member

  • Jr. Member
  • PipPipPip
  • 106 posts

Posted 01 October 2011 - 10:58 AM

Hi Aiah!

I tried also to unpack a firmware I found for my google tv box and I get the same message [cramfsck: bad root offset (0)]. Did you find a solution for this?


Sorry no.
Looks like the cramfs of the new roms are incompatible with the scandard linux cramfs tools

#34 fun_

fun_

    Advanced Member

  • Hero Member
  • PipPipPip
  • 525 posts

Posted 01 October 2011 - 06:45 PM

Sorry no.
Looks like the cramfs of the new roms are incompatible with the scandard linux cramfs tools


did you try decrypt it like as rk2818 system.img?
http://androtab.info/

#35 sstavross

sstavross

    Member

  • Jr. Member
  • PipPip
  • 15 posts

Posted 03 October 2011 - 03:24 AM

did you try decrypt it like as rk2818 system.img?


Hi Fun_!

How to do it? Is there any tool to try it? Please give me some links...

#36 fun_

fun_

    Advanced Member

  • Hero Member
  • PipPipPip
  • 525 posts

Posted 03 October 2011 - 08:06 AM

Hi Fun_!

How to do it? Is there any tool to try it? Please give me some links...


rkDecrypt.exe will do it. but sorry, I think cramfsck will say "superblock magic not found" if it's encrypted cramfs. so it may not help you...
http://androtab.info/

#37 sstavross

sstavross

    Member

  • Jr. Member
  • PipPip
  • 15 posts

Posted 03 October 2011 - 09:31 AM

So no luck... Any other ideas? the firmwareupdate is in this link if anyone is interested:
http://www.maxq.com....gory/16-maxq-r7
  • dicksoft likes this

#38 SpoinkyNL

SpoinkyNL

    Newbie

  • Jr. Member
  • Pip
  • 3 posts

Posted 05 October 2011 - 02:20 AM

Using the tools provided in this topic helped me and a friend a great lot on getting a custom ROM on the Xiron ATP7483, thank you very much!

#39 gretlz

gretlz

    Newbie

  • Jr. Member
  • Pip
  • 1 posts

Posted 19 October 2011 - 09:39 PM

Hi Mr.Wendal, please help us to solve this prob. I got same problem, [cramfsck: bad root offset (0)] in system.img unpacking. I've successfully unpack update.img using AFPTool.exe. But I can't unpack the system.img, I've tried using rkDecrypt.exe, but it says no crypted file. so what am I gonna do now?
  • dicksoft likes this

#40 dicksoft

dicksoft

    Newbie

  • Jr. Member
  • Pip
  • 1 posts

Posted 20 October 2011 - 02:46 AM

So no luck... Any other ideas? the firmwareupdate is in this link if anyone is interested:
http://www.maxq.com....gory/16-maxq-r7



The link doesn't work..