Skip to content

Commit 76b2a9c

Browse files
committed
fix: use POSIX sh and add EXIT trap in entrypoint
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 2356bab commit 76b2a9c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

host/pyhl-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#!/bin/bash
1+
#!/bin/sh
22
set -e
33

44
if [ ! -f "$PYHL_HOME/snapshot/index.json" ]; then
55
staging=$(mktemp -d)
6+
trap 'rm -rf "$staging"' EXIT
67
mkdir -p "$staging/.unikraft/build"
78
ln -s "$PYHL_HOME/kernel" "$staging/.unikraft/build/driver_hyperlight-x86_64"
89
ln -s "$PYHL_HOME/initrd.cpio" "$staging/driver-initrd.cpio"
910
pyhl setup --dest "$PYHL_HOME" --from "$staging" --net --force
10-
rm -rf "$staging"
1111
fi
1212

1313
if [ "$1" = "--setup-only" ]; then

0 commit comments

Comments
 (0)