QEMU 3.1.0/4.0.0 Build Scripts for CentOS & Debian/Ubuntu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
2.4 KiB

echo 'Start By Apt-Get Updating...'
sudo apt-get update
echo 'Installing Required Packages...'
sudo apt-get install libspice-server-dev libgnutls28-dev libssh-dev libssh2-1-dev libusb-1.0-0-dev libusb-dev libusbredirhost-dev liblzo2-dev libusbredirparser-dev build-essential checkinstall libcurl4-openssl-dev libnfs-dev libaio-dev nettle-dev libiscsi-dev libsnappy-dev libcap-dev libcap-ng-dev libattr1 libbz2-dev libglib2.0-dev libpixman-1-dev flex bison -y
echo 'Changing Directory to Home Directory...'
cd ~
echo 'Downloading QEMU 4.0.0...'
wget https://download.qemu.org/qemu-4.0.0.tar.xz > /dev/null 2>&1
echo 'Extracting QEMU 4.0.0...'
tar xvf qemu-4.0.0.tar.xz > /dev/null 2>&1
echo 'Changing Directory to QEMU Source Directory...'
cd ~/qemu-4.0.0/
echo 'Running Configure on QEMU Source Directory....'
./configure --target-list=x86_64-softmmu --enable-gnutls --enable-spice --enable-tools --enable-kvm --enable-bzip2 --enable-libssh2 --enable-usb-redir --enable-modules --enable-libusb --enable-lzo --enable-virtfs --enable-curl --enable-vhost-net --enable-libnfs --enable-tpm --enable-linux-aio --enable-nettle --enable-libiscsi --enable-fdt --enable-snappy --enable-cap-ng --enable-attr > /dev/null 2>&1
echo 'Making QEMU 4.0.0 with 4 CPU Cores...'
make -j4 > /dev/null 2>&1
echo 'Making Post Install and Post Remove Files...'
echo '#!/bin/sh' > ~/qemu-4.0.0/postinstall-pak
echo 'ln -sf /usr/local/bin/qemu-img /usr/bin/qemu-img' >> ~/qemu-4.0.0/postinstall-pak
echo 'ln -sf /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-system-x86_64' >> ~/qemu-4.0.0/postinstall-pak
echo 'ln -sf /usr/local/bin/qemu-system-x86_64 /usr/bin/kvm' >> ~/qemu-4.0.0/postinstall-pak
echo 'exit 0' >> ~/qemu-4.0.0/postinstall-pak
echo '#!/bin/sh' > ~/qemu-4.0.0/postremove-pak
echo 'rm -f /usr/bin/qemu-img' >> ~/qemu-4.0.0/postremove-pak
echo 'rm -f /usr/bin/qemu-system-x86_64' >> ~/qemu-4.0.0/postremove-pak
echo 'rm -f /usr/bin/kvm' >> ~/qemu-4.0.0/postremove-pak
echo 'exit 0' >> ~/qemu-4.0.0/postremove-pak
echo 'Building QEMU 4.0.0 Debian Package...'
checkinstall -D --install=no --fstrans=no --reset-uids=yes --pkgname=qemu --pkgversion=4:0.0 --pkglicense=GPL --pkggroup=Virtualization --provides=qemu --maintainer="Zach Spreuer \<spreuer.zach@gmail.com\>"
echo 'Moving Package to Home Directory...'
mv ~/qemu-4.0.0/qemu_0.0-1_amd64.deb ~/qemu-4.0.0_amd64.deb
echo 'Deleting QEMU Source Directory...'
rm -rf ~/qemu-4.0.0/
echo 'Deleting QEMU Source File...'
rm ~/qemu-4.0.0.tar.xz