[erlang-questions] use only parts of a release

Per Melin per.melin@REDACTED
Sun Apr 24 14:39:52 CEST 2011


On Sat, Apr 23, 2011 at 9:27 PM, Ulf Wiger
<ulf.wiger@REDACTED> wrote:
> I will admit that I haven't been following this thread - apologies. Also, I
> have yet to update my old knowledge of how to do this to understand how it's
> done using reltool et al.
> You can use a releases/ directory outside the OTP root.

Thanks. I was confused about the role of the -root flag.

It is used in three places that I can find:
- init uses it to locate stuff and to replace the default variable
$ROOT in the boot script.
- code_server uses it (in interactive mode only) as one of the
starting points to search for modules.
- release_handler uses it as the top directory of the installed release.

> When you build the boot script, use the {variables, Vars} option, and when
> starting, define the variables using the -boot_var command-line option.
> http://www.erlang.org/doc/man/systools.html#make_script-2
> E.g. {variables, [{"MYROOT", PathToMyRoot}, {"OTP_ROOT", ERL_TOP}]}
> init:get_argument(root) should point to the place where you have your .rel
> and .boot files etc. This can be entirely separate from where you keep your
> lib/ roots.

Pablo is using rebar. He would need to drop down a few levels to use
systools instead.

I can't find any support for boot variables in the doc for reltool. It
does look to me like reltool_target:gen_script/4 do support them, but
that is an internal function and is always called with a hardcoded
empty list of variables.

I guess one could let rebar generate the release and then use
systools:make_script/2 to rebuild the boot script with variables.



More information about the erlang-questions mailing list