Skip to content

Instantly share code, notes, and snippets.

@shutingrz
Created September 8, 2019 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shutingrz/76d1910b679ba3b51630a3f382867597 to your computer and use it in GitHub Desktop.
Save shutingrz/76d1910b679ba3b51630a3f382867597 to your computer and use it in GitHub Desktop.
Vitochaイメージのovaをfusionでインポートできるようにしたpainaスクリプト改変版
#!/bin/sh
ORIGINAL_OVA=${1:-./InternetSim.ova}
DESTDIR=${2:-.}
tar -C $DESTDIR -xvf $ORIGINAL_OVA
cp -ip $DESTDIR/InternetSim.ovf $DESTDIR/InternetSim.ovf_ORG
OVF_OLD_SHA1=$(shasum $DESTDIR/InternetSim.ovf_ORG | cut -d" " -f1)
sed -i "" 's/ovf:capacity="19326328320"/ovf:capacity="18" ovf:capacityAllocationUnits="GigaBytes"/' $DESTDIR/InternetSim.ovf
sed -i "" 's/ovf:capacity="21474836480"/ovf:capacity="20" ovf:capacityAllocationUnits="GigaBytes"/' $DESTDIR/InternetSim.ovf
OVF_NEW_SHA1=$(shasum $DESTDIR/InternetSim.ovf | cut -d" " -f1)
sed -i "_ORG" "s/$OVF_OLD_SHA1/$OVF_NEW_SHA1/" $DESTDIR/InternetSim.mf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment