1. Download our Official Android App: Forums for Android!

Root Kernel building/flashing issue

Discussion in 'Android Devices' started by h.haulman, Jan 8, 2012.

  1. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
    I've managed to build a zImage. Even extracted and merged with a ramdisk and repacked into a flashable zip, no go. When I try to flash with adb, no directory. Sure this is why that is, but, why???:

    Code (Text):
    1. ~ $ adb shell
    2. # cat /proc/mtd
    3. dev:    size   erasesize  name
    4. #
    Why no mtd info? I've searched and searched, followed tutorial one after another. Everything builds successfully, but I can't seem to get it on the phone. The AnyKernel.zip method would finish in CWM, but did NOT flash the kernel or modules. There has to be a reason for this. I am still beating the dead horse, but with a fresh Mint12 install, all new environment installs, and new repo syncs, maybe different results will occur. But adb still produces the same result as above.
     

    Advertisement

  2. Austrie

    Austrie Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    1,325
    Joined:
    Jan 16, 2011

    Jan 16, 2011
    1,325
    898
    213
    Male
    St.Thomas, US Virgin Islands
    Well lets pick the easiest one, CWM; you mind showing me your update script? Also, make sure the ramdisk is the ramdisk from the same type of ROM you're using.
     
    h.haulman likes this.
  3. mantera

    mantera Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    1,319
    Joined:
    May 21, 2011

    May 21, 2011
    1,319
    1,587
    313
    I've always just made the boot.img into a flashable zip and flashed it in cwm. I've never tried flashing it through adb. Partly because this way I can test the flashable zip at the same time and partly because, I've never needed to try booting into fastboot for any reason so never tried.

    If you want a flashable zip, just use any of the flashable zips for kernels that are available on the site and replace the boot.img file in there with your new boot.img file.

    Edit: Oh and from that message, it looks like either your kernel is bad or your ramdisk is bad. It's hard to say... but assuming that you used a good ramdisk from a working kernel, I would say that your kernel is bad.
     
    h.haulman likes this.
  4. b_randon14

    b_randon14 Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    910
    Joined:
    Aug 13, 2011

    Aug 13, 2011
    910
    628
    163
    Pizza Delivery Driver
    Somerset, KY
    This phone doesn't have mtd partitions. The boot.Ingram is extracted to mmcblk0p5. Take another kernel zip and pit your boot.omg in it and flash it that way!
     
    h.haulman likes this.
  5. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
    The update script I would assume is in the zip I used to get the ramdisk from the existing boot.img. The ramdisk is from theOC v1.6.14.zip. That's also the source I built from.

    Default config for the make, no attempt to patch or mod. CM7 is the rom source (TG's git) used as well, so all should be kosher there. After extracting, repacking the ramdisk with the new zImage, I repacked into theOC zip and flashed in CWM. I ended up with the Moto logo, and a second or two later, the phone off charging battery icon smack in the center. Frozen. No logcat either.

    Thank god, thought something was up, or I was nuts. Well, the latter might still be accurate.

    Also, none of the tutorials outside of the one for using AnyKernel.zip, were there any instructions for what to do with the newly built modules. I take that back, the adb style of flashing the new boot.img mentioned them, but that's it, just a mention.

    Thanks for all the replies, and much respect to each of you. I continue to use some portion of your hard work on the phone daily!
     
  6. mantera

    mantera Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    1,319
    Joined:
    May 21, 2011

    May 21, 2011
    1,319
    1,587
    313
    You might be using the wrong parameters when repacking back into the boot.img. What command are you using?

    You should be using something like this:

    Code (Text):
    1.  
    2.  ../tools/bootimg/mkbootimg --kernel zImage --ramdisk ramdisk.gz --cmdline "console=ttyMSM1 androidboot.hardware=qcom" -o boot.img --base 0x00200000
    3.  
    Notice the base address at the end.
     
  7. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
    I remember that as one of many attempts. Once I have all the source back on the system and run another attempt (or hundred) I will re-verify, but I am sure that was it. Including the base address.

    mkbootimg tools and such, what was your source for the download, if you don't mind.
     
  8. mantera

    mantera Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    1,319
    Joined:
    May 21, 2011

    May 21, 2011
    1,319
    1,587
    313
    h.haulman likes this.
  9. Whyzor

    Whyzor Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    1,108
    Joined:
    Jul 7, 2011

    Jul 7, 2011
    1,108
    966
    213
    This line works for me, notice the pagesize & hardware=triumph strings.

    mkbootimg --kernel zImage --ramdisk ~/android/system/out/target/product/triumph/ramdisk.img --cmdline "console=ttyMSM1 androidboot.hardware=triumph" -o boot.img --base 0x00200000 --pagesize 4096
     
  10. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
  11. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
    If I remember correctly, that would error on me because the ramdisk path did not exist. Is that because there was no ROM previously built from the CM7 source directory? I always had to extract a ramdisk in a different folder, along with the new zImage, and mkbootimg from there. Also, the pagesize entry at the end caused an error. Can't remember what it was off hand.
     
  12. mantera

    mantera Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    1,319
    Joined:
    May 21, 2011

    May 21, 2011
    1,319
    1,587
    313
    Yes. If you've never built cm7 then neither that folder nor ramdisk file would exist.
     
    h.haulman likes this.
  13. Whyzor

    Whyzor Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    1,108
    Joined:
    Jul 7, 2011

    Jul 7, 2011
    1,108
    966
    213
    Yes my command assumes the ramdisk is in that path from a ROM build, but you can just replace the path to your ramdisk, but it has to be one that works on your ROM. the '-pagesize 4096' came from my ROM build output, so I used that, I remember not having it would cause similar problems to what you're seeing, at least on my Ubuntu 11.10 VMware virtual machine inside Windows 7 64bit.
     
    h.haulman likes this.
  14. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
    So, all things being equal, which is the cart, and which is the pony in this learning process? What I mean is, would it make more sense to try to build CM7 first, and then a kernel? That way the flow of items in place would be there for the next step? I was thinking in terms of size and complexity, that for learning purposes, building a kernel first would be the sensible thing.

    I'm happy that I was able to install Mint (I prefer it over Ubuntu visually and otherwise) on this little laptop of mine, that was a treat. It really didn't want to go on the SSD at first, but I convinced it otherwise. Then, that I am able to get the environment set up, and functioning for the most part, is very satisfying. I do enjoy challenges, that's why I went for the Triumph, ended up here, and am attempting any and all of this. Thankfully there's a great group on this forum willing to help and advise, and for that I am grateful.
     
  15. Whyzor

    Whyzor Android Expert
    Rank:
    None
    Points:
    213
    Posts:
    1,108
    Joined:
    Jul 7, 2011

    Jul 7, 2011
    1,108
    966
    213
    Building a kernel is a bit less daunting at first (& faster), but I had some trouble the first time trying to put it into a flashable zip too. Just get the ramdisk.img from another flashable zip that you know works on the ROM & extract from it. Try it with the various options we mentioned here (the -pagesize may not work for others like it did for me).
     
  16. b_randon14

    b_randon14 Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    910
    Joined:
    Aug 13, 2011

    Aug 13, 2011
    910
    628
    163
    Pizza Delivery Driver
    Somerset, KY
    Modules should be added either into the ramdisk under a directory named lib/modules, with 644 permissions, or in the rom under /system/lib/modules
     
    h.haulman likes this.
  17. h.haulman

    h.haulman Member
    Thread Starter
    Rank:
    None
    Points:
    16
    Posts:
    40
    Joined:
    Aug 24, 2011

    Aug 24, 2011
    40
    9
    16
    S.W. MO
    That would be the source of my failures, I believe. None of the tutorials, aside from AnyKernel, went that far. To be fair, I may have missed it, but I don't think so. I do know that it didn't get done. So, in between retrieving the ramdisk from a known working boot.img, and running mkbootimg would be when the directory lib/modules would be accessible to place my newly compiled modules so they can be packaged accordingly. Thanks! Maybe this week I can get a successful run.
     
  18. b_randon14

    b_randon14 Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    910
    Joined:
    Aug 13, 2011

    Aug 13, 2011
    910
    628
    163
    Pizza Delivery Driver
    Somerset, KY
    When you pull apart the boot.Ingram and ramdisk(dsixdas kitchen is very nice for this) there will befolders and files in the extracted ramdisk. If lib/modules is not there simply make it and put your modules in there and give them theright permissions!
    Then pack everything back up into a boot.Ingram. you can alsoedit theinit.RC to enable init.d support and stuffeuth the ramdisk extracted out!
     

Share This Page

Loading...