From e4aedfabe7d586a5633a8be2dcb253b4ac7afca8 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Jan 2011 12:10:15 +0100 Subject: commit of quickfixes on 4.2 --- src/os-plugins/plugins/virtualbox/files/run-virt.include | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/os-plugins/plugins/virtualbox/files/run-virt.include') diff --git a/src/os-plugins/plugins/virtualbox/files/run-virt.include b/src/os-plugins/plugins/virtualbox/files/run-virt.include index 53120f2c..d05913ad 100644 --- a/src/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/src/os-plugins/plugins/virtualbox/files/run-virt.include @@ -67,7 +67,7 @@ diskfile="${diskfolder}/${imgname}" # check the file type if echo ${imgname} | grep -qiE "vdi|vmdk|vhd" && [ ${diskless} -eq 0 ]; then - imgfmt=$(echo ${imgname##*.} | tr [a-z] [A-Z]) + imgfmt=$(echo ${imgname##*.} | tr "[a-z]" "[A-Z]") elif [ ${diskless} -eq 0 ]; then writelog "${imgname} is not a valid image format (vdi|vmdk|vhd), exiting!" cleanexit 1 @@ -120,14 +120,14 @@ macaddr=$(echo ${macaddr} | sed 's/://g') # machine UUID, MAC addr part of it machineuuid="00000000-0000-0000-0000-${macaddr}" # cosmetical, since UUID in lower case -machineuuid=$(echo ${machineuuid} | tr [A-Z] [a-z]) +machineuuid=$(echo ${machineuuid} | tr "[A-Z]" "[a-z]") # get UUID of VBox image, if not diskless [ ${diskless} -eq 0 ] && diskuuid=$(VBoxManage -q showvdiinfo ${diskfile} \ | grep UUID | awk '{print $2}') # make disk immutable imgtype="Immutable" # snapshot UUID is static -snapshotuuid="88bc8b6d-f248-468a-95fe-318084904f8b" +snapshotuuid="34f617be-192a-46b3-a8ae-bce1029e093f" # imageuuid in machine.include, dafault snapshotuuid imageuuid=${snapshotuuid} @@ -157,6 +157,9 @@ elif [ ${diskless} -eq 0 ]; then # use temp disk as snapshot cat ${PLUGINDIRVIRTUALBOX}/empty-diff.vdi.gz \ | gunzip > "${snapshotdir}/{${snapshotuuid}}.vdi" + # patch the disk file uuid into the snapshot vdi file + dd if=${diskfile} of="${snapshotdir}/{${snapshotuuid}}.vdi" seek=424 \ + skip=392 bs=1 count=16 conv=notrunc fi # TODO: MEM muss noch angepasst werden. Maschine crasht wenn nehr als 50% MEM -- cgit v1.2.3-55-g7522