function usage() { cat <<EOF
$0 [-d build_dir] [-j jobs] [-t target_arch] [-h]
Options:
-d) path to the kernel build directory
-j) number of jobs for compilation, similar to -j in make
-t) run test for target_arch, requires CROSS_COMPILE set
supported targets: aarch64, x86_64
-h) display this help
EOF
}
# verify that kernel confiration has all necessary options while read -r opt ; do
grep "$opt""$kconfig" &>/dev/null || skip "$opt is missing" done < "$kho_config"
case $target in
aarch64) echo"arm64" ;;
x86_64) echo"x86" ;;
*) skip "architecture $target is not supported"
esac
}
function main() {
local build_dir="$kernel_dir/.kho"
local jobs=$(($(nproc) * 2))
local target="$(uname -m)"
# skip the test if any of the preparation steps fails
set -o errtrace
trap skip ERR
while getopts 'hd:j:t:' opt; do
case $opt in
d)
build_dir="$OPTARG"
;;
j)
jobs="$OPTARG"
;;
t)
target="$OPTARG"
;;
h)
usage
exit 0
;;
*) echo Unknown argument "$opt"
usage
exit 1
;;
esac done
ktap_print_header
ktap_set_plan 1
if [[ "$target" != "$(uname -m)" ]] && [[ -z "$CROSS_COMPILE" ]]; then
skip "Cross-platform testing needs to specify CROSS_COMPILE" fi
mkdir -p "$build_dir"
local arch=$(target_to_arch "$target")
source "$test_dir/$arch.conf"
# build the kernel and create initrd # initrd includes the kernel image that will be kexec'ed
local make_cmd="make ARCH=$arch CROSS_COMPILE=$CROSS_COMPILE -j$jobs"
build_kernel "$build_dir""$make_cmd""$QEMU_KCONFIG""$KERNEL_IMAGE"
local kernel="$build_dir/arch/$arch/boot/$KERNEL_IMAGE"
mkinitrd "$kernel"
run_qemu "$QEMU_CMD""$KERNEL_CMDLINE""$kernel"
ktap_test_pass "KHO succeeded"
}
main "$@"
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.