Update documentation around kernel header imports.

Test: NA
Change-Id: I8866ef30efbc565e8996c574a9f895c574cd8e55
This commit is contained in:
Christopher Ferris 2019-12-13 17:17:10 -08:00
parent 0d61854b39
commit 86a8f3f32d
1 changed files with 12 additions and 4 deletions

View File

@ -53,14 +53,16 @@ WHEN UPDATING THE HEADERS, ALWAYS CHECK THAT THE NEW CLEAN HEADERS DO
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 @@ done a lunch TARGET. The script uses a variable set by the lunch command
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