diff options
author | Android Partner Docs <noreply@android.com> | 2017-06-13 21:26:42 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-06-13 21:26:42 +0000 |
commit | b8087179e42959b1efeb64a81110d6d0aa2b798f (patch) | |
tree | b0254fc055b6adcae6a60704966ac029afb600cf /en/source/building-kernels.html | |
parent | e5ecdabfcf75d07d42c93ab2b472b8340b674ae7 (diff) | |
parent | 669198e6d1bd5047baeea4f298f27ec22fbc71f5 (diff) | |
download | source.android.com-b8087179e42959b1efeb64a81110d6d0aa2b798f.tar.gz |
Merge "Docs: Changes to source.android.com" am: 0a9ccdf0b0 am: c391221fea am: 6ccb9c7cc8
am: 669198e6d1
Change-Id: Idf6e6994594f7e8514edbd0c54bd1cc92dd898de
Diffstat (limited to 'en/source/building-kernels.html')
-rw-r--r-- | en/source/building-kernels.html | 106 |
1 files changed, 54 insertions, 52 deletions
diff --git a/en/source/building-kernels.html b/en/source/building-kernels.html index 5bdd796b..1ddfe4fa 100644 --- a/en/source/building-kernels.html +++ b/en/source/building-kernels.html @@ -176,12 +176,13 @@ sources.</p> <p>After determining the device project you want to work with, view the git log for the kernel binary. Device projects use the form -<code>device/<vendor>/<name></code>.</p> +<code>device/<var>VENDOR</var>/<var>NAME</var></code>.</p> -<pre><code>$ git clone https://android.googlesource.com/kernel/hikey-linaro -$ cd hikey-linaro -$ git log --max-count=1 kernel -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">git clone https://android.googlesource.com/kernel/hikey-linaro</code> +<code class="devsite-terminal">cd hikey-linaro</code> +<code class="devsite-terminal">git log --max-count=1 kernel</code> +</pre> <p>The commit message for the kernel binary contains a partial git log of the kernel sources used to build the binary. The first entry in the log is the most @@ -193,61 +194,61 @@ as you will need it in a later step.</p> <p>To determine the kernel version used in a system image, run the following command against the kernel file:</p> -<pre><code>$ dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version' -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +dd if=kernel bs=1 skip=$(LC_ALL=C grep -a -b -o $'\x1f\x8b\x08\x00\x00\x00\x00\x00' kernel | cut -d ':' -f 1) | zgrep -a 'Linux version' +</pre> <p>For Nexus 5 (hammerhead), the command is:</p> -<pre><code>$ dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d ' ' -f1 | head -1) | zgrep -a 'Linux version' -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +dd if=zImage-dtb bs=1 skip=$(LC_ALL=C od -Ad -x -w2 zImage-dtb | grep 8b1f | cut -d ' ' -f1 | head -1) | zgrep -a 'Linux version' +</pre> <h2 id="downloading-sources">Downloading sources</h2> <p>Download the source for the kernel you want to build using the appropriate -<code>git clone</code> command:</p> - -<pre><code>$ git clone https://android.googlesource.com/kernel/common.git -$ git clone https://android.googlesource.com/kernel/hikey-linaro -$ git clone https://android.googlesource.com/kernel/x86_64.git -$ git clone https://android.googlesource.com/kernel/exynos.git -$ git clone https://android.googlesource.com/kernel/goldfish.git -$ git clone https://android.googlesource.com/kernel/msm.git -$ git clone https://android.googlesource.com/kernel/omap.git -$ git clone https://android.googlesource.com/kernel/samsung.git -$ git clone https://android.googlesource.com/kernel/tegra.git -</code></pre> - -<ul> -<li>The <code>goldfish</code> project contains the kernel sources for the -emulated platforms.</li> -<li>The <code>msm</code> project has the sources for ADP1, ADP2, Nexus One, -Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), Pixel, -and Pixel XL, and can be used -as a starting point for work on Qualcomm MSM chipsets.</li> -<li>The <code>omap</code> project is used for PandaBoard and Galaxy Nexus, -and can be used as a starting point for work on TI OMAP chipsets.</li> -<li>The <code>samsung</code> project is used for Nexus S, and can be used as a -starting point for work on Samsung Hummingbird chipsets.</li> -<li>The <code>tegra</code> project is for Xoom, Nexus 7 (2012), Nexus 9, -and can be used as a starting point for work on NVIDIA Tegra chipsets.</li> -<li>The <code>exynos</code> project has the kernel sources for Nexus 10, -and can be used as a starting point for work on Samsung Exynos chipsets.</li> -<li>The <code>x86_64</code> project has the kernel sources for Nexus Player, -and can be used as a starting point for work on Intel x86_64 chipsets.</li> -<li>The <code>hikey-linaro</code> project is used for HiKey reference boards, -and can be used as a starting point for work on HiSilicon 620 chipsets.</li> -</ul> +<code>git clone</code> command. For example, the following command clones the <code>common</code> kernel, a generic, customizable kernel:</p> +<pre class="devsite-terminal devsite-click-to-copy"> +git clone https://android.googlesource.com/kernel/common +</pre> + +<p>A full list of the kernel projects can be found in the <a href="https://android.googlesource.com/kernel">Kernel</a> directory. Below are some of the commonly used kernels and their respective <code>git clone</code> commands.</p> + +<p>The <code>exynos</code> project has the kernel sources for Nexus 10, and can be used as a starting point for work on Samsung Exynos chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/exynos</pre> + +<p>The <code>goldfish</code> project contains the kernel sources for the emulated platforms.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/goldfish</pre> + +<p>The <code>hikey-linaro</code> project is used for HiKey reference boards, and can be used as a starting point for work on HiSilicon 620 chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/hikey-linaro</pre> + +<p>The <code>msm</code> project has the sources for ADP1, ADP2, Nexus One, Nexus 4, Nexus 5, Nexus 6, Nexus 5X, Nexus 6P, Nexus 7 (2013), Pixel, and Pixel XL, and can be used as a starting point for work on Qualcomm MSM chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/msm</pre> + +<p>The <code>omap</code> project is used for PandaBoard and Galaxy Nexus, and can be used as a starting point for work on TI OMAP chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/omap</pre> + +<p>The <code>samsung</code> project is used for Nexus S, and can be used as a starting point for work on Samsung Hummingbird chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/samsung</pre> + +<p>The <code>tegra</code> project is for Xoom, Nexus 7 (2012), Nexus 9, and can be used as a starting point for work on NVIDIA Tegra chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/tegra</pre> + +<p>The <code>x86_64</code> project has the kernel sources for Nexus Player, and can be used as a starting point for work on Intel x86_64 chipsets.</p> +<pre class="devsite-terminal devsite-click-to-copy">git clone https://android.googlesource.com/kernel/x86_64</pre> <h2 id="building">Building the kernel</h2> <p>When you know the last commit message for a kernel and have successfully downloaded the kernel source and prebuilt gcc, you are ready to build the kernel. The following build commands use the hikey kernel:</p> -<pre><code>$ export ARCH=arm64 -$ export CROSS_COMPILE=aarch64-linux-android- -$ cd hikey-linaro -$ git checkout -b android-hikey-linaro-4.1 origin/android-hikey-linaro-4.1 -$ make hikey_defconfig -$ make -</code></pre> +<pre class="devsite-click-to-copy"> +<code class="devsite-terminal">export ARCH=arm64</code> +<code class="devsite-terminal">export CROSS_COMPILE=aarch64-linux-android-</code> +<code class="devsite-terminal">cd hikey-linaro</code> +<code class="devsite-terminal">git checkout -b android-hikey-linaro-4.1 origin/android-hikey-linaro-4.1</code> +<code class="devsite-terminal">make hikey_defconfig</code> +<code class="devsite-terminal">make</code> +</pre> <p>To build a different kernel, simply replace <code>hikey-linaro</code> with the name of the kernel you want to build.</p> @@ -264,12 +265,13 @@ command line that builds a boot image). This variable is supported by all devices as it is set up via <code>device/common/populate-new-device.sh</code>. For example:</p> -<pre><code>$ export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage-dtb -</code></pre> +<pre class="devsite-terminal devsite-click-to-copy"> +export TARGET_PREBUILT_KERNEL=$your_kernel_path/arch/arm/boot/zImage-dtb +</pre> <p class="note"><strong>Note:</strong> Kernel names differ by device. To locate the correct filename for your kernel, refer to -<code>device/<vendor>/<name></code> in the kernel source.</p> +<code>device/<var>VENDOR</var>/<var>NAME</var></code> in the kernel source.</p> </body> </html> |