title: How to get mkbootimg for Android kernel development for Sony Xperia ZR?
body: <p>I recently got the kernel to compile under Ubuntu (see <a href="https://askubuntu.com/a/412405/181442">my answer on Askubuntu</a> for details) but noted that the <code>~/10.4.B.0.569/kernel/README_Xperia</code> file mentions some prerequisites such as </p>
  
  <pre><code>* ramdisk.img - root fs
  * mkbootimg - boot.img generator
  </code></pre>
  
  <p>to be required as well. And while I have seen some guides about how to create the <code>ramdisk.img</code>, I haven't found how to obtain the <code>mkbootimg</code> for the Sony Xperia ZR kernel.</p>
  
  <p>Any pointers are appreciated, thank you!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is a somewhat old (2011) <a href="http://developer.sonymobile.com/2011/05/06/how-to-build-a-linux-kernel/" rel="nofollow noreferrer">Sony tutorial on how to build kernels</a>, unfortunately this also doesn't explain how to get <code>ramdisk.img</code>. For <code>mkbootimg</code>, it says:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>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 <code>mkbootimg</code> from, it sounds like it <em>should</em> be possible to build (?) <code>mkbootimg</code> from the "standard Android tree". Anyone know how to do that?</p>
  
  <p>Similar information can also be found <a href="http://developer.sonymobile.com/2013/02/21/update-on-xperia-open-source-archives/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=update-on-xperia-open-source-archives" rel="nofollow noreferrer">here, with more recent Sony tutorial</a>, about <code>mkbootimg</code> and <code>ramdisk.img</code>:</p>
  
  <blockquote>
    <p>*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.</p>
  </blockquote>
  
  <p>Now if <code>mkbootimg</code> can be built from standard Android sources, how would this "match the phone model"?</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>This thread on the XDA Forums might also be helpful in finding an answer: <a href="http://forum.xda-developers.com/showthread.php?t=2447310" rel="nofollow noreferrer">[Tutorial] Kernel building instructions for Xperia devices</a>, which has a <a href="http://forum.xda-developers.com/showthread.php?p=45653382#post45653382" rel="nofollow noreferrer">section for Xperia Z, ZL, ZR, Tablet Z</a> devices.</p>