<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=AOSP%3A_Build_Kernel</id>
	<title>AOSP: Build Kernel - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=AOSP%3A_Build_Kernel"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=AOSP:_Build_Kernel&amp;action=history"/>
	<updated>2026-04-20T22:46:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=AOSP:_Build_Kernel&amp;diff=47242&amp;oldid=prev</id>
		<title>Onnowpurbo: /* Build kernel */</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=AOSP:_Build_Kernel&amp;diff=47242&amp;oldid=prev"/>
		<updated>2017-03-13T09:51:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Build kernel&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:51, 13 March 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot;&gt;Line 93:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 93:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Untuk build kernel yang berbeda, cukup mengganti kata hikey-linaro dengan nama kernel yang ingin kita build.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Untuk build kernel yang berbeda, cukup mengganti kata hikey-linaro dengan nama kernel yang ingin kita build.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Image output ke directory arch/arm64/boot/Image ; kernel binary output ke file  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb . Copy Image directory dan file hi6220-hikey.dtb ke hikey-kernel directory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;Image output ke directory arch/arm64/boot/Image ;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;kernel binary output ke file  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb .&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;Copy Image directory dan file hi6220-hikey.dtb ke hikey-kernel directory&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Alternatif lain, kita dapat memasukan variabel TARGET_PREBUILT_KERNEL saat menggunakan  make bootimage (atau make command lainnya yang akan build boot image). Variable ini di dukung oleh semua device karena di setup melalui device/common/populate-new-device.sh. Contoh:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $ export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage-dtb&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Catatan: Nama kernel berbeda untuk setiap device. Untuk mencari tahu lokasi filename yang benar untuk kernel kita, coba lihat di device/&amp;lt;vendor&amp;gt;/&amp;lt;name&amp;gt; di kernel source&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=AOSP:_Build_Kernel&amp;diff=47241&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot;Halaman ini merinci bagaimana mem-build hanya kernel. Petunjuk berikut berasumsi bahwa kita belum download semua AOSP; jika kita sudah melakukannya, kita dapat melewati langka...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=AOSP:_Build_Kernel&amp;diff=47241&amp;oldid=prev"/>
		<updated>2017-03-13T09:50:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Halaman ini merinci bagaimana mem-build hanya kernel. Petunjuk berikut berasumsi bahwa kita belum download semua AOSP; jika kita sudah melakukannya, kita dapat melewati langka...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Halaman ini merinci bagaimana mem-build hanya kernel. Petunjuk berikut berasumsi bahwa kita belum download semua AOSP; jika kita sudah melakukannya, kita dapat melewati langkah-langkah git clone kecuali langkah yang men-download kernel source.&lt;br /&gt;
&lt;br /&gt;
Sebagian contoh di bagian ini menggunakan hikey kernel sebagai contoh.&lt;br /&gt;
&lt;br /&gt;
==Memilih kernel==&lt;br /&gt;
&lt;br /&gt;
Tabel daftar nama dan lokasi dari kernel source dan binary,&lt;br /&gt;
&lt;br /&gt;
 Device 	Lokasi Binary 			Lokasi Source 	Konfigurasi Build&lt;br /&gt;
 hikey		device/linaro/hikey-kernel 	kernel/hikey-linaro	hikey_defconfig&lt;br /&gt;
 angler 	device/huawei/angler-kernel 	kernel/msm 	angler_defconfig&lt;br /&gt;
 bullhead 	device/lge/bullhead-kernel 	kernel/msm 	bullhead_defconfig&lt;br /&gt;
 shamu 		device/moto/shamu-kernel 	kernel/msm 	shamu_defconfig&lt;br /&gt;
 fugu 		device/asus/fugu-kernel 	kernel/x86_64	fugu_defconfig&lt;br /&gt;
 volantis 	device/htc/flounder-kernel 	kernel/tegra 	flounder_defconfig&lt;br /&gt;
 hammerhead 	device/lge/hammerhead-kernel 	kernel/msm 	hammerhead_defconfig&lt;br /&gt;
 flo 		device/asus/flo-kernel/kernel	kernel/msm 	flo_defconfig&lt;br /&gt;
 deb 		device/asus/flo-kernel/kernel	kernel/msm 	flo_defconfig&lt;br /&gt;
 manta 		device/samsung/manta/kernel 	kernel/exynos 	manta_defconfig&lt;br /&gt;
 mako 		device/lge/mako-kernel/kernel	kernel/msm 	mako_defconfig&lt;br /&gt;
 grouper 	device/asus/grouper/kernel 	kernel/tegra 	tegra3_android_defconfig&lt;br /&gt;
 tilapia 	device/asus/grouper/kernel 	kernel/tegra 	tegra3_android_defconfig&lt;br /&gt;
 maguro 	device/samsung/tuna/kernel 	kernel/omap 	tuna_defconfig&lt;br /&gt;
 toro 		device/samsung/tuna/kernel 	kernel/omap 	tuna_defconfig&lt;br /&gt;
 panda 		device/ti/panda/kernel 		kernel/omap 	panda_defconfig&lt;br /&gt;
 stingray 	device/moto/wingray/kernel 	kernel/tegra 	stingray_defconfig&lt;br /&gt;
 wingray 	device/moto/wingray/kernel 	kernel/tegra 	stingray_defconfig&lt;br /&gt;
 crespo 	device/samsung/crespo/kernel 	kernel/samsung 	herring_defconfig&lt;br /&gt;
 crespo4g 	device/samsung/crespo/kernel 	kernel/samsung 	herring_defconfig&lt;br /&gt;
&lt;br /&gt;
Setelah menentukan device project yang akan kita kerjakan, lihat git log untuk kernel binary. Device projects menggunakan format device/&amp;lt;vendor&amp;gt;/&amp;lt;name&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/hikey-linaro&lt;br /&gt;
 $ cd hikey-linaro&lt;br /&gt;
 $ git log --max-count=1 kernel&lt;br /&gt;
&lt;br /&gt;
Commit message untuk kernel binary berisi parsial git log dari kernel yang digunakan untuk mem-build binary. Entri pertama dalam log adalah terbaru (yang digunakan untuk mem-build kernel). Buat catatan commit message karena kita akan membutuhkannya pada langkah berikutnya.&lt;br /&gt;
&lt;br /&gt;
==Mengidentifikasi versi kernel==&lt;br /&gt;
&lt;br /&gt;
Untuk mengetahui versi kernel yang digunakan dalam image system, jalankan perintah berikut pada file kernel,&lt;br /&gt;
&lt;br /&gt;
 $ dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $&amp;#039;\x1f\x8b\x08\x00\x00\x00\x00\x00&amp;#039; kernel | cut -d &amp;#039;:&amp;#039; -f 1) | zgrep -a &amp;#039;Linux version&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Untuk Nexus 5 (hammerhead), perintah tersebut adalah,&lt;br /&gt;
&lt;br /&gt;
 $ dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d &amp;#039; &amp;#039; -f1 | head -1) | zgrep -a &amp;#039;Linux version&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Downloading source==&lt;br /&gt;
&lt;br /&gt;
Download source untuk kernel yang kita ingin build menggunakan perintah git clone yang benar:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/common.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/hikey-linaro&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/x86_64.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/exynos.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/goldfish.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/msm.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/omap.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/samsung.git&lt;br /&gt;
 $ git clone https://android.googlesource.com/kernel/tegra.git&lt;br /&gt;
&lt;br /&gt;
* goldfish project berisi kernel source untuk emulate platform.&lt;br /&gt;
* msm project berisi source untuk ADP1, ADP2, Nexus One, Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), dan dapat digunakan sebagai pijakan awal untuk bekerja pada Qualcomm MSM chipset.&lt;br /&gt;
* omap project digunakan untuk PandaBoard dan Galaxy Nexus, dan dapat digunakan untuk pijakan awal untuk bekerja dengan TI OMAP chipset.&lt;br /&gt;
* samsung project digunakan untuk Nexus S, dan dapat digunakan untuk pijakan awal untuk bekerja dengan Samsung Hummingbird chipset.&lt;br /&gt;
* tegra project digunakan untuk Xoom, Nexus 7 (2012), Nexus 9, dan dapat digunakan untuk pijakan awal untuk bekerja dengan NVIDIA Tegra chipset.&lt;br /&gt;
* exynos project mempunyai kernel source untuk Nexus 10, dan dapat digunakan untuk pijakan awal untuk bekerja dengan Samsung Exynos chipset.&lt;br /&gt;
* x86_64 project mempunyai kernel source untuk Nexus Player, dan dapat digunakan untuk pijakan awal untuk bekerja dengan Intel x86_64 chipsets.&lt;br /&gt;
* hikey-linaro project digunakan untuk HiKey reference board, dan dapat digunakan untuk pijakan awal untuk bekerja dengan HiSilicon 620 chipset.&lt;br /&gt;
&lt;br /&gt;
==Downloading a prebuilt gcc==&lt;br /&gt;
&lt;br /&gt;
Pastikan prebuilt toolchain ada dalam path:&lt;br /&gt;
&lt;br /&gt;
 $ export PATH=$(pwd)/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
Di mesin Linux, jika kita tidak memiliki Android source tree, kita dapat men-download prebuilt toolchain dari:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6&lt;br /&gt;
&lt;br /&gt;
==Build kernel==&lt;br /&gt;
&lt;br /&gt;
Jika kita tahu commit message terakhir untuk kernel dan berhasil download kernel source maupun prebuilt gcc, pada dasarnya kita siap untuk build kernel. Perintah build berikut menggunakan hikey kernel:&lt;br /&gt;
&lt;br /&gt;
 $ export ARCH=arm64&lt;br /&gt;
 $ export CROSS_COMPILE=aarch64-linux-android-&lt;br /&gt;
 $ cd hikey-linaro&lt;br /&gt;
 $ git checkout -b android-hikey-linaro-4.1 origin/android-hikey-linaro-4.1&lt;br /&gt;
 $ make hikey_defconfig&lt;br /&gt;
 $ make&lt;br /&gt;
&lt;br /&gt;
Untuk build kernel yang berbeda, cukup mengganti kata hikey-linaro dengan nama kernel yang ingin kita build.&lt;br /&gt;
&lt;br /&gt;
Image output ke directory arch/arm64/boot/Image ; kernel binary output ke file  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb . Copy Image directory dan file hi6220-hikey.dtb ke hikey-kernel directory.&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>