Add support for manually modified kernel headers.

This changes the scripts so that if some kernel files exists
in external/kernel-headers/modified, that they will be preferred
over the same files found in original. This is to support the case
where the kernel headers cannot be taken without some small modifications.

Included with this change, is a general cleanup of the python scripts.

This also modifies the generate uapi headers script to indicate if the
source of the modified headers has changed.

Change-Id: Id13523b244ced52a2ecd9f1399c43996dd8296fa
This commit is contained in:
Christopher Ferris
2015-09-15 14:13:17 -07:00
parent 14545d4ce3
commit d12c332018
5 changed files with 156 additions and 100 deletions

View File

@@ -13,8 +13,26 @@ def panic(msg):
sys.exit(1)
def find_program_dir():
return os.path.dirname(sys.argv[0])
def get_kernel_headers_dir():
return os.path.join(get_android_root(), "external/kernel-headers")
def get_kernel_headers_original_dir():
return os.path.join(get_kernel_headers_dir(), "original")
def get_kernel_headers_modified_dir():
return os.path.join(get_kernel_headers_dir(), "modified")
def get_kernel_dir():
return os.path.join(get_android_root(), "bionic/libc/kernel")
def get_android_root():
if "ANDROID_BUILD_TOP" in os.environ:
return os.environ["ANDROID_BUILD_TOP"]
panic("Unable to find root of tree, did you forget to lunch a target?")
class StringOutput: