occlum/demos/linux-ltp/dl_and_build_ltp.sh
Zheng, Qi 4354148ecf Add linux ltp demo
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
2021-10-22 17:16:52 +08:00

21 lines
532 B
Bash
Executable File

#! /bin/bash
set -e
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TAG=20210927
LTP_INSTALL_DIR=${SCRIPT_DIR}/ltp_install/ltp
rm -rf ltp
rm -rf $LTP_INSTALL_DIR && mkdir -p ${LTP_INSTALL_DIR}
git clone -b $TAG https://github.com/linux-test-project/ltp.git
pushd ltp
# Apply patch to support running ltp in Occlum
git apply ../0001-Make-it-work-on-Occlum.patch
git apply ../0002-Ignore-some-test-cases-which-crash-the-Occlum.patch
make autotools
./configure --prefix=${LTP_INSTALL_DIR}
make -j && make install
popd