From 2f9859ab2f7a2de276aef2d1a42fcecc04ca60d2 Mon Sep 17 00:00:00 2001 From: Carlos Venegas Date: Tue, 29 Jun 2021 15:55:14 +0000 Subject: [PATCH] build: Reuse firecracker directory on builds. kata-deploy buider now reuses the build directory, this makes faster rebuilds. Update firecracker builder to not fail if is called twice. Signed-off-by: Carlos Venegas --- .../firecracker/build-static-firecracker.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/packaging/static-build/firecracker/build-static-firecracker.sh b/tools/packaging/static-build/firecracker/build-static-firecracker.sh index 09cf4e390f..deac78773e 100755 --- a/tools/packaging/static-build/firecracker/build-static-firecracker.sh +++ b/tools/packaging/static-build/firecracker/build-static-firecracker.sh @@ -15,6 +15,7 @@ source "${script_dir}/../../scripts/lib.sh" config_dir="${script_dir}/../../scripts/" firecracker_repo="${firecracker_repo:-}" +firecracker_dir="firecracker" firecracker_version="${firecracker_version:-}" kata_version="${kata_version:-}" @@ -31,10 +32,11 @@ fi info "Build ${firecracker_repo} version: ${firecracker_version}" -git clone ${firecracker_repo} -cd firecracker +[ -d "${firecracker_dir}" ] || git clone ${firecracker_repo} +cd "${firecracker_dir}" +git fetch git checkout ${firecracker_version} -./tools/devtool --unattended build --release +sudo ./tools/devtool --unattended build --release -ln -s ./build/cargo_target/x86_64-unknown-linux-musl/release/firecracker ./firecracker-static -ln -s ./build/cargo_target/x86_64-unknown-linux-musl/release/jailer ./jailer-static +ln -sf ./build/cargo_target/x86_64-unknown-linux-musl/release/firecracker ./firecracker-static +ln -sf ./build/cargo_target/x86_64-unknown-linux-musl/release/jailer ./jailer-static