Update documentation around kernel header imports.
Test: NA
Change-Id: I8866ef30efbc565e8996c574a9f895c574cd8e55
diff --git a/libc/kernel/README.md b/libc/kernel/README.md
index 9036b9f..6db08d6 100644
--- a/libc/kernel/README.md
+++ b/libc/kernel/README.md
@@ -53,14 +53,16 @@
NOT BREAK THE KERNEL <-> USER ABI, FOR EXAMPLE BY CHANGING THE SIZE
OF A GIVEN TYPE. THIS TASK CANNOT BE EASILY AUTOMATED AT THE MOMENT.
-Download the Linux kernel source code:
+Download the Android mainline kernel source code:
```
> mkdir kernel_src
> cd kernel_src
- kernel_src> git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
+ kernel_src> git clone https://android.googlesource.com/kernel/common/ -b android-mainline
```
-Then checkout the stable tag for the new kernel headers to import:
+For now, there are no tags, take the top of tree version. To find the
+version of the linux stable kernel headers the mainline source code is
+tracking, read the uapi/linux/version.h that is generated.
```
kernel_src> cd linux-stable
kernel_src/linux-stable> git checkout tags/vXXX
@@ -71,11 +73,17 @@
to determine which directory to use as the destination directory.
After running lunch, run this command to import the headers into the android
-source tree:
+source tree if there is a kernel source tree already checked out:
```
bionic/libc/kernel/tools/generate_uapi_headers.sh --use-kernel-dir kernel_src
```
+Run this command to automatically download the latest version of the headers
+and import them if there is no checked out kernel source tree:
+```
+ bionic/libc/kernel/tools/generate_uapi_headers.sh --download-kernel
+```
+
Next, run this command to copy the parsed files to bionic/libc/kernel/uapi:
```
bionic/libc/kernel/tools/update_all.py