From 8beac656fccac38d779d672ed9510d57c6fc73e2 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Mon, 8 Jul 2024 17:02:09 +0000 Subject: [PATCH] coredump: fail on unsupported architectures early Currently coredump only works on x86_64. Fail early on any other architecture. Signed-off-by: Adrian Reber --- coredump/coredump | 5 +++++ test/others/criu-coredump/test.sh | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/coredump/coredump b/coredump/coredump index f70d37c13..3fbdafe81 100755 --- a/coredump/coredump +++ b/coredump/coredump @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import platform import argparse import os import sys @@ -36,6 +37,10 @@ def main(): opts = vars(parser.parse_args()) + if platform.machine() != 'x86_64': + print('ERROR: %s only supported on x86_64' % sys.argv[0]) + sys.exit(1) + try: coredump(opts) except SystemExit as error: diff --git a/test/others/criu-coredump/test.sh b/test/others/criu-coredump/test.sh index eec2b817f..4399044d7 100755 --- a/test/others/criu-coredump/test.sh +++ b/test/others/criu-coredump/test.sh @@ -43,5 +43,13 @@ function run_test { echo "= done" } +UNAME_M=$(uname -m) + +if [ "$UNAME_M" != "x86_64" ]; then + # the criu-coredump script is only x86_64 aware + echo "criu-coredump only support x86_64. skipping." + exit 0 +fi + gen_imgs run_test