Skip to content

Commit

Permalink
POSIX sh for this script
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd authored and TheAssassin committed Jul 31, 2024
1 parent 2041ab4 commit 6c2e1bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chroot/chroot_build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/sh

set -ex

Expand All @@ -14,11 +14,13 @@ fi
tempdir="$(mktemp -d)"

# need to memorize the repository root directory's path so that we can copy files from it
repo_root_dir="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"/..
repo_root_dir=$(dirname "$(readlink -f "$0")")/../

# cleanup takes care of unmounting and removing all downloaded files
cleanup() {
sudo umount "$tempdir"/miniroot/{dev,proc,sys}
for i in dev proc sys; do
sudo umount "$tempdir"/miniroot/"$i"
done
sudo rm -rf "$tempdir"
}
trap cleanup EXIT
Expand Down

0 comments on commit 6c2e1bf

Please sign in to comment.