summaryrefslogtreecommitdiff
path: root/automated/linux
diff options
context:
space:
mode:
authorMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-12-05 14:49:30 +0000
committerMilosz Wasilewski <milosz.wasilewski@linaro.org>2016-12-05 14:51:09 +0000
commit236749e33c5b54079ae4030753da67ad6df041c9 (patch)
tree04b0dca3c3563474652cf03d7bfda3c454b2b3dc /automated/linux
parent99fe65b3ec7efafc9d86088227942e32fecedbb8 (diff)
downloadtest-definitions-pipe-236749e33c5b54079ae4030753da67ad6df041c9.tar.gz
automated: libhugetlbfs fix for running on distro kernel
Config file for distro kernel is located in /boot rather than in /proc. This patch adds support for both options Change-Id: Ie516fba4e3e37d58508f013e9287964cf5a362e3 Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'automated/linux')
-rwxr-xr-xautomated/linux/libhugetlbfs/libhugetlbfs.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/automated/linux/libhugetlbfs/libhugetlbfs.sh b/automated/linux/libhugetlbfs/libhugetlbfs.sh
index 1570816..252dc1c 100755
--- a/automated/linux/libhugetlbfs/libhugetlbfs.sh
+++ b/automated/linux/libhugetlbfs/libhugetlbfs.sh
@@ -105,9 +105,19 @@ cd "${OUTPUT}"
info_msg "About to run libhugetlbfs test..."
info_msg "Output directory: ${OUTPUT}"
-
+if [ -f /proc/config.gz ]
+then
CONFIG_HUGETLBFS=$(zcat /proc/config.gz | grep "CONFIG_HUGETLBFS=")
CONFIG_HUGETLB_PAGE=$(zcat /proc/config.gz | grep "CONFIG_HUGETLB_PAGE=")
+elif [ -f /boot/config-"$(uname -r)" ]
+then
+KERNEL_CONFIG_FILE="/boot/config-$(uname -r)"
+CONFIG_HUGETLBFS=$(grep "CONFIG_HUGETLBFS=" "${KERNEL_CONFIG_FILE}")
+CONFIG_HUGETLB_PAGE=$(grep "CONFIG_HUGETLB_PAGE=" "${KERNEL_CONFIG_FILE}")
+else
+exit_on_skip "libhugetlb-pre-requirements" "Kernel config file not available"
+fi
+
HUGETLBFS=$(grep hugetlbfs /proc/filesystems | awk '{print $2}')
[ "${CONFIG_HUGETLBFS}" = "CONFIG_HUGETLBFS=y" ] && [ "${CONFIG_HUGETLB_PAGE}" = "CONFIG_HUGETLB_PAGE=y" ] && [ "${HUGETLBFS}" = "hugetlbfs" ]