Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Flashing MK808B from Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Flashing MK808B from Linux

    I'm trying to work out a way to flash Finless 2.0 BETA to my MK808B (looks like original version when comparing the pics found on this forums), without Windows, using Linux.

    I've downloaded MK808B Finless 2.0 ROM - BETA and MK808B_Original_JB_422_1080_kernel (which repairs an accidental incorrect kernel from my understanding).

    I've installed CWM using this (supposedly custom) version: http://vondroid.com/threads/how-to-f...on-mk808.7436/
    I've confirmed that I can boot into recovery mode using the rebooter tool and also using the reset pin hole turn on method. I was able to backup the current kernel to a mini sd card, and I've confirmed that stuff was copied to it.

    I'm assuming that I can now install .img files using this setup. Looking at the BETA package, I'm seeing the following files in the FinlessROM directory: boot720.img kernel720.img misc.img parameter1gb parameter2gb parameter4gb parameter6gb recovery.img RK30xxLoader(L)_V1.22.bin system.img

    The MK808B_Original_JB_422_1080_kernel archive contains images boot1080.img and kernel1080.img.

    My question is, can I flash using the CWM method, and replace the 720 images with the 1080 ones? If so, in which order should I get CWM to "restore" them? Also, what about the other files like the parameter files? Supposedly there is a way configure app space, but we're dealing with just restoring/installing img files through this method. Does the normal Windows .exe tool have a bunch of other functionality in it that I can't access without Windows? Is there a way to get the job done without Windows?

    #2
    Nocando?

    Bump...

    My guess is that, no, one can not simply pass the img files to cwm, because the new imgs are for different partition sizes. Plus possibly other issues that I'm not yet aware of.

    ?

    Comment


      #3
      Originally posted by Andromoid View Post
      Bump...

      My guess is that, no, one can not simply pass the img files to cwm, because the new imgs are for different partition sizes. Plus possibly other issues that I'm not yet aware of.

      ?
      i use linux all the time and was unable to do this under linux. I ended up using xp in virtualbox

      Comment


        #4
        There is really not much structured info out there about flashing with linux, here is a link to my question http://www.freaktab.com/showthread.p...8b-from-ubuntu
        I was able to confirm that the linux rkflashtool works. I used it successfully to clear the misc partition so finless1.7 can reboot from recovery loop, to overwrite my partitions and write them back. I am also quite sure that writing the recovery partition should work. But the big question remains for me, can I write the finless rom ... with
        A) cwm tools under android
        B) linux rkflashtool or similar

        In the win rk flash tool you have to clear the NAND and then overwrite the partitions. The tricky part is that when you install the finless rom with windows it changes the partition sizes on the NAND (thus the clear) The partitioning information is in the parameter file. Also you have to write the bootloader, which is in the RK30xxLoader(L)_V1.22.bin file. So far I have found no information on how to write these two files with either rkflashtool or one of these https://github.com/naobsd/rkutils or the cwm tools for android.

        Comment


          #5
          Originally posted by select View Post
          There is really not much structured info out there about flashing with linux, here is a link to my question http://www.freaktab.com/showthread.p...8b-from-ubuntu
          I was able to confirm that the linux rkflashtool works. I used it successfully to clear the misc partition so finless1.7 can reboot from recovery loop, to overwrite my partitions and write them back. I am also quite sure that writing the recovery partition should work. But the big question remains for me, can I write the finless rom ... with
          A) cwm tools under android
          B) linux rkflashtool or similar

          In the win rk flash tool you have to clear the NAND and then overwrite the partitions. The tricky part is that when you install the finless rom with windows it changes the partition sizes on the NAND (thus the clear) The partitioning information is in the parameter file. Also you have to write the bootloader, which is in the RK30xxLoader(L)_V1.22.bin file. So far I have found no information on how to write these two files with either rkflashtool or one of these https://github.com/naobsd/rkutils or the cwm tools for android.
          Hey select, I've posted in your other thread too - what do you think - if you've used the windows tool once -and flashed a Finless ROM, shouldn't the partition sizes be changed? Would that be sufficient to then use rkflashtool from then on? Curious what you think.

          Comment


            #6
            So far i could only test successfully overwriting the misc with zero data and that worked so my answers would be yes. I would now I use the linux rkflashtool to write new images, but I would check first if the partitions are still the same (as described in the other post). Also I'm not that afraid of bricking my mk808b anymore since the win tool shoul be able to overwrite everything if I mess up and there is always the option of clearing the NAND by shorting the pins if all goes wrong.
            Sry that I did not post to the other thread anymore but I'm quite short on time, but if I find out more I'll let you know.
            In another forum there is a long thread from the guys that develope picuntu that contains a lot of valuable information. What I will do as soon as I have a minute is to ask them if it's possible to write the bootloader and partitions with Linux tools.
            From what I read so far i think that the partition table is written to some partition (don't remember which currently) which is then read on boot and applied by some harwired mechanism.

            Comment


              #7
              I can tell you... NO ONE has figured out how to write anything other than the MTD partitions using Linux. Trust me I have looked and tried myself. I even went so far as using a USB capture/debugging tool to see what is going on and it was more work than I wanted to continue doing!

              This is one of the secrets HELD by Rockchip unless you pay them $20K for the SDK.

              While I love your enthusiasm for wanting to do it in Linux, I think you will hit the same wall many of us have hit. Not to try to discourage you, but MANY have tried including all the few great folks on XDA that have deeply looked at this.

              I will just say this. If anyone could figure it out.... It would probably be _fun from XDA. That guy can seemingly figure out much RK stuff that many of us dumb-asses cant


              Bob
              "Pzebacz im, bo nie wiedzą, co czynią"
              "Прости им, они не ведают, что творят"
              "Perdona loro perché non sanno quello che fanno"
              "Vergib ihnen, denn sie wissen nicht, was sie tun"
              "Vergeef hen want ze weten niet wat ze doen"
              "Pardonne-leur car ils ne savent pas ce qu'ils font"
              "Perdónalos porque no saben que lo que hacen"
              "Oprosti im, jer ne znaju što čine"
              "Forgive them as they know not what they do"





              Comment


                #8
                Originally posted by Finless View Post
                I can tell you... NO ONE has figured out how to write anything other than the MTD partitions using Linux. Trust me I have looked and tried myself. I even went so far as using a USB capture/debugging tool to see what is going on and it was more work than I wanted to continue doing!

                This is one of the secrets HELD by Rockchip unless you pay them $20K for the SDK.

                While I love your enthusiasm for wanting to do it in Linux, I think you will hit the same wall many of us have hit. Not to try to discourage you, but MANY have tried including all the few great folks on XDA that have deeply looked at this.

                I will just say this. If anyone could figure it out.... It would probably be _fun from XDA. That guy can seemingly figure out much RK stuff that many of us dumb-asses cant


                Bob
                hey thanks for the clarification, coming from you this is a rather disappointing answer because this means most likely this is the end of the line for the linux flashing but I will not give up completely yet since there were some hints in the thread with fun, oraclemoon, andrewdb ... dont rember all their names, that there might be some more knowledge out there. And if there are no tools then at least I want to learn and understand what is known right now. So far I had exiting two weeks since I got my mini pc and started reading and learing and actually getting your rom on my pc and picuntu to work.
                Thanks
                But i wonder, how did you manage to create the windows tool? Is there an api for the windows drivers out there (in english)?

                Comment


                  #9
                  I did not create the windows tool. I found the tool on a China web site and it was all in Chinese!
                  I simply edited the application resources, moved the buttons around, and put in proper button names etc in English.

                  Bob
                  "Pzebacz im, bo nie wiedzą, co czynią"
                  "Прости им, они не ведают, что творят"
                  "Perdona loro perché non sanno quello che fanno"
                  "Vergib ihnen, denn sie wissen nicht, was sie tun"
                  "Vergeef hen want ze weten niet wat ze doen"
                  "Pardonne-leur car ils ne savent pas ce qu'ils font"
                  "Perdónalos porque no saben que lo que hacen"
                  "Oprosti im, jer ne znaju što čine"
                  "Forgive them as they know not what they do"





                  Comment


                    #10
                    Originally posted by Finless View Post
                    I did not create the windows tool. I found the tool on a China web site and it was all in Chinese!
                    I simply edited the application resources, moved the buttons around, and put in proper button names etc in English.

                    Bob
                    Ah ic, well this really sounds like we need somebody with experiences in reverse engineering to create a linux flash tool. May I also ask about the bootloader and the param file: did I understand this right that the param file contains the partition table? And if yes did you repartition the NAND by just modifying the param file? And for the booloader ( RK30xxLoader(L)_V1.22.bin thats it right?) did you write this or what is it based on? And one final question: do you mind if I write all this up at some point and put it on a public google doc?

                    Comment


                      #11
                      The loader is a mystery! Only people that pay the $20K to Rockchip and get the SDK get to know what it does fully. I took it apart and there are at least 3 programs inside from what I can tell.

                      The rockchip boot process is this:

                      Loader runs and looks in misc.img depending on what is in there it takes a branch. Misc.img is empty except for a text command that is in the middle. (hex 4000 as I recall).
                      I forget all the commands that can be in there now but it's stuff like
                      boot recovery
                      boot recovery erase
                      if it is empty it just boots.

                      So loader processes that and then either boots or boots into recovery and erases user NAND space. In fact if you do a factory reset from settings it writes the erase command to misc.img and reboots to recovery.

                      Now loader also looks at the parameter file to know how to setup MTD.

                      The flash tool also looks at the parameter file to erase NAND and setup the partitions. How that is done by the flash tool is a mystery!

                      I explain how the parameter file works in this post:




                      Bob
                      "Pzebacz im, bo nie wiedzą, co czynią"
                      "Прости им, они не ведают, что творят"
                      "Perdona loro perché non sanno quello che fanno"
                      "Vergib ihnen, denn sie wissen nicht, was sie tun"
                      "Vergeef hen want ze weten niet wat ze doen"
                      "Pardonne-leur car ils ne savent pas ce qu'ils font"
                      "Perdónalos porque no saben que lo que hacen"
                      "Oprosti im, jer ne znaju što čine"
                      "Forgive them as they know not what they do"





                      Comment


                        #12
                        writing param file in linux

                        so writing the param file in linux is possible http://forum.xda-developers.com/show...php?p=20871896

                        simple method (copy of the post)


                        rkflashtool r 0x0 0x2000 >orgparams

                        Cut off the first 8 bytes of the file (PARM+4 Byte length, which you should write down - your file should now start with "FIRMWARE"); cut off all after "(user) 0x0d 0x0a" - its the 4-byte checksum.

                        Add the checksum:

                        rkcrc myparams myparamswithcrc

                        now re-add the 8 Byte header (PARM+size, where the size actually should not have changed, so you probably can take the old value you wrote down. Else just take the filesize of the naked file before adding the checksum - you need it in HEX and turn around all bytes!)

                        Now you can flash back your params. On my tablet those parameters are stored every 20 blocks about 5 times (probably for recovery or something)
                        So I overwrote all 5 blocks like this:

                        rkflashtool w 0x00 0x20 <myparamswithcrc
                        rkflashtool w 0x20 0x20 <myparamswithcrc
                        rkflashtool w 0x40 0x20 <myparamswithcrc
                        rkflashtool w 0x60 0x20 <myparamswithcrc
                        rkflashtool w 0x80 0x20 <myparamswithcrc

                        Boot the device (might take long) and go to settings->privace->factory data reset

                        --------------------------------
                        ATTENTION: I did not test this just copied everything together for convenience, what would be nice if this whole process could be put into a script that automates this

                        what I guess from this is that the mysterious windows rk flash tool does the recalc of the userdata automatically

                        now "only" writing the bootloader remains

                        Comment


                          #13
                          Originally posted by select View Post
                          Boot the device (might take long) and go to settings->privace->factory data reset
                          just a thought, but could this be simplified by writing one of the "string commands" into misc?

                          Comment


                            #14
                            Recovery will not repartition that I am aware of. This is why even if you modify update.img with a different parameter file, it wont repartition. It just formats what's is there.

                            Again the flash tool is what repartitions.

                            But if you find something that works like that, power to ya!

                            Bob
                            "Pzebacz im, bo nie wiedzą, co czynią"
                            "Прости им, они не ведают, что творят"
                            "Perdona loro perché non sanno quello che fanno"
                            "Vergib ihnen, denn sie wissen nicht, was sie tun"
                            "Vergeef hen want ze weten niet wat ze doen"
                            "Pardonne-leur car ils ne savent pas ce qu'ils font"
                            "Perdónalos porque no saben que lo que hacen"
                            "Oprosti im, jer ne znaju što čine"
                            "Forgive them as they know not what they do"





                            Comment


                              #15
                              Originally posted by Finless View Post
                              Recovery will not repartition that I am aware of. This is why even if you modify update.img with a different parameter file, it wont repartition. It just formats what's is there.

                              Again the flash tool is what repartitions.

                              But if you find something that works like that, power to ya!

                              Bob
                              Hi Bob, nice to meet you. Is there a way to repartition without using a connected PC? If not, and if I must use the rkbatchtool from Linux, when I do that (I haven't figured at all out yet how even to do that), would that destroy the installed CWM loader, recovery loader, boot loader, pre boot loader, whatever the heck it is?
                              On Linux, I'd normally expect that if I repartition all the partitions, nothing is left after that, except maybe the MBR. However, one could free the bottom partitions, and then re-add the partitions with a different size, leaving the top partition(s) in place. Normal fdisk type of stuff.
                              Using rkbatchtool, is it kind of the same? Could one have CWM on it, repartition without touching the top partition (boot partition?), and then boot into recovery, then ready to accept the new ROM?
                              I have the feeling that a few light bulbs will be going off on my end...

                              Alternatively, could an App exist that repartitions without touching CWM, after which of course it'd have to reboot right away, because it'd have literally nuked the entire environment from underneath itself...?

                              Comment

                              Working...
                              X