• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Kernel building/flashing issue

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:
~ $ adb shell
# cat /proc/mtd
dev:    size   erasesize  name
#

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.
 
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:
~ $ adb shell
# cat /proc/mtd
dev:    size   erasesize  name
#
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.
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.
 
  • Like
Reactions: h.haulman
Upvote 0
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.
 
  • Like
Reactions: h.haulman
Upvote 0
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.

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.

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.

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.

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!

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!
 
Upvote 0
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:
 ../tools/bootimg/mkbootimg --kernel zImage --ramdisk ramdisk.gz --cmdline "console=ttyMSM1 androidboot.hardware=qcom" -o boot.img --base 0x00200000

Notice the base address at the end.
 
Upvote 0
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:
 ../tools/bootimg/mkbootimg --kernel zImage --ramdisk ramdisk.gz --cmdline "console=ttyMSM1 androidboot.hardware=qcom" -o boot.img --base 0x00200000

Notice the base address at the end.

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.
 
Upvote 0
Upvote 0
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

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.
 
Upvote 0
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.

Yes. If you've never built cm7 then neither that folder nor ramdisk file would exist.
 
  • Like
Reactions: h.haulman
Upvote 0
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.

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.
 
  • Like
Reactions: h.haulman
Upvote 0
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.
 
Upvote 0
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.

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).
 
Upvote 0
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

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.
 
Upvote 0
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!
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones