4ab98b5f6450827f07e8943db80ee7d90cd35299
[armband.git] / patches / opnfv-fuel / 0002-lib.sh-AArch64-Use-VGA-video-mode-for-guests.patch
1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Tue, 11 Jul 2017 18:35:40 +0200
3 Subject: [PATCH] lib.sh: AArch64: Use VGA video mode for guests
4
5 On AArch64, there is no Cirrus video, so use VGA mode instead.
6 For now, we install vgabios package no matter the arch, although
7 it is only used on AArch64.
8
9 On Debian systems, also fix a missing link for vgabios-stdvga.bin.
10 Based on previous Armband work from [1].
11
12 [1] https://github.com/opnfv/armband/blob/danube.2.0/patches/fuel-library/
13     arm64-bug-fixes/0002-Install-vgabios-and-link-for-aarch64.patch
14
15 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
16 ---
17  ci/deploy.sh       |  5 +++--
18  mcp/scripts/lib.sh | 10 +++++++++-
19  2 files changed, 12 insertions(+), 3 deletions(-)
20
21 diff --git a/ci/deploy.sh b/ci/deploy.sh
22 index a1f5e38..92c7947 100755
23 --- a/ci/deploy.sh
24 +++ b/ci/deploy.sh
25 @@ -230,8 +230,9 @@ pushd ${DEPLOY_DIR} > /dev/null
26  # scenario, etc.
27
28  # Install required packages
29 -[ -n "$(command -v apt-get)" ] && apt-get install -y mkisofs curl virtinst cpu-checker qemu-kvm
30 -[ -n "$(command -v yum)" ] && yum install -y genisoimage curl virt-install qemu-kvm
31 +[ -n "$(command -v apt-get)" ] && apt-get install -y mkisofs curl virtinst cpu-checker qemu-kvm vgabios && \
32 +  ln -sf /usr/share/vgabios/vgabios.bin /usr/share/qemu/vgabios-stdvga.bin
33 +[ -n "$(command -v yum)" ] && yum install -y genisoimage curl virt-install qemu-kvm vgabios
34
35  # Check scenario file existence
36  if [[ ! -f  ../config/${DEPLOY_SCENARIO}.yaml ]]; then
37 diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
38 index c315323..862fdcc 100644
39 --- a/mcp/scripts/lib.sh
40 +++ b/mcp/scripts/lib.sh
41 @@ -56,6 +56,13 @@ create_vms() {
42    local -n vnodes_ram=$2
43    local -n vnodes_vcpus=$3
44
45 +  # AArch64: prepare arch specific arguments
46 +  local virt_extra_args=""
47 +  if [ "$(uname -i)" = "aarch64" ]; then
48 +    # No Cirrus VGA on AArch64, use vga std
49 +    virt_extra_args="$virt_extra_args --video=vga"
50 +  fi
51 +
52    # create vms with specified options
53    for node in "${vnodes[@]}"; do
54      virt-install --name ${node} --ram ${vnodes_ram[$node]} --vcpus ${vnodes_vcpus[$node]} --cpu host --accelerate \
55 @@ -67,7 +74,8 @@ create_vms() {
56      --os-type linux --os-variant none \
57      --boot hd --vnc --console pty --autostart --noreboot \
58      --disk path=$(pwd)/images/mcp_${node}.iso,device=cdrom \
59 -    --noautoconsole
60 +    --noautoconsole \
61 +    ${virt_extra_args}
62    done
63  }
64