Last active
December 27, 2015 21:59
-
-
Save ruzickap/7395635 to your computer and use it in GitHub Desktop.
Create iso containing VirtIO drivers and autostart script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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