Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create iso containing VirtIO drivers and autostart script.
#!/bin/bash -x
URL="http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/virtio-win-0.1-65.iso"
ISO=`basename $URL`
sudo rm autostart.iso
wget --continue $URL
sudo mount -o loop ./$ISO /mnt/iso
mkdir -v cd
#32 bit
cp -v /mnt/iso/win7/x86/* $PWD/cd/
#64 bit
#cp -v -r /mnt/iso/win7/amd64/* $PWD/cd/
cat > $PWD/cd/autorun.bat << \EOF
:: Tested on Windows Win7
powershell -command "$client = new-object System.Net.WebClient; $client.DownloadFile(\"https://gist.github.com/ruzickap/7395426/raw/win7-admin.bat\", \"c:\win7-admin.bat\")"
powershell -command "$client = new-object System.Net.WebClient; $client.DownloadFile(\"https://gist.github.com/ruzickap/7395075/raw/win7-user.bat\", \"c:\win7-user.bat\")"
c:\win7-user.bat
EOF
chmod 644 $PWD/cd/*
genisoimage -v -V AUTOSTART -J -r -o autostart.iso cd/*
sudo umount /mnt/iso
rm -rvf $PWD/cd
rm $ISO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.