summaryrefslogtreecommitdiffstats
path: root/archievm
Side-by-side diff
Diffstat (limited to 'archievm') (more/less context) (ignore whitespace changes)
-rwxr-xr-xarchievm15
1 files changed, 1 insertions, 14 deletions
diff --git a/archievm b/archievm
index c20b6c2..b37600d 100755
--- a/archievm
+++ b/archievm
@@ -1,11 +1,8 @@
#!/bin/zsh
-#[[ ! $(whoami) == 'root' ]] && exit 1
-#sudo modprobe -a -v kvm kvm_intel virtio virtio_pci virtio_balloon virtio_blk virtio_net virtio_console virtio_rng 9pnet_virtio
-#sudo modprobe -a -v kvm kvm_intel nbd
lsmod | grep -q kvm_intel || {
sudo modprobe -a -v kvm kvm_intel
}
debugk=0
nographic=1
mem=512
@@ -15,13 +12,12 @@ ksm=0
console=0
runas="raghavendra"
DIR="/home/raghavendra/Arch/qemu"
bzImage="$DIR/kvmImage"
image="/media/Sparowes/Virt/Archie.img"
soutput=1
-#append="root=/dev/vda3"
typeset -A args
args=(d debugk c console n nographic g huge I bzImage t test s soutput)
while getopts ':gn:dI:th' opt;do
case $opt in
@@ -61,15 +57,13 @@ if [[ $debugk == 1 ]];then
external=" -kernel $bzImage -initrd /boot/kernel26-.img -append \"root=/dev/vda3\" "
fi
fi
if [[ $huge == 1 && $test == 0 ]];then
echo 148 | sudo tee /proc/sys/vm/nr_hugepages
- #hugearg=" -mem-path /media/hugepages -mem-prealloc "
hugearg=" -mem-path /media/hugepages "
- #hugearg=" -mem-path /media/hugepages "
fi
if [[ $nographic == 1 ]];then
graph=" -daemonize -nographic "
else
graph=" -vga std -sdl -no-frame"
@@ -90,27 +84,20 @@ cmdline="qemu-kvm -name Archie -enable-kvm -s -monitor unix:$DIR/archie.sock,ser
-net nic,model=virtio,vlan=1 -net user,vlan=1,hostfwd=tcp:127.0.0.1:2222-:22 $=graph \
-virtfs local,path=$DIR/share,security_model=none,mount_tag=share \
-virtfs local,path=/var/cache/pacman/pkg,security_model=none,mount_tag=pacman \
-virtfs local,path=/media/Corona/bldit/.gcov,security_model=none,mount_tag=gcov \
$external -runas $runas $=EARGS"
-#echo "$cmdline"
-#exit
-eval $=cmdline
+eval $=cmdline || exit 12
if [[ $ksm == 1 ]];then
echo 1 | sudo tee /sys/kernel/mm/ksm/run
fi
-#sleep 5
-#sudo -u $runas sshfs -p 2222 [email protected]:/ /mnt-qemu
sshfs -p 2222 [email protected]:/home/raghu/gcov /media/Corona/bldit/.gcov
-#rlwrap -pgreen socat - $DIR/archie.sock
if [[ $console == 1 ]];then
rlwrap socat - $DIR/archie.sock
else
if [[ $nographic == 1 ]];then
ssh -p 2222 [email protected]
fi
fi
-#qemu-kvm -name Archie -enable-kvm -m 512 -snapshot -drive file=/media/Inkq/Virt/Archie.img,if=virtio -vga std -kernel ~/Arch/qemu/kvmImage -initrd /boot/kernel26.img -append root=/dev/vda3
-#qemu-kvm -name Archie -enable-kvm -m 512 -snapshot -hda /media/Inkq/Virt/Archie.img -vga std -kernel ~/Arch/qemu/kvmImage -initrd /boot/kernel26-wye.img -append "root=/dev/sda3 console=ttyS0 earlyprintk=serial,ttyS0" -serial file:/tmp/x.log#