summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Winblad <kjellwinblad@gmail.com>2020-12-02 08:24:57 +0100
committerKjell Winblad <kjellwinblad@gmail.com>2020-12-11 16:03:07 +0100
commit5475a9e25849adc7ab992e22dbcc93cd1667e528 (patch)
treed5f0c2ec5d145c1928dc98d433724229a6d10528
parent28cd236d03d62faee5d3733a05e40453c768211f (diff)
downloaderlang-5475a9e25849adc7ab992e22dbcc93cd1667e528.tar.gz
Use special environment variable to change default ROOTDIR
Using the environment variable ROOTDIR to change to a custom root dir for the Erlang/OTP installation is not a good idea because this variable might sometimes be set to something incorrect. This commit changes so that the the user can change the root directory by setting the environment variable ERL_ROOTDIR instead.
-rw-r--r--erts/etc/unix/erl.src.src6
-rw-r--r--erts/etc/unix/start.src6
2 files changed, 8 insertions, 4 deletions
diff --git a/erts/etc/unix/erl.src.src b/erts/etc/unix/erl.src.src
index b7438f615b..0983132ac1 100644
--- a/erts/etc/unix/erl.src.src
+++ b/erts/etc/unix/erl.src.src
@@ -18,9 +18,11 @@
#
# %CopyrightEnd%
#
-if [ -z "$ROOTDIR" ]
+if [ -z "$ERL_ROOTDIR" ]
then
- ROOTDIR="%FINAL_ROOTDIR%"
+ ROOTDIR="%FINAL_ROOTDIR%"
+else
+ ROOTDIR="$ERL_ROOTDIR"
fi
BINDIR=$ROOTDIR/erts-%VSN%/bin
EMU=%EMULATOR%%EMULATOR_NUMBER%
diff --git a/erts/etc/unix/start.src b/erts/etc/unix/start.src
index e3d1b8676a..4cf0e899e4 100644
--- a/erts/etc/unix/start.src
+++ b/erts/etc/unix/start.src
@@ -25,9 +25,11 @@
#
# Usage: start [Data]
#
-if [ -z "$ROOTDIR" ]
+if [ -z "$ERL_ROOTDIR" ]
then
- ROOTDIR=%FINAL_ROOTDIR%
+ ROOTDIR="%FINAL_ROOTDIR%"
+else
+ ROOTDIR="$ERL_ROOTDIR"
fi
if [ -z "$RELDIR" ]