Skip to content

Commit 055cb4e

Browse files
committed
Fix build issues with using nerves-env
1 parent 4b848d4 commit 055cb4e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

nerves-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ "$0" != "bash" -a "$0" != "-bash" -a "$0" != "/bin/bash" ]; then
1818
fi
1919

2020
NERVES_ROOT=$(dirname $(readlink -f $BASH_SOURCE))
21-
NERVES_DEFCONFIG=`grep BR2_DEFCONFIG= buildroot/.config | sed -e 's/.*"\(.*\)"/\1/'`
21+
NERVES_DEFCONFIG=`grep BR2_DEFCONFIG= $NERVES_ROOT/buildroot/.config | sed -e 's/.*"\(.*\)"/\1/'`
2222

2323
source $NERVES_ROOT/scripts/nerves-env-helper.sh $NERVES_ROOT
2424

scripts/create-fs.sh

+10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ tar -C $TMPDIR -xf $BASE_FS_CONTENTS
3636
if [ -d "$RELEASE_DIR" ]; then
3737
mkdir -p $TMPDIR/srv/erlang
3838
rm -fr $TMPDIR/srv/erlang/*
39+
40+
if [ ! -d "$RELEASE_DIR/lib" -o ! -d "$RELEASE_DIR/releases" ]; then
41+
echo "$SCRIPT_NAME: ERROR: Expecting '$RELEASE_DIR' to contain 'lib' and 'releases' subdirectories"
42+
exit 1
43+
fi
44+
3945
cp -r $RELEASE_DIR/* $TMPDIR/srv/erlang
4046

4147
# Clean up the Erlang release of all the files that we don't need.
@@ -51,6 +57,10 @@ if [ -d "$RELEASE_DIR" ]; then
5157
find $TMPDIR/usr/lib/erlang -type d -empty -delete
5258
find $TMPDIR/srv/erlang -type d -empty -delete
5359

60+
# Delete any temp files, release tarballs, etc from the base release directory
61+
# Nothing is supposed to be there.
62+
find $TMPDIR/srv/erlang -maxdepth 1 -type f -delete
63+
5464
# Strip debug information from executables and libraries
5565
# Symbols are still available to the user in the release directory.
5666
find $TMPDIR/srv/erlang -type f -perm /111 -exec $CROSSCOMPILE-strip "{}" ";"

0 commit comments

Comments
 (0)