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