release handling

Vance Shipley vances@REDACTED
Tue Oct 10 23:27:56 CEST 2000


When we packaged our first application for embedded use
we followed the instructions and examples as closely as
possible.  We had some difficulty but luckily at that
time we had a visitor from the Erlang group here and
he helped us through it.

What suprised us was that the release_handler did not
allow us to build an initial system.  It must have a
release upgrade specification file to complete the job
and there doesn't seem to be a valid syntax for
"upgrading" from nothing.

I was also somewhat suprised that it packaged all the
modules which were dependent including kernel and stdlib.
This makes the standard release file much larger than
needed.  I may change that one day but we generally stick
to the supported path as much as possible because we
create enough of our own problems. :)

My current steps to build and install a release are (assuming
that the we have written a Beta.rel "release resource file"
and an sample.app "application resource file"):

$ make
gcc -O -DUNIX -I.  -I/usr/include/dialogic \
	-I/usr/local/lib/erlang/lib/erl_interface-3.2/include \
      -o dialogic dialogic.c -lgc -ldxxx -ldti -lsrl -lLiS \
	-L/usr/local/lib/erlang/lib/erl_interface-3.2/lib \
	-lerl_interface -lei -lresolv
erlc sample.erl
erlc sample_sup.erl
erlc t1_fsm.erl
erlc e1_fsm.erl
erlc evasrv.erl
erlc spanfsm.erl
erlc cdrevh.erl
erlc logevh.erl
erlc evmgr.erl
erlc status.erl
erlc gentabs.erl

$ make install

install -d /usr/local/lib/erlang/lib/sample-2.0/ebin
install -d /usr/local/lib/erlang/lib/sample-2.0/include
install -d /usr/local/lib/erlang/lib/sample-2.0/src/c_src
install -d /usr/local/lib/erlang/lib/sample-2.0/src/e_src
install -d /usr/local/lib/erlang/lib/sample-2.0/priv/bin
install -d /usr/local/lib/erlang/lib/sample-2.0/priv/data
install Makefile /usr/local/lib/erlang/lib/sample-2.0/src/c_src
install *.rel /usr/local/lib/erlang/releases
install *.app /usr/local/lib/erlang/lib/sample-2.0/ebin
install *.hrl /usr/local/lib/erlang/lib/sample-2.0/include
install *.erl /usr/local/lib/erlang/lib/sample-2.0/src/e_src
install *.beam /usr/local/lib/erlang/lib/sample-2.0/ebin
install *.c /usr/local/lib/erlang/lib/sample-2.0/src/c_src
install -s dialogic /usr/local/lib/erlang/lib/sample-2.0/priv/bin
install *.c /usr/local/lib/erlang/lib/sample-2.0/src/c_src
install *.defs /usr/local/lib/erlang/lib/sample-2.0/priv/data
install *tab /usr/local/lib/erlang/lib/sample-2.0/priv/data

$ cd /usr/local/lib/erlang/releases
$ erl
Erlang (BEAM) emulator version 4.9.1 [source]

Eshell V4.9.1  (abort with ^G)
1> systools:make_script("Beta").
ok
2> systools:make_tar("Beta").
ok
3> halt().
$ cp Beta.tar.gz /home/otpuser/lib/erlang/releases
$ exit

login: otpuser
Password:

$ cd lib/erlang/releases
$ erl
Erlang (BEAM) emulator version 4.9.1 [source]

Eshell V4.9.1  (abort with ^G)
1> release_handler:unpack_release("Beta").
ok
2> halt().

$ vi RELEASES
[{release,"sample",
          "example-1.0",
          "4.9.1",
          [{kernel,"2.5","/home/otpuser/lib/erlang/lib/kernel-2.5"},
           {stdlib,"1.8.1","/home/otpuser/lib/erlang/lib/stdlib-1.8.1"},
           {sasl,"1.8.2","/home/otpuser/lib/erlang/lib/sasl-1.8.2"},
           {answer,"2.0","/home/otpuser/lib/erlang/lib/sample-2.0"}],
          unpacked},
 {release,"OTP  APN 181 01",
          "R6B",
          "4.9.1",
          [{kernel,"2.5","/home/otpuser/lib/erlang/lib/kernel-2.5"},
           {stdlib,"1.8.1","/home/otpuser/lib/erlang/lib/stdlib-1.8.1"},
           {sasl,"1.8.2","/home/otpuser/lib/erlang/lib/sasl-1.8.2"}],
          old}].

*** [ here we change the status of the new release from "unpacked" to "current"]
***

$ erl
Erlang (BEAM) emulator version 4.9.1 [source]

Eshell V4.9.1  (abort with ^G)
1> release_handler:make_permanent("example-1.0").
ok
2> halt()


At this point all that is needed to get an embedded system up and
running is to run /home/otpuser/lib/erlang/bin/start.


Now if the truth be known I usually skip the release_handler:unpack_release/1
step and just untar it manually.  As far as I know that's all it really does.

One day I'll have my makefile do all of this. :)

	-Vance




More information about the erlang-questions mailing list