2014年10月22日 星期三

安裝 QEMU Linaro 完整版

1. 修改鏡像站

先準備 Debian backports 鏡像站,後面安裝工具會需要:
sudo vi /etc/apt/sources.list

加入下面這行:
deb http://ftp.tw.debian.org/debian wheezy-backports main

下一步請更新套件
sudo apt-get update && apt-get upgrade

2. 下載 QEMU-Linaro

至 qemu-linaro 官方下載其檔案:
官方位置: https://launchpad.net/qemu-linaro
載點: qemu-linaro-1.7.0-2014.01.tar.gz

下載完後解壓縮,並進去 ./configure
tar xfva qemu-linaro-1.7.0-2014.01.tar.gz
cd qemu-linaro-1.7.0-2014.01/
 ./configure

可能遇到以下 ERROR:

問題1:
ERROR: pixman not present. Your options:
         (1) Preferred: Install the pixman devel package (any recent
             distro should have packages as Xorg needs pixman too).
         (2) Fetch the pixman submodule, using:
             git submodule update --init pixman
解決1:
sudo apt-get install libseccomp-dev

問題2:
ERROR: DTC not present. Your options:
         (1) Preferred: Install the DTC devel package
         (2) Fetch the DTC submodule, using:
             git submodule update --init dtc
解決2:
sudo apt-get install -y libfdt-dev

成功後可以看到 ./configure 的內容後,
但是大多的功能都是 support no,
接下來要讓它們變 yes ,進行完整化。


3. 要安裝以下套件

libnss3-dev
libudev-dev
libpng12-dev
libghc6-zlib-dev
libogg-dev
libglobus-openssl-dev
libxrandr-dev
libxfixes-dev
libjpeg8-dev
libsasl2-dev
libiscsi-dev
librbd-dev
xfslibs-dev
libbrlapi-dev
libbluetooth-dev
libxen-dev
libvte-dev
libseccomp-dev
python-pyparsing

sudo apt-get install libnss3-dev libudev-dev libpng12-dev libghc6-zlib-dev libogg-dev libglobus-openssl-dev libxrandr-dev libxfixes-dev libjpeg8-dev libsasl2-dev libiscsi-dev librbd-dev xfslibs-dev libbrlapi-dev libbluetooth-dev libxen-dev libvte-dev libseccomp-dev python-pyparsing

接下來處理幾個比較麻煩的套件,
可以查看  qemu-linaro-1.7.0-2014.01/ 目錄下的 configure 內容,
vi configure

輸入關鍵字(例如 spice),可以找到所缺少的套件。

spice support 要讓這個功能需要裝有
 --atleast-version=0.12.0 spice-server  (至少 0.12.0 版以上)
--atleast-version=0.12.3 spice-protocol (至少 0.12.3 版以上)

我們要到 spice 官方,下載,安裝如下面步驟:

4. 安裝 spice-0.12.5 

(如有遇到問題,解決方法在下面)
下載 spice-0.12.5.tar.bz2

tar xfva spice-0.12.5.tar.bz2
cd spice-0.12.5/

這邊的設定要多加 smartcard 開啟
./configure --enable-smartcard

會看到輸出:
Spice 0.12.5
        ==============
        prefix:                   /usr/local
        c compiler:               gcc -std=gnu99
        c++ compiler:             g++
        python:                   /usr/bin/python2
        Build Spice client:       no
        Smartcard:                yes
        SASL support:             yes
        Automated tests:          no
        Manual:                   no
        Now type 'make' to build spice

才接著編譯及安裝:
make -j ${core number}
sudo make install


裝 spice 問題一 (如果沒有就跳過此步驟)
Alternatively, you may set the environment variables CELT051_CFLAGS
and CELT051_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

因為 spice-0.12.5 只接受 CELT 051 版。

解決:
下載 celt-0.5.1.3.tar.gz
tar xfva celt-0.5.1.3.tar.gz
cd celt-0.5.1.3/
./configure
make  -j ${core number}
sudo make install

裝 spice 問題二 (如果沒有就跳過此步驟)
checking for pyparsing python module... not found
configure: error: pyparsing python module is required to compile this package
解決:
sudo apt-get install python-pyparsing

裝 spice 問題三 (如果沒有就跳過此步驟)
checking sasl/sasl.h usability... no
checking sasl/sasl.h presence... no
checking for sasl/sasl.h... no
checking for sasl_client_init in -lsasl2... no
checking for sasl_client_init in -lsasl... no
configure: error: Missing required Cyrus SASL development package
解決:
sudo apt-get install libsasl2-dev


裝 spice 問題四 (如果沒有就跳過此步驟)
checking for SMARTCARD... no
configure: error: Package requirements (libcacard >= 0.1.2) were not met:
No package 'libcacard' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.
Alternatively, you may set the environment variables SMARTCARD_CFLAGS
and SMARTCARD_LIBS to avoid the need to call pkg-config.
解決:
下載 libcacard-0.1.2.tar.bz2
tar xfva libcacard-0.1.2.tar.bz2
cd  libcacard-0.1.2/
./configure
make -j ${core number}
sudo make install

承上面問題,裝 libcacard 問題 (如果沒有就跳過此步驟)
checking for NSS... no
configure: error: Package requirements (nss) were not met:
No package 'nss' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix.
Alternatively, you may set the environment variables NSS_CFLAGS
and NSS_LIBS to avoid the need to call pkg-config.
解決:
sudo apt-get install libnss3-dev


5. 安裝 spice-protocol-0.12.7

下載 spice-protocol-0.12.7.tar.bz2
tar xfva spice-protocol-0.12.7.tar.bz2
cd spice-protocol-0.12.7/
./configure
make -j ${core number}
sudo make install


6. 安裝 libusb-1.0.1

下載 libusb-1.0.19/libusb-1.0.19.tar.bz2
tar xfva libusb-1.0.19.tar.bz2
cd libusb-1.0.19/
./configure
make -j ${core number}
sudo make install


7. 安裝 usbredir-0.7

下載 usbredir-0.7.tar.bz2
tar xfva usbredir-0.7.tar.bz2
cd usbredir-0.7/
./configure
make -j ${core number}
sudo make install


8. 再回到(步驟 2.)  裝 qemu-linaro

cd qemu-linaro-1.7.0-2014.01/
./configure
內容如下:
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
-Werror enabled   no
pixman            system
SDL support       yes
GTK support       yes
curses support    yes
curl support      yes
mingw32 support   no
Audio drivers     oss
Block whitelist (rw)
Block whitelist (ro)
VirtFS support    yes
VNC support       yes
VNC TLS support   yes
VNC SASL support  yes
VNC JPEG support  yes
VNC PNG support   yes
VNC WS support    yes
xen support       yes
brlapi support    yes
bluez  support    yes
Documentation     yes
GUEST_BASE        yes
PIE               yes
vde support       yes
Linux AIO support yes
ATTR/XATTR support yes
Install blobs     yes
KVM support       yes
RDMA support      yes
TCG interpreter   no
fdt support       yes
preadv support    yes
fdatasync         yes
madvise           yes
posix_madvise     yes
sigev_thread_id   yes
uuid support      yes
libcap-ng support yes
vhost-net support yes
vhost-scsi support yes
Trace backend     nop
Trace output file trace-
spice support     yes (0.12.7/0.12.5)
rbd support       yes
xfsctl support    yes
nss used          yes
libusb            yes
usb net redir     yes
GLX support       yes
libiscsi support  yes
build guest agent yes
QGA VSS support   no
seccomp support   yes
coroutine backend ucontext
coroutine pool    yes
GlusterFS support no
virtio-blk-data-plane yes
gcov              gcov
gcov enabled      no
TPM support       no
libssh2 support   yes
TPM passthrough   no
QOM debugging     yes
vhdx              yes
接著編譯:
make -j ${core number}
安裝:
sudo make install


9. 重整 qemu 檔案路徑

安裝完後可能出現檔案路徑問題,請執行:
ldconfig


10. 查看版本

qemu-system-arm -version
QEMU emulator version 1.7.0 (qemu-linaro 2014.01), Copyright (c) 2003-2008 Fabrice Bellard

qemu-system-arm -M ?
Supported machines are:
none                 empty machine
beagle               Beagle board (OMAP3530)
beaglexm             Beagle board XM (OMAP3630)
collie               Collie PDA (SA-1110)
nuri                 Samsung NURI board (Exynos4210)
smdkc210             Samsung SMDKC210 board (Exynos4210)
connex               Gumstix Connex (PXA255)
verdex               Gumstix Verdex (PXA270)
highbank             Calxeda Highbank (ECX-1000)
midway               Calxeda Midway (ECX-2000)
integratorcp         ARM Integrator/CP (ARM926EJ-S) (default)
kzm                  ARM KZM Emulation Baseboard (ARM1136)
mainstone            Mainstone II (PXA27x)
musicpal             Marvell 88w8618 / MusicPal (ARM926EJ-S)
n800                 Nokia N800 tablet aka. RX-34 (OMAP2420)
n810                 Nokia N810 tablet aka. RX-44 (OMAP2420)
n900                 Nokia N900 (OMAP3)
sx1                  Siemens SX1 (OMAP310) V2
sx1-v1               Siemens SX1 (OMAP310) V1
overo                Gumstix Overo board (OMAP3530)
cheetah              Palm Tungsten|E aka. Cheetah PDA (OMAP310)
realview-eb          ARM RealView Emulation Baseboard (ARM926EJ-S)
realview-eb-mpcore   ARM RealView Emulation Baseboard (ARM11MPCore)
realview-pb-a8       ARM RealView Platform Baseboard for Cortex-A8
realview-pbx-a9      ARM RealView Platform Baseboard Explore for Cortex-A9
akita                Akita PDA (PXA270)
spitz                Spitz PDA (PXA270)
borzoi               Borzoi PDA (PXA270)
terrier              Terrier PDA (PXA270)
lm3s811evb           Stellaris LM3S811EVB
lm3s6965evb          Stellaris LM3S6965EVB
tosa                 Tosa PDA (PXA255)
versatilepb          ARM Versatile/PB (ARM926EJ-S)
versatileab          ARM Versatile/AB (ARM926EJ-S)
vexpress-a9          ARM Versatile Express for Cortex-A9
vexpress-a15         ARM Versatile Express for Cortex-A15
xilinx-zynq-a9       Xilinx Zynq Platform Baseboard for Cortex-A9
z2                   Zipit Z2 (PXA27x)





其他 QEMU Bug 排除,參考文章:Bridge 建立橋接網路(QEMU Debug) 下方內容。

Reference:
http://pominglee.blogspot.tw/2014/06/linaro-qemu.html


沒有留言:

張貼留言