Announcement

Collapse
No announcement yet.

RockChip ROM Building Tips and Tricks by Finless

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • RockChip ROM Building Tips and Tricks by Finless

    At Finless Bob's request I'm starting this thread to collect information about the tools and techniques for unpacking, modding and building of ROMs for the Nextbook Premium 7.

    Any contributions will be welcome.

    Randy R.

  • #2
    OK so whats the first question you all have?

    Bob
    "Przebacz 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 lo que hacen"
    "Oprosti im, jer ne znaju što čine"
    "Atyám, bocsásd meg nekik, mert nem tudják mit cselekszenek!"
    "Odpusť jim, neboť nevědí, co činí"
    "Πάτερ άφες αυτοίς, ού γάρ οίδασι τί ποιούσι"
    "Ojcze, przebacz im, bo nie wiedzą, co czynią"
    "Forgive them as they know not what they do"

    Comment


    • #3
      Question about tools

      Bob,

      First question is what set of tools you're using to unpack the .img files?
      - I found Wendal's RK2918 tools but I couldn't unpack the system.img from your build.
      - I could however unpack the one that came from the nextbook recovery kit zip file.

      Second question is whether you've got notes on the basic procedure for unpacking, removing apps, making changes and then repacking to build a loadable image set. I haven't had the time to scour the forums but if you've got some links to posts that might be helpful I can probably start putting it all together.

      That's probably good for starters.

      I'd like to just try it and see if I could build one that would actually run on my tablet.

      Thanks,

      Randy R.

      Comment


      • #4
        OK the Wendal tool was made to specifically unpack manufacturers update.img for RK29 ROMs that the system.img is in cramfs format! If system.img is in another format Wendal's tool will not unpack system.img. However it will still pull out all the .img's into the TEMP folder.

        However with that said. It is again specific to certain constucted update.img's I have done other ROMs where wendals tool would NOT unpack the update.img. For instance the Momo7 Tablet update.img it would not handle.

        You do not use Wendal's tool if the ROM package is setup like mine where the img's are all pulled out anyway.

        Now another note. Some ROM makers are screwing with the cramfs format to keep people from easily getting at system.img!!!! For instance the Polaroid tablet. You could not mount the cramfs system in Linux!!! SO someone made another version of cramfs called cramfs1.1. It is not a mounting tool but it unpacks cramfs images and is modified to handle the messed up cramfs systems some ROM have. Some people are calling it crapfs


        Finally if your going to do this, you are not going to be fully successful in Windows. I started that way and even tried cgywin to try and keep from installing and learning linux. I gave up. So you do need linux as some tools or scripts only work in a real linux setup!
        What I did was
        1) Download VirtualBox. This a a VM environment
        2) Created a new VM and installed the latest Ubuntu Linux on it.
        This gives me both worlds at one time. I do not have to dual boot between windows and linux.

        So now the first lesson. How to see the files and change them in system.img

        Most ROMs the system.img is either cramfs, ext3 or ext4. Some may even be yaffs.

        All you need to do in linux is mount the system.img!!! Super easy!

        So in linux you do this:

        First make a directory for the mount

        mkdir system

        Now mount the system.img. If your unsure of the format you can try to see if linux can figure it out with the simple mount command (FYI for Ubuntu and some distros you need to use sudo to get superuser permissions)

        sudo mount -o loop system.img system

        If you get an error you may have to specifiy the file system type. Here are two different commands. One if for cramfs and the other is for ext3:

        sudo mount -t cramfs -o loop system.img system

        sudo mount -t ext3 -o loop system.img system

        Once you have it mounted simply browse into the system folder you created and all the files will be there! You can edit, delete, add, etc. When adding be careful you do not over fill the system.img. It is a static size so many times puting files in, you will get an error!

        Once you all done just unmount system. It will close the system.img and if you look the system folder will now be empty again. The command to unmount is:

        sudo umount system


        OK first lesson over.... I am going to dinner and probably on the couch after that. So next answer will be in the AM.

        Bob
        "Przebacz 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 lo que hacen"
        "Oprosti im, jer ne znaju što čine"
        "Atyám, bocsásd meg nekik, mert nem tudják mit cselekszenek!"
        "Odpusť jim, neboť nevědí, co činí"
        "Πάτερ άφες αυτοίς, ού γάρ οίδασι τί ποιούσι"
        "Ojcze, przebacz im, bo nie wiedzą, co czynią"
        "Forgive them as they know not what they do"

        Comment


        • #5
          Bob,

          Thanks for taking the time to go into so much detail. That will get a lot if us off and running.

          I've been a UNIX Sysadmin for a number if years so am familiar with the command line stuff and working with file systems so i'll be able to dive right in.

          Randy R.


          Sent from my SGH-T959 using Tapatalk

          Comment


          • #6
            I'm also starting to go through the Rockchip rooting and other forums so hopefully will be able to pick up a lot more now that you've provided the basics. Will try to ask questions only about what I can't figure out on my own.

            Randy R.

            Sent from my SGH-T959 using Tapatalk

            Comment


            • #7
              OK so I know many want to learn.

              So why no questions?
              Please feel free to ask! I wont hold anything back.

              I know some of you are probably trying to figure out boot.img or have you got it figured?

              FYI, there are MANY formats of boot.img! So be ready for that one

              Bob
              "Przebacz 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 lo que hacen"
              "Oprosti im, jer ne znaju što čine"
              "Atyám, bocsásd meg nekik, mert nem tudják mit cselekszenek!"
              "Odpusť jim, neboť nevědí, co činí"
              "Πάτερ άφες αυτοίς, ού γάρ οίδασι τί ποιούσι"
              "Ojcze, przebacz im, bo nie wiedzą, co czynią"
              "Forgive them as they know not what they do"

              Comment


              • #8
                Originally posted by Finless View Post
                OK so I know many want to learn.

                So why no questions?
                Please feel free to ask! I wont hold anything back.

                I know some of you are probably trying to figure out boot.img or have you got it figured?

                FYI, there are MANY formats of boot.img! So be ready for that one

                Bob
                I don't know about anyone else, but I am going to need a few days to get my Ubuntu VM operating. I'll ask away once I have things rolling.


                Sent from my AN10G2 using Tapatalk
                Asus Transformer TF300T - ROOTED, with TWRP recovery and stock Jellybean
                HTC Rezound - ROOTED with S-OFF, running stock ICS
                Android obsessed since April 29, 2010

                Comment


                • #9
                  Starting a new job this week so haven't had much time to fool with the tablet. Will probably get going again soon.

                  Randy R.

                  Sent from my SGH-T959 using Tapatalk

                  Comment


                  • #10
                    I tried opening your boot.img using cygwin. No dice. I just installed VM w/ Ubuntu, as you suggested. I doubt I'll have much trouble learning commands (my 1st computer ran on DOS)...but I'm sure once I have time to sit down & mess with the boot.img, I'll have plenty of questions.

                    Comment


                    • #11
                      There are many formats of boot.img out there so it depends on what ROM.
                      For RK devices I have seen 4 different ones so far.

                      1) Boot.img in "Android" format. That is it is just a file with a header, kernel inside it, blank space for a RAM disk, and a footer. This setup was used a lot on RK28 and a few RX29 tablets (Momo and A-10 uses this).

                      2) Boot.img is a cramfs file system! Just mount it and have at it.

                      3) Boot.img is a crapfs file system. (we jokingly call it crapfs) It's a modified cramfs that will not mount in linux! They do this to try and stop people from tampering. You will need cramfs1.1 to unpack it.

                      4) Boot.img is a modifed gzip. It will not unpack with gzip however because it has a header and a bunch of footer info so gzip complains. This is what is used on Arnova, Polaroid, Nextbook, and many other RK29 tabs.

                      There are also some derivatives of #4.

                      By the way I have found that #1 and #4 can both be used. e.g. I converted a ROM from #1 to #4 style and it worked (again the Momo7). The tablet should be faster with kernel.img being a separate img rather than stuffed in boot.img. However all the clockwork mods and stuff use #1 style!!! You will never get a CWM mod with #4 style.

                      So to take apart #4 style there are 2 ways. RKtools written by someone on XDA. Or a couple simple linux commands. I found that some of the derivatives of #4 the RK tools will not work on so I always use my method.

                      1) You need to strip off the 8 by header. I use DD command.
                      dd if=boot.img of=bootimg.gz skip=8 bs=1 count=20000000

                      For linux newbees DD options used here
                      if= is the input file
                      of= is the output file
                      skip= is obvious skip X bytes
                      bs= is the block size in this case 1 byte blocks
                      count= is how many bytes DD will take out of the input file and put in the output file.
                      Now count and bs work together. If I said bs=100 then bs is now a multiplier.
                      For instance if bs=1 and count=100 you would get 100 bytes in and out
                      if bs=10 and count=100 you would get 1000 bytes in and out.

                      So the above command will make a .gz file (which boot.img is) by removing the 8 byte Android header. Now watch out for count. I make it larger than the actual file size. DD will hit the end of the file and stop anyway. But if you make count too small you wont get a full file.
                      Now unzip it. gz will complain of trailing garbage. Thats the footer. Don't worry about it. You now have boot.img all apart


                      OK lesson 1 for boot.img done.

                      Let me know if you have any questions,
                      Bob
                      "Przebacz 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 lo que hacen"
                      "Oprosti im, jer ne znaju što čine"
                      "Atyám, bocsásd meg nekik, mert nem tudják mit cselekszenek!"
                      "Odpusť jim, neboť nevědí, co činí"
                      "Πάτερ άφες αυτοίς, ού γάρ οίδασι τί ποιούσι"
                      "Ojcze, przebacz im, bo nie wiedzą, co czynią"
                      "Forgive them as they know not what they do"

                      Comment


                      • #12
                        Originally posted by HaroldG View Post
                        I don't know about anyone else, but I am going to need a few days to get my Ubuntu VM operating. I'll ask away once I have things rolling.


                        Sent from my AN10G2 using Tapatalk
                        Dude... WTH is up with this whine....? You want people to help you? Take take take take take and then whine whine whine. Bob spend your time helping people who really appreciate your work is MHO. Sheesh.


                        --------------------------------------


                        Propprop, my sentiments exactly. The boot screen on Finless' ROM looks like a tacky billboard. It has no fewer than 6 plugs. It's certainly Finless choice to do whatever he wants with his firmware, but it's bad form and just not done with ROMs. Check out pretty much any other ROM on any other platform and you just won't see that.



                        For instance, NilsP, one of the recognized developers on XDA, has a custom animation that has Andy the Android waiving and it simply says "Nils Business GingerSense." Cyanogen doesn't self-promote in its splash screens or boot animations. Neither do Virus, Joel, or any of the other recognized developers in the platform.



                        It's just bad form. The kudos belong in the build.prop. If Finless wants to put a "Finless 1.4" logo on the splash screen, that's totally cool, but this splash screen is just antithetical to what is typically done in the Android community. As far as the rest of the functionality of his ROM, it's great, and it's what I run on my 10 G2. His work is genuinely appreciated, there's just this one annoyance. And, frankly, if everybody did what he did with his splash screen, I wouldn't dare mention it. It's just that having seen literally dozens of ROMs for many MANY other devices, this is the only one where I see this kind of thing.



                        And this has absolutely nothing to do with whatever differences Finless and admin here have.

                        _________________________________________
                        Please donate to purchase tablets for Finless Bob to continue his work. This will help in the creation of custom roms and build an even stronger development base for our community. Thank you for you support!

                        PLEASE CLICK THE DONATE BUTTON BELOW






                        Comment


                        • #13
                          Wondering if you could help a beginner with some of the simple stuff.

                          I'm trying to strip the individual img files from sowa's image for the 8g2. How do I strip the original image files and then rebuild it back to a flashable image again?

                          I have ubuntu installed already. I don't know if I'm allowed to use sowa's image, just thought it would be a safe bet as it works and is already rooted.

                          Cheers in advance.

                          Blinky.

                          Sent from my HTC Desire HD using Tapatalk

                          Comment


                          • #14
                            Do a google search for AFPTool. It is a standard RK29 tool. Make sure you get the one for RK29 and not RK28 as they are different. This tool will not only take all the .img's out of update.img but it will also make a update.img.

                            In Windows you open a command shell in the directory where the update.img is.
                            Make sure you have AFPTool there and the DLLs that come with it.
                            Then at the command prompt type
                            AFPTool -unpack update.img //temp

                            If you cant find the tool let me know and I will upload the kit.

                            As for using SOWA's ROM, you should ask him first to make sure. Just remember this. Moding a ROM and making no real changes and putting your name on it, is not ROM cooking. If you want to put your name on it, you need to add value. Otherwise your ripping people off. Just my take on ROM cooking to be nice to the original authors.

                            Bob
                            "Przebacz 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 lo que hacen"
                            "Oprosti im, jer ne znaju što čine"
                            "Atyám, bocsásd meg nekik, mert nem tudják mit cselekszenek!"
                            "Odpusť jim, neboť nevědí, co činí"
                            "Πάτερ άφες αυτοίς, ού γάρ οίδασι τί ποιούσι"
                            "Ojcze, przebacz im, bo nie wiedzą, co czynią"
                            "Forgive them as they know not what they do"

                            Comment


                            • #15
                              Thank you very much.

                              I am not looking at releasing the rom, I am just looking at how its done and how to make them. If I get to a point where I think I can make a rom of my own then I will start from scratch.

                              I would never tweak someone else's rom and call it my own, thats just wrong.

                              Cheers blinky.

                              Sent from my HTC Desire HD using Tapatalk

                              Comment

                              Working...
                              X