summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaresh Kamboju <naresh.kamboju@linaro.org>2017-01-18 12:36:38 +0530
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2017-01-18 19:56:36 +0000
commit9aac9f8dd6ae10f9186edaca58fe43df3203ac63 (patch)
tree59effd1bc3002339c634e71faae441c5332fd13f
parentf05f6cfcbc54476e8a86c675cc3b6d275e377bdb (diff)
automated: device-tree test fix
Change-Id: Ifa9e27e06396d61e4e32b26755129364f09a7c8d Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
-rwxr-xr-xautomated/linux/device-tree/device-tree.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/automated/linux/device-tree/device-tree.sh b/automated/linux/device-tree/device-tree.sh
index c2d2fcc..f2deea2 100755
--- a/automated/linux/device-tree/device-tree.sh
+++ b/automated/linux/device-tree/device-tree.sh
@@ -56,8 +56,18 @@ device_tree_property() {
[ -d "${OUTPUT}" ] && mv "${OUTPUT}" "${OUTPUT}_$(date +%Y%m%d%H%M%S)"
mkdir -p "${OUTPUT}"
-CONFIG_PROC_FS=$(zcat /proc/config.gz | grep CONFIG_PROC_FS)
-CONFIG_OF=$(zcat /proc/config.gz | grep "CONFIG_OF=")
+if [ -f /proc/config.gz ]
+then
+ CONFIG_PROC_FS=$(zcat /proc/config.gz | grep "CONFIG_PROC_FS=")
+ CONFIG_OF=$(zcat /proc/config.gz | grep "CONFIG_OF=")
+elif [ -f /boot/config-"$(uname -r)" ]
+then
+ KERNEL_CONFIG_FILE="/boot/config-$(uname -r)"
+ CONFIG_PROC_FS=$(grep "CONFIG_PROC_FS=" "${KERNEL_CONFIG_FILE}")
+ CONFIG_OF=$(grep "CONFIG_OF=" "${KERNEL_CONFIG_FILE}")
+else
+ exit_on_skip "device-tree-pre-requirements" "Kernel config file not available"
+fi
[ "${CONFIG_PROC_FS}" = "CONFIG_PROC_FS=y" ] && [ "${CONFIG_OF}" = "CONFIG_OF=y" ] && [ -d "${SYSFS_DEVICE_TREE}" ]
exit_on_fail "device-tree-Kconfig" "${DT_SKIP_LIST_2}"