{"id":28,"date":"2015-03-20T00:35:12","date_gmt":"2015-03-20T00:35:12","guid":{"rendered":"http:\/\/kibilogic.com\/?p=28"},"modified":"2015-03-20T00:35:12","modified_gmt":"2015-03-20T00:35:12","slug":"scratchpad-building-the-android-kernel","status":"publish","type":"post","link":"https:\/\/kibilogic.com\/?p=28","title":{"rendered":"Scratchpad &#8211; Building the Android Kernel"},"content":{"rendered":"<p>\/* Initialize Environment and Download source *\/<br \/>\nhttps:\/\/source.android.com\/source\/building-kernels.html<\/p>\n<p>\/* Download specific kernel *\/<br \/>\ngit clone https:\/\/android.googlesource.com\/kernel\/msm.git<\/p>\n<p>*** when download is finished, you will have an empty directory until you checkout something ***<\/p>\n<p>\/* list branches available *\/<br \/>\ngit branch -a<br \/>\ngit branch -a &#8211;contains &lt;commit&gt;<\/p>\n<p>\/* checkout what you are after (a specific branch and\/or a specific build\/commit) *\/<br \/>\ngit checkout &lt;commit&gt;<\/p>\n<p>\/* Grab\u00a0 Cross Compiler *\/<br \/>\ngit clone https:\/\/android.googlesource.com\/platform\/prebuilts\/gcc\/linux-x86\/arm\/arm-eabi-4.6<\/p>\n<p>\/* add toolchain to your PATH *\/<\/p>\n<p>*** my preference is to add it to bashrc ***<\/p>\n<p>*** dirty issue, the kernel will append -dirty to the build. To get rid of that **<br \/>\nModify include\/config\/kernel.release<\/p>\n<p>*** modify Makefile ***<br \/>\nadd configuration flag to setlocalversion to get rid of the dirty issue<br \/>\n&#8211;save-scmversion<\/p>\n<p>*** example ***<br \/>\n$(Q)echo &#8220;$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)\/scripts\/<strong>setlocalversion &#8211;save-scmversion<\/strong> $(srctree))&#8221; &gt; $@<\/p>\n<p>\/** Prepare for building *\/<\/p>\n<p>*** if you are building for a specific device, or want module support ***<br \/>\n** modify Makefile **<br \/>\nEXTRAVERSION<br \/>\nAdd compiler option flag -fno-pic<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* Initialize Environment and Download source *\/ https:\/\/source.android.com\/source\/building-kernels.html \/* Download specific kernel *\/ git clone https:\/\/android.googlesource.com\/kernel\/msm.git *** when download is finished, you will have an empty directory until you checkout something *** \/* list branches available *\/ git branch -a git branch -a &#8211;contains &lt;commit&gt; \/* checkout what you are after (a specific branch and\/or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-scratchpad"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"bridgette","author_link":"https:\/\/kibilogic.com\/?author=1"},"uagb_comment_info":11,"uagb_excerpt":"\/* Initialize Environment and Download source *\/ https:\/\/source.android.com\/source\/building-kernels.html \/* Download specific kernel *\/ git clone https:\/\/android.googlesource.com\/kernel\/msm.git *** when download is finished, you will have an empty directory until you checkout something *** \/* list branches available *\/ git branch -a git branch -a &#8211;contains &lt;commit&gt; \/* checkout what you are after (a specific branch and\/or&hellip;","_links":{"self":[{"href":"https:\/\/kibilogic.com\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kibilogic.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kibilogic.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kibilogic.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kibilogic.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":1,"href":"https:\/\/kibilogic.com\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":29,"href":"https:\/\/kibilogic.com\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions\/29"}],"wp:attachment":[{"href":"https:\/\/kibilogic.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kibilogic.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kibilogic.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}