From 17148d70fcdc99228fa31c78ab7a23ea3efd13c6 Mon Sep 17 00:00:00 2001 From: lguohan Date: Sun, 17 Jan 2021 11:05:33 -0800 Subject: [PATCH] [kvm]: add debug cmd for build_kvm_image.sh (#6472) dump netstat info on error Signed-off-by: Guohan Lu --- scripts/build_kvm_image.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build_kvm_image.sh b/scripts/build_kvm_image.sh index e0a7ec2fef..4531ca25a5 100755 --- a/scripts/build_kvm_image.sh +++ b/scripts/build_kvm_image.sh @@ -22,6 +22,7 @@ on_exit() on_error() { + netstat -antp echo "============= kvm_log ==============" cat $kvm_log } @@ -51,12 +52,12 @@ create_disk prepare_installer_disk echo "Prepare memory for KVM build: $vs_build_prepare_mem" -sudo mount proc /proc -t proc || true +mount proc /proc -t proc || true free -m if [[ "$vs_build_prepare_mem" == "yes" ]]; then # Force o.s. to drop cache and compact memory so that KVM can get 2G memory - sudo bash -c 'echo 1 > /proc/sys/vm/drop_caches' - sudo bash -c 'echo 1 > /proc/sys/vm/compact_memory' + bash -c 'echo 1 > /proc/sys/vm/drop_caches' + bash -c 'echo 1 > /proc/sys/vm/compact_memory' free -m fi