Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- workdir=/tmp/qemu-kvm
- bin=/usr/local/opt/qemu-kvm/bin
- lib=/usr/local/opt/qemu-kvm/lib
- rootfs="/dev/root"
- mkdir -p $bin && mkdir $lib
- # The ar utility is needed to decompress .deb files.
- curl -LJ https://github.com/psammarco/KVM-on-ChromeOS/blob/master/ar?raw=true -o $bin/ar
- curl -LJ https://github.com/psammarco/KVM-on-ChromeOS/blob/master/libbfd-2.28-system.so?raw=true -o $lib/libbfd-2.28-system.so
- chmod u+x $bin/ar
- ### ChromeOS's Specific!!!
- # The following assumes rootfs_verification for / has already been removed
- if grep $rootfs /proc/mounts | grep ro; then
- mount -o remount,rw / &> mount.out
- elif
- grep -iw 'read-write' mount.out; then
- echo '\nrootfs_verification for the root partition must to be removed in order to remount,rw /
- To remove rootfs_verification run the following command and than reboot the system:
- "sudo /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions 4"'
- else exit 1
- fi
- echo -e 'LD_LIBRARY_PATH="/usr/local/opt/qemu-kvm/lib"\nPATH="/usr/local/opt/qemu-kvm/bin:$PATH"' > /etc/env.d/30kvm && source /etc/env.d/30kvm
- ### End ChromeOS's Specific
- ### qemu-kvm_2.8's binary download and installation tasks.
- #
- mkdir -p $workdir/qemu-kvm_2.8 && cd $workdir/qemu-kvm_2.8
- curl -O http://ftp.us.debian.org/debian/pool/main/q/qemu/qemu-kvm_2.8+dfsg-6+deb9u5_amd64.deb
- ar x qemu-kvm_2.8+dfsg-6+deb9u5_amd64.deb | tar -xzvf control.tar.gz && tar -xvf data.tar.xz
- # Validates the md5 hash of the binary, copies it to $bin and set exec permissions;
- if md5sum -c md5sums; then
- cp usr/bin/kvm $bin/ && chmod u+x $bin/kvm
- else
- exit 1
- fi
- #
- ### done
- mkdir $workdir/qemu-system-x86 && cd ../qemu-system-x86
- curl -O http://ftp.us.debian.org/debian/pool/main/q/qemu/qemu-system-x86_2.8+dfsg-6+deb9u5_amd64.deb
- ar x qemu-system-x86_2.8+dfsg-6+deb9u5_amd64.deb | tar -xzvf control.tar.gz && tar -xvf data.tar.xz
- if md5sum -c md5sums; then
- cp usr/bin/qemu-system* $bin/ && chmod u+x $bin/qemu-system*
- else
- exit 1
- fi
- echo "To uninstall it, simply run rm -r /usr/local/opt/qemu-kvm as root"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement