Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
build: update qemu for rhel-8.6 and ubuntu-22.04
Browse files Browse the repository at this point in the history
Use MVP-QEMU-6.2-v3.1 downstream patch set for qemu build.

Signed-off-by: jialeie <jialei.feng@intel.com>
  • Loading branch information
jialeif committed Oct 13, 2022
1 parent 84be43c commit 3d7809d
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 27 deletions.
20 changes: 12 additions & 8 deletions build/centos-stream-8/intel-mvp-tdx-qemu-kvm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@ set -ex

CURR_DIR="$(dirname "$(readlink -f "$0")")"

DOWNSTREAM_GIT_URI="https://github.com/intel/qemu-dcp.git"
DOWNSTREAM_TAG="c8302707f6e89c955eae0883bfd97680202b8db2"
UPSTREAM_GIT_URI="https://github.com/qemu/qemu.git"
UPSTREAM_TAG="4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0"
DOWNSTREAM_TARBALL="tdx-qemu.tar.gz"

PATCHSET="${CURR_DIR}/../../common/patches-tdx-qemu-MVP-QEMU-6.2-v3.1.tar.gz"
SPEC_FILE="${CURR_DIR}/tdx-qemu.spec"
RPMBUILD_DIR="${CURR_DIR}/rpmbuild"

create_tarball() {
cd "${CURR_DIR}"
if [[ ! -d qemu ]]; then
git clone ${DOWNSTREAM_GIT_URI} qemu
fi
if [[ ! -f "${RPMBUILD_DIR}"/SOURCES/${DOWNSTREAM_TARBALL} ]]; then
git clone ${UPSTREAM_GIT_URI} qemu
tar xf "${PATCHSET}"
pushd qemu
git checkout ${DOWNSTREAM_TAG}
git checkout ${UPSTREAM_TAG}
git config user.name "${USER:-tdx-builder}"
git config user.email "${USER:-tdx-builder}"@"$HOSTNAME"
for i in ../patches/*; do
git am "$i"
done
git submodule update --init
rm -rf .git/
popd
tar czf "${RPMBUILD_DIR}"/SOURCES/${DOWNSTREAM_TARBALL} qemu
tar --exclude=.git -czf "${RPMBUILD_DIR}"/SOURCES/${DOWNSTREAM_TARBALL} qemu
fi
}

Expand Down
4 changes: 2 additions & 2 deletions build/centos-stream-8/intel-mvp-tdx-qemu-kvm/tdx-qemu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Obsoletes: qemu-kvm-block-iscsi <= %{epoch}:%{version} \
Summary: QEMU is a machine emulator and virtualizer
Name: intel-mvp-tdx-qemu-kvm
Version: 6.2.0
%define downstream_version v2.5
%define patch_number mvp16
%define downstream_version v3.1
%define patch_number mvp18
Release: %{downstream_version}.%{patch_number}%{?dist}

Provides: qemu-kvm
Expand Down
Binary file not shown.
20 changes: 12 additions & 8 deletions build/rhel-8/intel-mvp-tdx-qemu-kvm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@ set -ex

CURR_DIR="$(dirname "$(readlink -f "$0")")"

DOWNSTREAM_GIT_URI="https://github.com/intel/qemu-dcp.git"
DOWNSTREAM_TAG="c8302707f6e89c955eae0883bfd97680202b8db2"
UPSTREAM_GIT_URI="https://github.com/qemu/qemu.git"
UPSTREAM_TAG="4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0"
DOWNSTREAM_TARBALL="tdx-qemu.tar.gz"

PATCHSET="${CURR_DIR}/../../common/patches-tdx-qemu-MVP-QEMU-6.2-v3.1.tar.gz"
SPEC_FILE="${CURR_DIR}/tdx-qemu.spec"
RPMBUILD_DIR="${CURR_DIR}/rpmbuild"

create_tarball() {
cd "${CURR_DIR}"
if [[ ! -d qemu ]]; then
git clone ${DOWNSTREAM_GIT_URI} qemu
fi
if [[ ! -f "${RPMBUILD_DIR}"/SOURCES/${DOWNSTREAM_TARBALL} ]]; then
git clone ${UPSTREAM_GIT_URI} qemu
tar xf "${PATCHSET}"
pushd qemu
git checkout ${DOWNSTREAM_TAG}
git checkout ${UPSTREAM_TAG}
git config user.name "${USER:-tdx-builder}"
git config user.email "${USER:-tdx-builder}"@"$HOSTNAME"
for i in ../patches/*; do
git am "$i"
done
git submodule update --init
rm -rf .git/
popd
tar czf "${RPMBUILD_DIR}"/SOURCES/${DOWNSTREAM_TARBALL} qemu
tar --exclude=.git -czf "${RPMBUILD_DIR}"/SOURCES/${DOWNSTREAM_TARBALL} qemu
fi
}

Expand Down
4 changes: 2 additions & 2 deletions build/rhel-8/intel-mvp-tdx-qemu-kvm/tdx-qemu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Obsoletes: qemu-kvm-block-iscsi <= %{epoch}:%{version} \
Summary: QEMU is a machine emulator and virtualizer
Name: intel-mvp-tdx-qemu-kvm
Version: 6.2.0
%define downstream_version v2.5
%define patch_number mvp16
%define downstream_version v3.1
%define patch_number mvp18
Release: %{downstream_version}.%{patch_number}%{?dist}

Provides: qemu-kvm
Expand Down
18 changes: 11 additions & 7 deletions build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

CURR_DIR=$(dirname "$(readlink -f "$0")")
UPSTREAM_VERSION="6.2.0"
DOWNSTREAM_GIT_URI="https://github.com/intel/qemu-dcp.git"
DOWNSTREAM_TAG="c8302707f6e89c955eae0883bfd97680202b8db2"
UPSTREAM_GIT_URI="https://github.com/qemu/qemu.git"
UPSTREAM_TAG="4c127fdbe81d66e7cafed90908d0fd1f6f2a6cd0"
PACKAGE="mvp-tdx-qemu"
PATCHSET="${CURR_DIR}/../../common/patches-tdx-qemu-MVP-QEMU-6.2-v3.1.tar.gz"

if [[ $(grep "Ubuntu" /etc/os-release) == "" ]]; then
echo "Please build the packages in Ubuntu"
Expand All @@ -17,12 +18,15 @@ get_source() {
echo "Get downstream source code..."
cd ${CURR_DIR}
if [[ ! -d ${PACKAGE}-${UPSTREAM_VERSION} ]]; then
# add safe directory for running in docker
git config --global --add safe.directory /github/workspace
git config --global --add safe.directory /repo
git clone ${DOWNSTREAM_GIT_URI} ${PACKAGE}-${UPSTREAM_VERSION}
git clone ${UPSTREAM_GIT_URI} ${PACKAGE}-${UPSTREAM_VERSION}
tar xf "${PATCHSET}"
cd ${PACKAGE}-${UPSTREAM_VERSION}
git checkout ${DOWNSTREAM_TAG}
git checkout ${UPSTREAM_TAG}
git config user.name "${USER:-tdx-builder}"
git config user.email "${USER:-tdx-builder}"@"$HOSTNAME"
for i in ../patches/*; do
git am "$i"
done
git submodule update --init
fi
}
Expand Down
6 changes: 6 additions & 0 deletions build/ubuntu-22.04/intel-mvp-tdx-qemu-kvm/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
qemu (9:6.2+mvp4+31) jammy; urgency=medium

* package for qemu upstream base + downstream patches

-- Jialei Feng <jialei.feng@intel.com> Wed, 12 Oct 2022 14:04:00 +0800

qemu (9:6.2+mvp2+25) jammy; urgency=medium

* package https://github.com/intel/qemu-dcp
Expand Down

0 comments on commit 3d7809d

Please sign in to comment.