Erlang environment question...

Ulf Wiger Ulf.Wiger-cut-to-reply@REDACTED
Thu Jul 1 14:07:25 CEST 1999

The following message is a courtesy copy of an article
that has been posted to comp.lang.functional as well.

>>>>> "Edwin" == Edwin Young <edwin@REDACTED> writes:

  Edwin> Since there doesn't seem to
  Edwin> be an easy way of separating out just the required parts of
  Edwin> the package, Erlang isn't as suitable for applets or small
  Edwin> utility programs. 

It's quite possible to write a utility that figures out which
parts of the Erlang environment to include in a tarball. In fact,
there is such a function in the systools.erl module. I'll admit 
that the Release Handler architecture in Erlang was designed 
with large embedded systems in mind, so getting acquainted with
it is somewhat of a chore. You'll find quite a few examples in
the SASL (Software Architecture Support Libraries) User's Guide.

The general idea is that you specify a text file, <RelName>.rel,
which defines your release; then you call systools:make_script()
to generate a start script, from which you can start your 
system. Once you've verified that it works, you can call
systools:make_tar(ReleaseName, Options) to package the VM and 
those applications you need into a tarball.

At AXD301, we have a support system which takes care of this
automatically when a user types 'install -conf <Configuration>'
in a shell. It's not completely generic, and we haven't been
able to separate it from the proprietary AXD 301 code in order 
to post it to

If anyone is interested in building a wrapper around the 
systools functions, I'd be happy to assist with pointers
(we've been using our own for over a year now.)


(snipped from the systools man page):

     make_tar(ReleaseName) -> TarRet
     make_tar(ReleaseName,Opts) -> TarRet
               ReleaseName = string()
               Opts = [{path, Path} | silent  |  {dirs,  Dirs}  |
               {erts,  ErtsDir}  |  no_module_tests | {variables,
               Vars} | {var_tar, VarTar} | {machine,  Machine}  |
               exref | {exref, [AppName]}]
               Path = [Dir]
               Dir = string()
               Dirs = [atom()]
               ErtsDir = string()
               Vars = [Var]
               Var = {VarName, PreFixDir}
               VarName = atom() | string()
               PreFixDir = string()
               VarTar = include | ownfile | omit
               Machine = atom()
               AppName = atom()
               TarRet = ok | error |  {ok,  Module,  Warnings}  |
               {error, Module, Error}
               Warnings = void()
               Module = atom()
               Error = void()
Ericsson Utvecklings ALast change: sasl  1.7                    6
systools(3)         ERLANG MODULE DEFINITION          systools(3)
          A  release  package  file   is   generated   from   the
          ReleaseName.rel  file.  The  ReleaseName.tar.gz file is
          generated. This  file  can  then  be  uncompressed  and
          unpacked  on  the  target system before the new release
          can be activated, using the release_handler.
          By default, the generated release  package  contains  a
          directory  under  the  lib  directory for each included
          application  .  Each  application  directory  is  named
          ApplicationName-ApplicationVsn.  For  each application,
          the ebin  and  priv  directories  are  included.  These
          directories are copied from where the applications were
          found. If more directories are needed, it  is  possible
          to  specify  these  with  the  {dirs, Dirs} option. For
          example, if the src and example directories  should  be
          included  for  each application in the release package,
          the {dirs, [src, examples]} option should be supplied.

[USW... lots of different options]

Ulf Wiger, Chief Designer AXD 301
Ericsson Telecom AB                          tfn: +46  8 719 81 95
Varuvägen 9, Älvsjö                          mob: +46 70 519 81 95
S-126 25 Stockholm, Sweden                   fax: +46  8 719 43 44

More information about the erlang-questions mailing list