From 5ac65167be298bbddce9bf1e3c0045b455345ec0 Mon Sep 17 00:00:00 2001 From: Rodolfo Silva Date: Wed, 9 Nov 2016 10:18:30 -0300 Subject: [PATCH] Updated get_arch() function in linux/installer/bin/build-installpkg.sh script to support all system languages. The old get_arch() function would only work on systems configured in English, since it looked for the 'Class:' string. The new get_arch() function uses the 'magic' information from the readelf output to determine the architecture of the build from generated binary. Signed-off-by: Rodolfo Silva --- linux/installer/bin/build-installpkg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/installer/bin/build-installpkg.sh b/linux/installer/bin/build-installpkg.sh index 5db4537402..83da0511c8 100755 --- a/linux/installer/bin/build-installpkg.sh +++ b/linux/installer/bin/build-installpkg.sh @@ -57,8 +57,8 @@ BUILD_DIR=${ROOT_DIR}/build/linux # Get the architecture of the build from generated binary get_arch() { - local a=$(readelf -h $BUILD_DIR/sgx_sign | awk '/Class:/{print $2}') - test $a = ELF64 && echo 'x86_64' || echo 'x86' + local a=$(readelf -h $BUILD_DIR/sgx_sign | sed -n '2p' | awk '/:/{print $6}') + test $a = 02 && echo 'x86_64' || echo 'x86' }