aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcl_prv_assembler.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2013-03-11 19:14:03 -0500
committerTristan Sloughter <[email protected]>2013-03-13 13:43:00 -0500
commit279ab4bf7ae5baa51638710a8967d86b3d4cf5ae (patch)
tree465f540308bb8d82513a70e873ee8ce346278dc4 /src/rcl_prv_assembler.erl
parent6734e9ec4e0dd4c0678d10e8b8e48552ffb4e995 (diff)
downloadrelx-279ab4bf7ae5baa51638710a8967d86b3d4cf5ae.tar.gz
relx-279ab4bf7ae5baa51638710a8967d86b3d4cf5ae.tar.bz2
relx-279ab4bf7ae5baa51638710a8967d86b3d4cf5ae.zip
replace erl sript in copied erts with generated version
Diffstat (limited to 'src/rcl_prv_assembler.erl')
-rw-r--r--src/rcl_prv_assembler.erl25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/rcl_prv_assembler.erl b/src/rcl_prv_assembler.erl
index 63bd167..e85b293 100644
--- a/src/rcl_prv_assembler.erl
+++ b/src/rcl_prv_assembler.erl
@@ -285,6 +285,7 @@ include_erts(State, Release, OutputDir, RelDir) ->
true ->
ok = ec_file:mkdir_p(LocalErts),
ok = ec_file:copy(ErtsDir, LocalErts, [recursive]),
+ ok = file:write_file(filename:join([LocalErts, "bin", "erl"]), erl_script(ErtsVersion)),
make_boot_script(State, Release, OutputDir, RelDir)
end;
_ ->
@@ -345,6 +346,22 @@ get_code_paths(Release, OutDir) ->
rcl_app_info:vsn_as_string(App), "ebin"]) ||
App <- rcl_release:application_details(Release)].
+erl_script(ErtsVsn) ->
+ [<<"#!/bin/sh
+set -e
+
+SCRIPT_DIR=`dirname $0`
+ROOTDIR=`cd $SCRIPT_DIR/../../ && pwd`
+BINDIR=$ROOTDIR/erts-">>, ErtsVsn, <<"/bin
+EMU=beam
+PROGNAME=`echo $0 | sed 's/.*\\///'`
+export EMU
+export ROOTDIR
+export BINDIR
+export PROGNAME
+exec \"$BINDIR/erlexec\" ${1+\"$@\"}
+">>].
+
bin_file_contents(RelName, RelVsn, ErtsVsn, ErlOpts) ->
[<<"#!/bin/sh
@@ -358,14 +375,6 @@ ERTS_VSN=">>, ErtsVsn, <<"
REL_DIR=$RELEASE_ROOT_DIR/releases/$REL_NAME-$REL_VSN
ERL_OPTS=">>, ErlOpts, <<"
-ERTS_DIR=
-SYS_CONFIG=
-ROOTDIR=
-
-ERTS_DIR=
-SYS_CONFIG=
-ROOTDIR=
-
find_erts_dir() {
local erts_dir=$RELEASE_ROOT_DIR/erts-$ERTS_VSN
if [ -d \"$erts_dir\" ]; then