2014年11月4日 星期二

一些build new kernel的東東

http://people.cs.nctu.edu.tw/~chenwj/dokuwiki/doku.php?id=ubuntu

其中在ubuntu 12.04,若有改boot options,在/boot/grub/grub.cfg

改完要update-grub

2014年11月3日 星期一

virtGL筆記

with apt-get:

freeglut3.dev
pkg-config
libpixman-1-dev
libasound2-dev
libssl-dev
libxrandr-dev
libxfixes-dev 
libxrender-dev 
x11proto-core-dev
libjpeg62-dev  
libsasl2-dev 
libglib2.0-dev
libgl1-mesa-dev
libnss3-dev
g++

apt-get install build-essential
apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
apt-get install vncviewer


wget https://launchpad.net/~dev-zero/+archive/ubuntu/spice/+files/libcelt051_0.5.1.3-2_amd64.deb
wget https://launchpad.net/~dev-zero/+archive/ubuntu/spice/+files/libcelt051-dev_0.5.1.3-2_amd64.deb
wget http://www.spice-space.org/download/libcacard/libcacard-0.1.2.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/python-pyparsing_2.0.3%2Bdfsg1-1_all.deb


dpkg -i libcelt051_0.5.1.3-2_amd64.deb
dpkg -i libcelt051-dev_0.5.1.3-2_amd64.deb
dpkg -i python-pyparsing_2.0.3+dfsg1-1_all.deb 


tar zxvf libcacard-0.1.2.tar.gz

cd libcacard-0.1.2

./configure

make

make install
======

////////////////////
at spice/git/spice

chmod 777 configure
./configure
make
make install
////////////////////

////////////////////
at spice/git/spice/spice-protocol
chmod 777 configure
./configure
make
make install
////////////////////

//////////////////
at spice/git/spice/spice-common
./configure
make
make install
//////////////////



at spice/git/qemu/

git checkout hw/{qxl,qxl-logger,qxl-render}.c

chmod 777 configure

./configure --target-list=x86_64-softmmu --enable-opengl --enable-spice --extra-ldflags="-lm -lrt -lX11" --disable-docs --disable-werror --disable-libiscsi


modify Makefile.target : LIBS+=-lm -> LIBS+=-lm -lGL -lGLU -lglut -lX11

make clean

make 

make install

============

crete vm:

qemu-img create -f qcow2 ex.qcow2 10G

edit: /etc/bash.bashrc
export LD_LIBRARY_PATH=/usr/local/lib

wget http://old-releases.ubuntu.com/releases/11.10/ubuntu-11.10-alternate-amd64.iso


=================
執行了:

qemu-system-x86_64 -drive file=ex.qcow2,if=ide -soundhw ac97 -cdrom ubuntu-11.10-alternate-amd64.iso -boot d -vga qxl -spice port=5901,disable-ticketing -enable-kvm -m 1024 -device virtio-opengl-pci -chardev spicevmc,id=vdagent,name=vdagent 

connect:
spicec -h 127.0.0.1 -p 5901

spice連太慢的話改這個:

qemu-system-x86_64 -drive file=ex.qcow2,if=ide -soundhw ac97 -cdrom ubuntu-11.10-alternate-amd64.iso -boot d -vga qxl -vnc :5,disable-ticketing -enable-kvm -m 1024 -device virtio-opengl-pci -chardev spicevmc,id=vdagent,name=vdagent 

connect:

vncviewer :5905




=====================
開guest:
/home/sslab719/virtgl/spice/git/qemu/x86_64-softmmu/qemu-system-x86_64 -drive file=ex.qcow2,if=ide -soundhw ac97 -boot d -vga qxl -spice port=5901,disable-ticketing -enable-kvm -m 1024 -device virtio-opengl-pci -chardev spicevmc,id=vdagent,name=vdagent -net user,hostfwd=tcp::10022-:22 -net nic


replace /etc/apt/sources.list:

deb http://old-releases.ubuntu.com/ubuntu/ oneiric main
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric main
deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric-updates main
deb http://old-releases.ubuntu.com/ubuntu/ oneiric universe
deb-src http://old-releases.ubuntu.com/ubuntu/ oneiric universe
deb http://old-releases.ubuntu.com/ubuntu/ oneiric-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ 
————————————
sudo apt-get update
sudo apt-get upgrade
————————————

Guest:
kernel 3.0.0.12 (ex. ubuntu 11.10)

package:
officail spice protocol :http://www.spice-space.org/download.html
apt-get 
xserver-xorg-video-qxl
freeglut3.dev
xorg-dev

/virtgl/guest/virtio/virtio-gl.c 
add #define VIRTIO_ID_OPENGL 10

/virtgl/guest/virtio/ 
make
make install
use dmesg check virtio-gl module major id 
modify makefile to fit the nod id into virtio-gl's major id
make nod
virtgl/guest/gl
make 


make run                  #test glxgears