From 5d49ccd613c2090711a22aa7214f4b6708642ae8 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Thu, 16 Dec 2021 17:58:20 -0300 Subject: [PATCH 1/2] packaging/qemu: Use partial git clone The static build of QEMU takes a good amount of time on cloning the source tree because we do a full git clone. In order to speed up that operation this changed the Dockerfile so that it is carried out a partial clone by using --depth=1 argument. Fixes #3291 Signed-off-by: Wainer dos Santos Moschetta --- tools/packaging/static-build/qemu/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/packaging/static-build/qemu/Dockerfile b/tools/packaging/static-build/qemu/Dockerfile index cb15ddeace..a4602ec1c5 100644 --- a/tools/packaging/static-build/qemu/Dockerfile +++ b/tools/packaging/static-build/qemu/Dockerfile @@ -52,12 +52,12 @@ RUN [ "$(uname -m)" != "s390x" ] && apt-get install -y libpmem-dev || true ARG QEMU_REPO -RUN cd .. && git clone "${QEMU_REPO}" qemu +RUN cd .. && git clone --depth=1 "${QEMU_REPO}" qemu # commit/tag/branch ARG QEMU_VERSION -RUN git checkout "${QEMU_VERSION}" +RUN git fetch --depth=1 origin "${QEMU_VERSION}" && git checkout FETCH_HEAD RUN git clone https://github.com/qemu/capstone.git capstone RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb RUN git clone https://github.com/qemu/meson.git meson From 2938bb7f892483f0674e16baa00a5a3702d8dbe0 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Thu, 16 Dec 2021 18:06:06 -0300 Subject: [PATCH 2/2] packaging/qemu: Use QEMU script to update submodules Currently QEMU's submodules are git cloned but there is the scripts/git-submodule.sh which is meant for that. Let's use that script. Signed-off-by: Wainer dos Santos Moschetta --- tools/packaging/static-build/qemu/Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/packaging/static-build/qemu/Dockerfile b/tools/packaging/static-build/qemu/Dockerfile index a4602ec1c5..33e7e2fc62 100644 --- a/tools/packaging/static-build/qemu/Dockerfile +++ b/tools/packaging/static-build/qemu/Dockerfile @@ -58,11 +58,7 @@ RUN cd .. && git clone --depth=1 "${QEMU_REPO}" qemu ARG QEMU_VERSION RUN git fetch --depth=1 origin "${QEMU_VERSION}" && git checkout FETCH_HEAD -RUN git clone https://github.com/qemu/capstone.git capstone -RUN git clone https://github.com/qemu/keycodemapdb.git ui/keycodemapdb -RUN git clone https://github.com/qemu/meson.git meson -RUN git clone https://github.com/qemu/berkeley-softfloat-3.git tests/fp/berkeley-softfloat-3 -RUN git clone https://github.com/qemu/berkeley-testfloat-3.git tests/fp/berkeley-testfloat-3 +RUN scripts/git-submodule.sh update meson capstone ADD scripts/configure-hypervisor.sh /root/configure-hypervisor.sh ADD qemu /root/kata_qemu