re-add sed command

Older version of vmdk-stream-converter has an incorrect header. The
original sed command replaced the incorrect "Description File" comment
with the correct "Disk DescriptorFile".
sil2100/raspi-server
John Chittum 4 years ago
parent c56c2475e4
commit c5cea219f4
No known key found for this signature in database
GPG Key ID: FC52138B0F49EA8E

@ -249,12 +249,25 @@ modify_vmdk_header() {
# trim null bytes to treat as standard text file # trim null bytes to treat as standard text file
tr -d '\000' < $descriptor > $newdescriptor tr -d '\000' < $descriptor > $newdescriptor
# remove the vmdk-stream-converter comment and replace with
# # Disk DescriptorFile. This is needed for Virtualbox
# remove the comments from vmdk-stream-converter which causes
# VirtualBox and others to fail VMDK validation
sed -i -e 's|# Description file.*|# Disk DescriptorFile|' \
-e '/# Believe this is random*/d' \
-e '/# Indicates no parent/d' \
-e '/# The Disk Data Base/d' \
${newdescriptor}
# add newline to newdescriptor # add newline to newdescriptor
echo "" >> $newdescriptor echo "" >> $newdescriptor
# add required tools version # add required tools version
echo -n 'ddb.toolsVersion = "2147483647"' >> $newdescriptor echo -n 'ddb.toolsVersion = "2147483647"' >> $newdescriptor
echo "Cat'ing modified descriptor for debugging."
cat $newdescriptor
# diff original descriptor and new descriptor for debugging # diff original descriptor and new descriptor for debugging
# diff exits 1 if difference. pipefail not set so piping diff # diff exits 1 if difference. pipefail not set so piping diff
# to cat prints diff and swallows exit 1 # to cat prints diff and swallows exit 1

Loading…
Cancel
Save