diff options
author | Victor Morales <victor.morales@intel.com> | 2018-03-19 02:31:23 -0700 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2018-03-22 08:19:15 +0000 |
commit | 39c7d5378132176436e54af7bbda18ed0221c151 (patch) | |
tree | c076b36e756ca0346c2c77b0f1576854053f7150 /xci/scripts | |
parent | d0c16a80bac11f52bba7cc6e7152ec47aababe1f (diff) |
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 <victor.morales@intel.com>
Diffstat (limited to 'xci/scripts')
-rwxr-xr-x | xci/scripts/vm/start-new-vm.sh | 18 |
1 files 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 |