Lines Matching +full:skip +full:- +full:config
2 # SPDX-License-Identifier: GPL-2.0
4 set -ue
6 CROSS_COMPILE="${CROSS_COMPILE:-""}"
11 tmp_dir=$(mktemp -d /tmp/kho-test.XXXXXXXX)
19 $0 [-d build_dir] [-j jobs] [-t target_arch] [-h]
21 -d) path to the kernel build directory
22 -j) number of jobs for compilation, similar to -j in make
23 -t) run test for target_arch, requires CROSS_COMPILE set
25 -h) display this help
30 rm -fr "$tmp_dir"
35 function skip() { function
36 local msg=${1:-""}
43 local msg=${1:-""}
55 local kho_config="$tmp_dir/kho.config"
56 local kconfig="$build_dir/.config"
68 make_cmd="$make_cmd -C $kernel_dir O=$build_dir"
72 while read -r opt ; do
73 grep "$opt" "$kconfig" &>/dev/null || skip "$opt is missing"
83 "$CROSS_COMPILE"gcc -s -static -Os -nostdinc -nostdlib \
84 -fno-asynchronous-unwind-tables -fno-ident \
85 -I "$headers_dir/include" \
86 -I "$kernel_dir/tools/include/nolibc" \
87 -o "$tmp_dir/init" "$test_dir/init.c"
107 cmdline="$cmdline kho=on panic=-1"
109 $qemu_cmd -m 1G -smp 2 -no-reboot -nographic -nodefaults \
110 -accel kvm -accel hvf -accel tcg \
111 -serial file:"$serial" \
112 -append "$cmdline" \
113 -kernel "$kernel" \
114 -initrd "$initrd"
125 *) skip "architecture $target is not supported"
132 local target="$(uname -m)"
134 # skip the test if any of the preparation steps fails
135 set -o errtrace
136 trap skip ERR
164 if [[ "$target" != "$(uname -m)" ]] && [[ -z "$CROSS_COMPILE" ]]; then
165 skip "Cross-platform testing needs to specify CROSS_COMPILE"
168 mkdir -p "$build_dir"
174 local make_cmd="make ARCH=$arch CROSS_COMPILE=$CROSS_COMPILE -j$jobs"