snap: update QEMU to 4.0.0

Update QEMU to 4.0.0 since it's now officially supported in Kata Containers

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes
2019-07-08 16:23:51 +00:00
parent 0bbce8e652
commit cc4e59f19d

View File

@@ -264,7 +264,7 @@ parts:
qemu: qemu:
plugin: make plugin: make
after: [qemu-scripts-dump, qemu-lite-patches-dump, qemu-aarch64-patches-dump] after: [scripts-dump, qemu-patches-dump, qemu-aarch64-patches-dump, yq]
build-packages: build-packages:
- gcc - gcc
- python - python
@@ -279,26 +279,25 @@ parts:
- libfdt-dev - libfdt-dev
- curl - curl
- libcapstone-dev - libcapstone-dev
build-snaps:
- yq
override-build: | override-build: |
yq=$(realpath ../../yq/build/yq)
pkg_name="qemu" pkg_name="qemu"
versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml versions_url=https://raw.githubusercontent.com/kata-containers/runtime/${SNAPCRAFT_PROJECT_VERSION}/versions.yaml
# arch-specific definition # arch-specific definition
case "$(uname -m)" in case "$(uname -m)" in
"aarch64") "aarch64")
branch="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.architecture.aarch64.branch)" branch="$(curl -sSL ${versions_url} | ${yq} r - assets.hypervisor.qemu.architecture.aarch64.branch)"
url="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.url)" url="$(curl -sSL ${versions_url} | ${yq} r - assets.hypervisor.qemu.url)"
commit="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu.architecture.aarch64.commit)" commit="$(curl -sSL ${versions_url} | ${yq} r - assets.hypervisor.qemu.architecture.aarch64.commit)"
patch_dir="${SNAPCRAFT_STAGE}/qemu-aarch64/patches/" patch_dir="${SNAPCRAFT_STAGE}/qemu-aarch64/patches/"
;; ;;
*) *)
branch="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu-lite.branch)" branch="$(curl -sSL ${versions_url} | ${yq} r - assets.hypervisor.qemu.tag)"
url="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu-lite.url)" url="$(curl -sSL ${versions_url} | ${yq} r - assets.hypervisor.qemu.url)"
commit="$(curl -sSL ${versions_url} | yq r - assets.hypervisor.qemu-lite.commit)" patch_dir="${SNAPCRAFT_STAGE}/qemu/patches/4.0.x"
patch_dir="${SNAPCRAFT_STAGE}/qemu-lite/patches/" commit=""
;; ;;
esac esac
@@ -306,7 +305,7 @@ parts:
pkg_repo_dir="${pkg_name}-repo" pkg_repo_dir="${pkg_name}-repo"
git clone --branch ${branch} --single-branch ${url} "${pkg_repo_dir}" git clone --branch ${branch} --single-branch ${url} "${pkg_repo_dir}"
cd ${pkg_repo_dir} cd ${pkg_repo_dir}
git checkout ${commit} [ -z "${commit}" ] || git checkout ${commit}
[ -n "$(ls -A ui/keycodemapdb)" ] || git clone https://github.com/qemu/keycodemapdb ui/keycodemapdb/ [ -n "$(ls -A ui/keycodemapdb)" ] || git clone https://github.com/qemu/keycodemapdb ui/keycodemapdb/
[ -n "$(ls -A capstone)" ] || git clone https://github.com/qemu/capstone capstone [ -n "$(ls -A capstone)" ] || git clone https://github.com/qemu/capstone capstone
@@ -321,9 +320,9 @@ parts:
--input "$patch" --input "$patch"
done done
chmod +x ${SNAPCRAFT_STAGE}/qemu/scripts/configure-hypervisor.sh chmod +x ${SNAPCRAFT_STAGE}/scripts/configure-hypervisor.sh
# static build # static build
echo "$(${SNAPCRAFT_STAGE}/qemu/scripts/configure-hypervisor.sh -s qemu) \ echo "$(${SNAPCRAFT_STAGE}/scripts/configure-hypervisor.sh -s qemu) \
--disable-rbd --disable-rbd
--prefix=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr \ --prefix=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr \
--datadir=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr/share \ --datadir=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr/share \
@@ -346,18 +345,11 @@ parts:
# Hack: move qemu to / # Hack: move qemu to /
"snap/kata-containers/current/": "./" "snap/kata-containers/current/": "./"
qemu-scripts-dump: qemu-patches-dump:
source: scripts source: qemu/patches/
plugin: dump plugin: dump
organize: organize:
'*' : qemu/scripts/ '*' : qemu/patches/
prime:
- -*
qemu-lite-patches-dump:
source: obs-packaging/qemu-lite/patches/
plugin: dump
organize:
'*' : qemu-lite/patches/
prime: prime:
- -* - -*
qemu-aarch64-patches-dump: qemu-aarch64-patches-dump: