From 39c7d5378132176436e54af7bbda18ed0221c151 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Mon, 19 Mar 2018 02:31:23 -0700 Subject: xci: scripts: start-new-vm.sh: Improve do_copy() The copy function of start-new-vm.sh script only excludes the image of the current OS which is some cases can contain other images. This change excludes any image. Change-Id: I50075cb56e7784d090582fe5d0c11c906773a174 Signed-off-by: Victor Morales --- xci/scripts/vm/start-new-vm.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh index 6e5c8194..f266d64f 100755 --- a/xci/scripts/vm/start-new-vm.sh +++ b/xci/scripts/vm/start-new-vm.sh @@ -179,6 +179,8 @@ else update_clean_vm_files fi +declare -r XCI_DEPLOYMENT_IMAGE="deployment_image.qcow2" + # Doesn't matter if we just built an image or got one from artifacts. In both # cases there should be a copy in the cache so copy it over. sudo rm -f ${BASE_PATH}/${OS}.qcow2 @@ -186,8 +188,8 @@ sudo rm -f ${BASE_PATH}/${OS}.qcow2 sudo chmod 777 -R $XCI_CACHE_DIR/clean_vm/images/ sudo chown $uid:$gid -R $XCI_CACHE_DIR/clean_vm/images/ cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2* ${BASE_PATH}/ -cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2.sha256.txt ${BASE_PATH}/deployment_image.qcow2.sha256.txt -cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2 ${BASE_PATH}/deployment_image.qcow2 +cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2.sha256.txt ${BASE_PATH}/${XCI_DEPLOYMENT_IMAGE}.sha256.txt +cp ${XCI_CACHE_DIR}/clean_vm/images/${OS}.qcow2 ${BASE_PATH}/${XCI_DEPLOYMENT_IMAGE} cd ${BASE_PATH} declare -r OS_IMAGE_FILE=${OS}.qcow2 @@ -332,11 +334,13 @@ EOF # Need to copy releng-xci to the vm so we can execute stuff do_copy() { - rsync -a \ - --exclude "${VM_NAME}*" \ - --exclude "${OS}*" \ - --exclude "build.log" \ - -e "$vm_ssh" ${BASE_PATH}/ ${VM_NAME}:~/releng-xci/ + echo "Copying releng-xci host folder to guest vm..." + rsync -a \ + --exclude "${VM_NAME}*" \ + --include "${XCI_DEPLOYMENT_IMAGE}*" \ + --exclude "*qcow2*" \ + --exclude "build.log" \ + -e "$vm_ssh" ${BASE_PATH}/ ${VM_NAME}:~/releng-xci/ } do_copy -- cgit 1.2.3-korg