Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create iso containing VirtIO drivers and autostart script.
#!/bin/bash -x
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(\"\", \"c:\win7-admin.bat\")"
powershell -command "$client = new-object System.Net.WebClient; $client.DownloadFile(\"\", \"c:\win7-user.bat\")"
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.