From 2e38c98e837b91741b148b04d80e709edd008878 Mon Sep 17 00:00:00 2001 From: zztaki Date: Sat, 13 Jan 2024 21:34:15 +0800 Subject: [PATCH] build: better build tools-v2 and mount /etc/hosts Signed-off-by: zztaki --- util/build_functions.sh | 12 +++++++----- util/docker_opts.sh | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/util/build_functions.sh b/util/build_functions.sh index cbdb48719b..06f443844e 100644 --- a/util/build_functions.sh +++ b/util/build_functions.sh @@ -215,11 +215,13 @@ build_target() { # build tools-v2 g_toolsv2_root="tools-v2" - if [ $g_release -eq 1 ] - then - (cd ${g_toolsv2_root} && make build version=${curve_version}) - else - (cd ${g_toolsv2_root} && make debug version=${curve_version}) + if [[ "$g_target" = "*" ]]; then + if [ $g_release -eq 1 ] + then + (cd ${g_toolsv2_root} && make build version=${curve_version}) + else + (cd ${g_toolsv2_root} && make debug version=${curve_version}) + fi fi } diff --git a/util/docker_opts.sh b/util/docker_opts.sh index d83aeec9ec..30c2e03e13 100755 --- a/util/docker_opts.sh +++ b/util/docker_opts.sh @@ -9,6 +9,7 @@ g_docker_opts=( "-v /etc/sudoers.d/:/etc/sudoers.d/" "-v /etc/sudoers:/etc/sudoers:ro" "-v /etc/shadow:/etc/shadow:ro" + "-v /etc/hosts:/etc/hosts" "-v /var/run/docker.sock:/var/run/docker.sock" "-v /root/.docker:/root/.docker" "--ulimit core=-1"