summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-21 07:12:05 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-21 07:12:05 +0000
commit45da5160c5a4040f8dda186b11f6e11b612b42cd (patch)
tree993d5e15d409b55195448897359e8da4979b4253
parent42c33cc0f16da14bdfd20faf9f0f92bba0707fa8 (diff)
parent679a62f5d3e946fe142279d5214415d9474b8f4c (diff)
downloadkernel-45da5160c5a4040f8dda186b11f6e11b612b42cd.tar.gz
release-request-5bf29450-4eb0-4d71-a15a-d8858bf184d3-for-git_oc-release-4120128 snap-temp-L37600000076154351
Change-Id: I05c763c16191f1753626162a738cdefa935ba52c
-rw-r--r--config/VtsKernelConfigTest.py55
-rw-r--r--config/data/android-3.18/android-base-arm64.cfg5
-rw-r--r--config/data/android-3.18/android-base.cfg4
-rw-r--r--config/data/android-4.4/android-base-arm64.cfg5
-rw-r--r--config/data/android-4.4/android-base.cfg4
-rw-r--r--config/data/android-4.9/android-base-arm64.cfg5
-rw-r--r--config/data/android-4.9/android-base.cfg4
7 files changed, 65 insertions, 17 deletions
diff --git a/config/VtsKernelConfigTest.py b/config/VtsKernelConfigTest.py
index fe765e6f..bffb5fa0 100644
--- a/config/VtsKernelConfigTest.py
+++ b/config/VtsKernelConfigTest.py
@@ -76,17 +76,46 @@ class VtsKernelConfigTest(base_test.BaseTestClass):
return kernel_version
- def parseConfigFileToDict(self, file):
+ def checkKernelArch(self, configs):
+ """Find arch of the device kernel.
+
+ Uses the kernel configuration to determine the architecture
+ it is compiled for.
+
+ Args:
+ configs: dict containing device kernel configuration options
+
+ Returns:
+ A string containing the architecture of the device kernel. If
+ the architecture cannot be determined, an empty string is
+ returned.
+ """
+
+ CONFIG_ARM = "CONFIG_ARM"
+ CONFIG_ARM64 = "CONFIG_ARM64"
+ CONFIG_X86 = "CONFIG_X86"
+
+ if CONFIG_ARM in configs and configs[CONFIG_ARM] == "y":
+ return "arm"
+ elif CONFIG_ARM64 in configs and configs[CONFIG_ARM64] == "y":
+ return "arm64"
+ elif CONFIG_X86 in configs and configs[CONFIG_X86] == "y":
+ return "x86"
+ else:
+ print "Unable to determine kernel architecture."
+ return ""
+
+ def parseConfigFileToDict(self, file, configs):
"""Parse kernel config file to a dictionary.
Args:
file: file object, android-base.cfg or unzipped /proc/config.gz
+ configs: dict to which config options in file will be added
Returns:
dict: {config_name: config_state}
"""
config_lines = [line.rstrip("\n") for line in file.readlines()]
- configs = dict()
for line in config_lines:
if line.startswith("#") and line.endswith("is not set"):
@@ -120,19 +149,35 @@ class VtsKernelConfigTest(base_test.BaseTestClass):
logging.info("Validating kernel version of device.")
kernel_version = self.checkKernelVersion()
+ # Pull configs from the universal config file.
+ configs = dict()
config_file_path = os.path.join(self.data_file_path,
self.KERNEL_CONFIG_FILE_PATH, "android-" + kernel_version,
"android-base.cfg")
with open(config_file_path, 'r') as config_file:
- configs = self.parseConfigFileToDict(config_file)
+ configs = self.parseConfigFileToDict(config_file, configs)
+ # Pull configs from device.
+ device_configs = dict()
self.dut.adb.pull("%s %s" % (self.PROC_FILE_PATH, self._temp_dir))
logging.info("Adb pull %s to %s", self.PROC_FILE_PATH, self._temp_dir)
localpath = os.path.join(self._temp_dir, "config.gz")
with gzip.open(localpath, "rb") as device_config_file:
- device_configs = self.parseConfigFileToDict(device_config_file)
-
+ device_configs = self.parseConfigFileToDict(device_config_file,
+ device_configs)
+
+ # Check device architecture and pull arch-specific configs.
+ kernelArch = self.checkKernelArch(device_configs)
+ if kernelArch is not "":
+ config_file_path = os.path.join(self.data_file_path,
+ self.KERNEL_CONFIG_FILE_PATH, "android-" + kernel_version,
+ "android-base-%s.cfg" % kernelArch)
+ if os.path.isfile(config_file_path):
+ with open(config_file_path, 'r') as config_file:
+ configs = self.parseConfigFileToDict(config_file, configs)
+
+ # Determine any deviations from the required configs.
should_be_enabled = []
should_not_be_set = []
incorrect_config_state = []
diff --git a/config/data/android-3.18/android-base-arm64.cfg b/config/data/android-3.18/android-base-arm64.cfg
new file mode 100644
index 00000000..43f23d6b
--- /dev/null
+++ b/config/data/android-3.18/android-base-arm64.cfg
@@ -0,0 +1,5 @@
+# KEEP ALPHABETICALLY SORTED
+CONFIG_ARMV8_DEPRECATED=y
+CONFIG_CP15_BARRIER_EMULATION=y
+CONFIG_SETEND_EMULATION=y
+CONFIG_SWP_EMULATION=y
diff --git a/config/data/android-3.18/android-base.cfg b/config/data/android-3.18/android-base.cfg
index 0b586234..179dd1a6 100644
--- a/config/data/android-3.18/android-base.cfg
+++ b/config/data/android-3.18/android-base.cfg
@@ -10,7 +10,6 @@ CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_DEVICES=binder,hwbinder,vndbinder
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
-CONFIG_ARMV8_DEPRECATED=y
CONFIG_ASHMEM=y
CONFIG_AUDIT=y
CONFIG_BLK_DEV_INITRD=y
@@ -19,7 +18,6 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
-CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_DEFAULT_SECURITY_SELINUX=y
CONFIG_EMBEDDED=y
CONFIG_FB=y
@@ -152,10 +150,8 @@ CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y
CONFIG_SECURITY_SELINUX=y
-CONFIG_SETEND_EMULATION=y
CONFIG_STAGING=y
CONFIG_SWITCH=y
-CONFIG_SWP_EMULATION=y
CONFIG_SYNC=y
CONFIG_TUN=y
CONFIG_UID_SYS_STATS=y
diff --git a/config/data/android-4.4/android-base-arm64.cfg b/config/data/android-4.4/android-base-arm64.cfg
new file mode 100644
index 00000000..43f23d6b
--- /dev/null
+++ b/config/data/android-4.4/android-base-arm64.cfg
@@ -0,0 +1,5 @@
+# KEEP ALPHABETICALLY SORTED
+CONFIG_ARMV8_DEPRECATED=y
+CONFIG_CP15_BARRIER_EMULATION=y
+CONFIG_SETEND_EMULATION=y
+CONFIG_SWP_EMULATION=y
diff --git a/config/data/android-4.4/android-base.cfg b/config/data/android-4.4/android-base.cfg
index b7b997fd..67c1beba 100644
--- a/config/data/android-4.4/android-base.cfg
+++ b/config/data/android-4.4/android-base.cfg
@@ -10,7 +10,6 @@ CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_DEVICES=binder,hwbinder,vndbinder
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
-CONFIG_ARMV8_DEPRECATED=y
CONFIG_ASHMEM=y
CONFIG_AUDIT=y
CONFIG_BLK_DEV_INITRD=y
@@ -19,7 +18,6 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
-CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_DEFAULT_SECURITY_SELINUX=y
CONFIG_EMBEDDED=y
CONFIG_FB=y
@@ -153,9 +151,7 @@ CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y
CONFIG_SECURITY_SELINUX=y
-CONFIG_SETEND_EMULATION=y
CONFIG_STAGING=y
-CONFIG_SWP_EMULATION=y
CONFIG_SYNC=y
CONFIG_TUN=y
CONFIG_UID_SYS_STATS=y
diff --git a/config/data/android-4.9/android-base-arm64.cfg b/config/data/android-4.9/android-base-arm64.cfg
new file mode 100644
index 00000000..43f23d6b
--- /dev/null
+++ b/config/data/android-4.9/android-base-arm64.cfg
@@ -0,0 +1,5 @@
+# KEEP ALPHABETICALLY SORTED
+CONFIG_ARMV8_DEPRECATED=y
+CONFIG_CP15_BARRIER_EMULATION=y
+CONFIG_SETEND_EMULATION=y
+CONFIG_SWP_EMULATION=y
diff --git a/config/data/android-4.9/android-base.cfg b/config/data/android-4.9/android-base.cfg
index b7b997fd..67c1beba 100644
--- a/config/data/android-4.9/android-base.cfg
+++ b/config/data/android-4.9/android-base.cfg
@@ -10,7 +10,6 @@ CONFIG_ANDROID=y
CONFIG_ANDROID_BINDER_DEVICES=binder,hwbinder,vndbinder
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_LOW_MEMORY_KILLER=y
-CONFIG_ARMV8_DEPRECATED=y
CONFIG_ASHMEM=y
CONFIG_AUDIT=y
CONFIG_BLK_DEV_INITRD=y
@@ -19,7 +18,6 @@ CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_DEBUG=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
-CONFIG_CP15_BARRIER_EMULATION=y
CONFIG_DEFAULT_SECURITY_SELINUX=y
CONFIG_EMBEDDED=y
CONFIG_FB=y
@@ -153,9 +151,7 @@ CONFIG_SECURITY=y
CONFIG_SECURITY_NETWORK=y
CONFIG_SECURITY_PERF_EVENTS_RESTRICT=y
CONFIG_SECURITY_SELINUX=y
-CONFIG_SETEND_EMULATION=y
CONFIG_STAGING=y
-CONFIG_SWP_EMULATION=y
CONFIG_SYNC=y
CONFIG_TUN=y
CONFIG_UID_SYS_STATS=y