This repository has been archived by the owner on Feb 23, 2021. It is now read-only.
/
pstore-test.bb
72 lines (59 loc) · 2.6 KB
/
pstore-test.bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
DESCRIPTION = "pstore tests"
HOMEPAGE = "https://www.kernel.org/pub/linux/kernel"
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${STAGING_KERNEL_DIR}/COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"
KBRANCH="stable"
# Picking up matts branch
SRC_URI = "file://pstore-test-runner \
file://luv-parser-pstore-test \
file://pstore-test.json"
#we need some of the stuff below
DEPENDS_class-native += "qemu-native"
inherit autotools luv-test
DEPENDS = "linux-luv"
# If the LUV_STORAGE variable in luv_test_manager.bb ever changes,
# the reboot_dir variable should be changed accordingly
reboot_dir = "/mnt/luv-storage"
EXTRA_OEMAKE = " \
CC='${CC}' \
-C ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore"
patch() {
sed -i 's,REBOOT_DIR,${reboot_dir},g' ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/common_tests
sed -i 's,REBOOT_DIR,${reboot_dir},g' ${WORKDIR}/luv-parser-pstore-test
sed -i 's,REBOOT_DIR,${reboot_dir},g' ${WORKDIR}/pstore-test-runner
}
do_patch_append() {
bb.build.exec_func('patch', d)
}
do_configure_prepend() {
# We need to ensure the --sysroot option in CC is preserved
if [ -e "${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/Makefile" ]; then
sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/Makefile
fi
# Fix for rebuilding
oe_runmake clean
}
# Installing is nothing but putting things in place
do_install() {
# Creating a directory
install -d ${D}${datadir}/pstore-test
# Copying some of the files, these are part of the linux code
install -m 0755 ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/common_tests ${D}${datadir}/pstore-test
install -m 0755 ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/pstore_crash_test ${D}${datadir}/pstore-test
install -m 0755 ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/pstore_post_reboot_tests ${D}${datadir}/pstore-test
install -m 0755 ${STAGING_KERNEL_DIR}/tools/testing/selftests/pstore/pstore_tests ${D}${datadir}/pstore-test
# This is the script which will run all the tests
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/pstore-test-runner ${D}${bindir}
}
FILES_${PN} += "/usr/share/pstore-test/common_tests \
/usr/share/pstore-test/pstore_crash_test \
/usr/share/pstore-test/pstore_post_reboot \
/usr/share/pstore-test/pstore_tests \
${bindir}/pstore-test-runner \
"
LUV_TEST_LOG_PARSER="luv-parser-pstore-test"
LUV_TEST_JSON="pstore-test.json"
LUV_TEST="pstore-test-runner"
LUV_TEST_ARGS=""