See script(4) for a detailed description of the syntax
and contents of the boot script.

Default Boot Scripts

Erlang/OTP comes with two boot scripts:

start_clean.boot

Loads the code for and starts the applications Kernel and
STDLIB.

start_sasl.boot

Loads the code for and starts the applications Kernel,
STDLIB and SASL.

no_dot_erlang.boot

Loads the code for and starts the applications Kernel and
STDLIB, skips loading the .erlang file.
Useful for scripts and other tools that should be behave the
same irregardless of user preferences.

Which of start_clean and start_sasl to use as
default is decided by the user when installing Erlang/OTP using
Install. The user is asked "Do you want to use a minimal
system startup instead of the SASL startup". If the answer is
yes, then start_clean is used, otherwise
start_sasl is used. A copy of the selected boot script
is made, named start.boot and placed in
the ROOT/bin directory.

User-Defined Boot Scripts

It is sometimes useful or necessary to create a user-defined
boot script. This is true especially when running Erlang in
embedded mode, see Code Loading Strategy.

It is possible to write a boot script manually.
The recommended way to create a boot script, however, is to
generate the boot script from a release resource file
Name.rel, using the function
systools:make_script/1,2. This requires that the source
code is structured as applications according to the OTP design
principles. (The program does not have to be started in terms of
OTP applications but can be plain Erlang).

Read more about .rel files in OTP Design Principles and
rel(4).

The binary boot script file Name.boot is generated from
the boot script file Name.script using the function
systools:script2boot(File).

The runtime system can be started in either embedded or
interactive mode. Which one is decided by the command
line flag -mode.

% erl -mode embedded

Default mode is interactive.

In embedded mode, all code is loaded during system start-up
according to the boot script. (Code can also be loaded later
by explicitly ordering the code server to do so).

In interactive mode, code is dynamically loaded when first
referenced. When a call to a function in a module is made, and
the module is not loaded, the code server searches the code path
and loads the module into the system.

Initially, the code path consists of the current
working directory and all object code directories under
ROOT/lib, where ROOT is the installation directory
of Erlang/OTP. Directories can be named Name[-Vsn] and
the code server, by default, chooses the directory with
the highest version number among those which have the same
Name. The -Vsn suffix is optional. If an
ebin directory exists under the Name[-Vsn]
directory, it is this directory which is added to the code path.

The code path can be extended by using the command line flags
-pa Directories and -pz Directories. These will add
Directories to the head or end of the code path,
respectively. Example

% erl -pa /home/arne/mycode

The code server module code contains a number of
functions for modifying and checking the search path, see
code(3).