Own the patched runsc artifact and bind recovery identity

This commit is contained in:
ms2k 2026-07-26 18:01:03 +09:00
commit 2c420012bd

View file

@ -18,7 +18,7 @@ elif [ "$#" -ne 0 ]; then
exit 2
fi
for command in cargo install readelf; do
for command in cargo cmp install readelf; do
command -v "$command" >/dev/null 2>&1 || {
printf '%s\n' "install-to-host: $command is required" >&2
exit 1
@ -27,6 +27,7 @@ done
cd "$root"
tools/materialize-fuser
tools/materialize-runsc --build
cargo build \
--release \
--locked \
@ -58,4 +59,17 @@ if readelf -l "$sandbox_init" | grep -q 'Requesting program interpreter' ||
fi
install -m 755 "$sandbox_init" "$install_dir/lazaret-sandbox-init"
runsc_build_id=904ab3c9bd4c99a27181076f2c9ea2fecc041db5a728c999540d6664174d2cd4
runsc_name="lazaret-runsc-$runsc_build_id"
runsc_source="$root/.lazaret/bin/$runsc_name"
runsc_destination="$install_dir/$runsc_name"
if [[ -e "$runsc_destination" ]]; then
cmp --silent "$runsc_source" "$runsc_destination" || {
printf '%s\n' "install-to-host: immutable runsc destination differs: $runsc_destination" >&2
exit 1
}
else
install -m 755 "$runsc_source" "$runsc_destination"
fi
printf '%s\n' "Installed Lazaret in $install_dir"