WPML not installed and activated.

Qemu-kvm et spice from git

By spl on 9 juin 2013 in Côté serveur, Virtualisation
0
3

Pour se tenir à jour au niveau des release, rien de mieux que git et un script.
La version de qemu livrée avec wheezy (la debian stable en vigueur) est la version 1.1.2.
La communauté qemu quant à elle travaille sur la 1.5 et la dernière branche stable est la 1.4.
Aussi depuis la version 1.3, kvm et qemu ont fusionné au sens GIT du terme.

Concernant spice, la compilation est plus ardue car les dépendances sont plus nombreuses.

Le script ci dessous est écrit pour debian wheezy et permet d’obtenir un package qemu spice assez générique :

#!/bin/bash

# SPL 20130608

BUILD_DIR=/usr/local/src/kvm
TARGET_DIR=/usr/local

if [ ! -e $BUILD_DIR ]; then mkdir -p $BUILD_DIR; fi
cd $BUILD_DIR

case "$1" in
    apt-check)
    apt-get install build-essential autoconf git-core libtool liblog4cpp5-dev libavcodec-dev libssl-dev xlibmesa-glu-dev libasound-dev libpng12-dev libfreetype6-dev libfontconfig1-dev libogg-dev libxrandr-dev kvm libgcrypt-dev libsdl-dev libnss3-dev libpixman-1-dev libxfixes-dev libjpeg8-dev libsasl2-dev python-pyparsing

    apt-get install automake libglib2.0-dev python-pyparsing libclalsadrv-dev libjpeg-dev libsasl2-dev
    apt-get install libaio-dev
    ;;
    init)
    git clone git://git.libusb.org/libusb.git
    git clone git://git.freedesktop.org/git/spice/spice-protocol
    git clone git://anongit.freedesktop.org/spice/usbredir
    git clone git://anongit.freedesktop.org/pixman
    #git clone https://github.com/haxar/celt
    wget https://launchpad.net/~dev-zero/+archive/spice/+files/libcelt051-dev_0.5.1.3-2_amd64.deb
    wget https://launchpad.net/~dev-zero/+archive/spice/+files/libcelt051_0.5.1.3-2_amd64.deb
    #git clone git://anongit.freedesktop.org/~alon/libcacard
    wget http://spice-space.org/download/libcacard/libcacard-0.1.2.tar.gz
    tar xvfz libcacard-0.1.2.tar.gz
    git clone git://git.freedesktop.org/git/spice/slirp
    git clone git://anongit.freedesktop.org/spice/spice
    git clone git://git.qemu-project.org/qemu.git
    ;;
    build)
    cd $BUILD_DIR/libusb
    ./autogen.sh
    ./configure
    make clean
    make -j 4
    make install

    cd $BUILD_DIR/usbredir
    ./autogen.sh
    ./configure
    make clean
    make -j 4
    make install

    cd $BUILD_DIR/spice-protocol
    ./autogen.sh
    ./configure
    make clean
    make -j 4
    make install

    cd $BUILD_DIR/pixman
    ./autogen.sh
    make clean
    make -j 4
    make install

    dpkg -i $BUILD_DIR/libcelt051_0.5.1.3-2_amd64.deb
    dpkg -i $BUILD_DIR/libcelt051-dev_0.5.1.3-2_amd64.deb

    cd $BUILD_DIR/libcacard-0.1.2
    ./autogen.sh
    ./configure
    make clean
    make -j 4
    make install

    cd $BUILD_DIR/spice
    ./autogen.sh
    ./configure --enable-smartcard
    make clean
    make -j 4
    make install

    cd $BUILD_DIR/qemu
    ./autogen.sh
    ./configure --enable-smartcard-nss --enable-kvm --enable-system --enable-spice  --enable-linux-aio --enable-sdl --target-list=x86_64-softmmu --enable-usb-redir '--audio-drv-list=oss alsa sdl'
    #./configure  --target-list=x86_64-softmmu --enable-kvm --enable-system --enable-vhost-net --enable-spice --enable-vnc-png --enable-vnc-jpeg --enable-guest-agent --enable-sdl --enable-vnc --enable-linux-aio
    make -j 4
    make install

    export LD_LIBRARY_PATH=/usr/local/lib
    qemu-system-x86_64 --version
    ;;
    remove)
    cd $BUILD_DIR/libusb
    make uninstall

    cd $BUILD_DIR/usbredir
    make uninstall

    cd $BUILD_DIR/spice-protocol
    make uninstall

    cd $BUILD_DIR/pixman
    make uninstall

    dpkg -P libcelt051-dev
    dpkg -P libcelt051

    cd $BUILD_DIR/libcacard-0.1.2
    make uninstall

    cd $BUILD_DIR/spice
    make uninstall

    cd $BUILD_DIR/qemu
    #make uninstall
    rm -f $TARGET_DIR/bin/qemu*
    ;;
    update)
    cd $BUILD_DIR/qemu
    git pull

    cd $BUILD_DIR/spice
    git pull

    cd $BUILD_DIR/libusb
    git pull

    cd $BUILD_DIR/spice-protocol
    git pull

    cd $BUILD_DIR/pixman
    git pull
    ;;
    setenv)
        if [ -z "$LD_LIBRARY_PATH" ]; then
            echo "LD_LIBRARY_PATH=/usr/local/lib" >> /etc/profile
            export LD_LIBRARY_PATH=/usr/local/lib
        fi
        update-alternatives --install /usr/bin/qemu qemu /usr/local/bin/qemu-system-x86_64 0
        update-alternatives --set qemu /usr/local/bin/qemu-system-x86_64
        ;;
    unsetenv)
        update-alternatives --set qemu /usr/bin/qemu-system-x86_64
        ;;
esac

Le résultat :

qemu --version
QEMU emulator version 1.5.50, Copyright (c) 2003-2008 Fabrice Bellard

Pour construire la dernière version stable de qemu (1.4)

cd /usr/local/src/kvm/qemu
git branch -a
* master
  stable-1.4
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/stable-0.10
  remotes/origin/stable-0.11
  remotes/origin/stable-0.12
  remotes/origin/stable-0.13
  remotes/origin/stable-0.14
  remotes/origin/stable-0.15
  remotes/origin/stable-1.0
  remotes/origin/stable-1.1
  remotes/origin/stable-1.2
  remotes/origin/stable-1.3
  remotes/origin/stable-1.4
  remotes/origin/staging
git checkout stable-1.4
git reset --hard HEAD
git pull
./autogen.sh
./configure --enable-smartcard-nss --enable-kvm --enable-system --enable-spice --enable-linux-aio --enable-sdl --target-list=x86_64-softmmu --enable-usb-redir '--audio-drv-list=oss alsa sdl' --enable-vhost-net
make -j 4
make install

It works !

spl

About the Author

splView all posts by spl
Loading Facebook Comments ...

0 Comments

Add comment

Leave a Reply

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

*

CommentLuv badge