initrd/build-init

28 lines
448 B
Plaintext
Raw Normal View History

2024-05-14 22:59:57 +00:00
set -ex
which podman &>/dev/null && docker=podman || docker=docker
mkdir -p empty
$docker build -t nv-rs-build --network=host -f Dockerfile.build empty
case $1 in
release)
opts=--release
bindir=target/release
;;
"")
bindir=target/debug
;;
*)
echo >&2 "invalid arg: $1"
exit 1
;;
esac
$docker run --rm -i --net=host --user=$UID \
nv-rs-build \
cargo build $opts
mkdir -p dist
cp $bindir/init dist/