How to get mkbootimg for Android kernel development for Sony Xperia ZR?

FriendFX picture FriendFX · Jan 29, 2014 · Viewed 9.1k times · Source

I recently got the kernel to compile under Ubuntu (see my answer on Askubuntu for details) but noted that the ~/10.4.B.0.569/kernel/README_Xperia file mentions some prerequisites such as

* ramdisk.img - root fs
* mkbootimg - boot.img generator

to be required as well. And while I have seen some guides about how to create the ramdisk.img, I haven't found how to obtain the mkbootimg for the Sony Xperia ZR kernel.

Any pointers are appreciated, thank you!

EDIT

Here is a somewhat old (2011) Sony tutorial on how to build kernels, unfortunately this also doesn't explain how to get ramdisk.img. For mkbootimg, it says:

Now that we have all the parts we need to create a flashable file. The next stop is to package the parts. To do this, you’ll need the program mkbootimg, which is part of the standard Android tree. If you don’t feel like compiling all of Android to get this tool, it is available to download from various trusted sites on the Internet.

Apart from not having found any "official" (such as Sony or Android/Google which is what I would call "trusted" in this context) sites to download mkbootimg from, it sounds like it should be possible to build (?) mkbootimg from the "standard Android tree". Anyone know how to do that?

Similar information can also be found here, with more recent Sony tutorial, about mkbootimg and ramdisk.img:

*How to obtain these files is beyond the scope of this document, but note that they should match the phone model and the rest of the software.

Now if mkbootimg can be built from standard Android sources, how would this "match the phone model"?

EDIT 2

This thread on the XDA Forums might also be helpful in finding an answer: [Tutorial] Kernel building instructions for Xperia devices, which has a section for Xperia Z, ZL, ZR, Tablet Z devices.

Answer

Kevin picture Kevin · Aug 22, 2014

I found the source code for mkbootimg / mkbootfs

git clone https://android.googlesource.com/platform/system/core.git

I found these compilation instructions to work:

https://gist.github.com/jberkel/1087757