diff options
Diffstat (limited to 'system/doc')
-rw-r--r-- | system/doc/system_principles/create_target.xmlsrc (renamed from system/doc/system_principles/create_target.xml) | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/system/doc/system_principles/create_target.xml b/system/doc/system_principles/create_target.xmlsrc index 7d9f4681b9..1564423e00 100644 --- a/system/doc/system_principles/create_target.xml +++ b/system/doc/system_principles/create_target.xmlsrc @@ -4,7 +4,7 @@ <chapter> <header> <copyright> - <year>2002</year><year>2009</year> + <year>2002</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + </legalnotice> <title>Creating a First Target System</title> @@ -47,7 +47,7 @@ and a set of new applications that are included in the new system. Documentation and source code is irrelevant and is therefore not included in the new system.</p> - <p>This chapter is about creating such a system, which we call a + <p>This chapter is about creating such a system, which we call a <em>target system</em>.</p> <p>In the following sections we consider creating target systems with different requirements of functionality:</p> @@ -95,7 +95,7 @@ file reside, start the Erlang/OTP system:</p> <pre> os> <input>erl -pa /home/user/target_system/myapps/pea-1.0/ebin</input></pre> - <p>where also the path to the <c>pea-1.0</c> ebin directory is + <p>where also the path to the <c>pea-1.0</c> ebin directory is provided. </p> <p><em>Step 3.</em> Now create the target system: </p> <pre> @@ -137,7 +137,7 @@ lib/pea-1.0/ </code> <item>Copies the files <c>epmd</c>, <c>run_erl</c>, and <c>to_erl</c> from the directory <c>tmp/erts-5.1/bin</c> to the directory <c>tmp/bin</c>.</item> - <item>Creates the file <c>tmp/releases/start_erl.data</c> with the + <item>Creates the file <c>tmp/releases/start_erl.data</c> with the contents "5.1 FIRST". </item> <item>Recreates the file <c>mysystem.tar.gz</c> from the directories @@ -147,7 +147,7 @@ lib/pea-1.0/ </code> <section> <title>Installing a Target System</title> - <p><em>Step 4.</em> Install the created target system in a + <p><em>Step 4.</em> Install the created target system in a suitable directory. </p> <pre> 2> <input>target_system:install("mysystem", "/usr/local/erl-target").</input></pre> @@ -187,7 +187,7 @@ os> <input>/usr/local/erl-target/bin/erl</input></pre> <pre> os> <input>/usr/local/erl-target/bin/erl -boot /usr/local/erl-target/releases/FIRST/start</input></pre> <p>We start a <em>simple target system</em> as above. The only difference - is that also the file <c>releases/RELEASES</c> is present for + is that also the file <c>releases/RELEASES</c> is present for code replacement in run-time to work.</p> <p>To start an <em>embedded target system</em> the shell script <c>bin/start</c> is used. That shell script calls @@ -258,19 +258,19 @@ os> <input>/usr/local/erl-target/bin/erl -boot /usr/local/erl-target/releases/FI %% create(RelFileName) %% create(RelFileName) -> - RelFile = RelFileName ++ ".rel", + RelFile = RelFileName ++ ".rel", io:fwrite("Reading file: \"~s\" ...~n", [RelFile]), {ok, [RelSpec]} = file:consult(RelFile), - io:fwrite("Creating file: \"~s\" from \"~s\" ...~n", + io:fwrite("Creating file: \"~s\" from \"~s\" ...~n", ["plain.rel", RelFile]), {release, {RelName, RelVsn}, {erts, ErtsVsn}, AppVsns} = RelSpec, - PlainRelSpec = {release, + PlainRelSpec = {release, {RelName, RelVsn}, {erts, ErtsVsn}, - lists:filter(fun({kernel, _}) -> + lists:filter(fun({kernel, _}) -> true; ({stdlib, _}) -> true; @@ -285,7 +285,7 @@ create(RelFileName) -> io:fwrite("Making \"plain.script\" and \"plain.boot\" files ...~n"), make_script("plain"), - io:fwrite("Making \"~s.script\" and \"~s.boot\" files ...~n", + io:fwrite("Making \"~s.script\" and \"~s.boot\" files ...~n", [RelFileName, RelFileName]), make_script(RelFileName), @@ -294,14 +294,14 @@ create(RelFileName) -> make_tar(RelFileName), io:fwrite("Creating directory \"tmp\" ...~n"), - file:make_dir("tmp"), + file:make_dir("tmp"), io:fwrite("Extracting \"~s\" into directory \"tmp\" ...~n", [TarFileName]), extract_tar(TarFileName, "tmp"), TmpBinDir = filename:join(["tmp", "bin"]), ErtsBinDir = filename:join(["tmp", "erts-" ++ ErtsVsn, "bin"]), - io:fwrite("Deleting \"erl\" and \"start\" in directory \"~s\" ...~n", + io:fwrite("Deleting \"erl\" and \"start\" in directory \"~s\" ...~n", [ErtsBinDir]), file:delete(filename:join([ErtsBinDir, "erl"])), file:delete(filename:join([ErtsBinDir, "start"])), @@ -309,25 +309,25 @@ create(RelFileName) -> io:fwrite("Creating temporary directory \"~s\" ...~n", [TmpBinDir]), file:make_dir(TmpBinDir), - io:fwrite("Copying file \"plain.boot\" to \"~s\" ...~n", + io:fwrite("Copying file \"plain.boot\" to \"~s\" ...~n", [filename:join([TmpBinDir, "start.boot"])]), copy_file("plain.boot", filename:join([TmpBinDir, "start.boot"])), io:fwrite("Copying files \"epmd\", \"run_erl\" and \"to_erl\" from \n" - "\"~s\" to \"~s\" ...~n", + "\"~s\" to \"~s\" ...~n", [ErtsBinDir, TmpBinDir]), - copy_file(filename:join([ErtsBinDir, "epmd"]), + copy_file(filename:join([ErtsBinDir, "epmd"]), filename:join([TmpBinDir, "epmd"]), [preserve]), - copy_file(filename:join([ErtsBinDir, "run_erl"]), + copy_file(filename:join([ErtsBinDir, "run_erl"]), filename:join([TmpBinDir, "run_erl"]), [preserve]), - copy_file(filename:join([ErtsBinDir, "to_erl"]), + copy_file(filename:join([ErtsBinDir, "to_erl"]), filename:join([TmpBinDir, "to_erl"]), [preserve]), StartErlDataFile = filename:join(["tmp", "releases", "start_erl.data"]), io:fwrite("Creating \"~s\" ...~n", [StartErlDataFile]), StartErlData = io_lib:fwrite("~s ~s~n", [ErtsVsn, RelVsn]), write_file(StartErlDataFile, StartErlData), - + io:fwrite("Recreating tar file \"~s\" from contents in directory " "\"tmp\" ...~n", [TarFileName]), {ok, Tar} = erl_tar:open(TarFileName, [write, compressed]), @@ -345,7 +345,7 @@ create(RelFileName) -> install(RelFileName, RootDir) -> - TarFile = RelFileName ++ ".tar.gz", + TarFile = RelFileName ++ ".tar.gz", io:fwrite("Extracting ~s ...~n", [TarFile]), extract_tar(TarFile, RootDir), StartErlDataFile = filename:join([RootDir, "releases", "start_erl.data"]), @@ -355,14 +355,14 @@ install(RelFileName, RootDir) -> BinDir = filename:join([RootDir, "bin"]), io:fwrite("Substituting in erl.src, start.src and start_erl.src to\n" "form erl, start and start_erl ...\n"), - subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir, + subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir, [{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}], [preserve]), io:fwrite("Creating the RELEASES file ...\n"), - create_RELEASES(RootDir, + create_RELEASES(RootDir, filename:join([RootDir, "releases", RelFileName])). -%% LOCALS +%% LOCALS %% make_script(RelFileName) %% @@ -384,13 +384,13 @@ extract_tar(TarFile, DestDir) -> create_RELEASES(DestDir, RelFileName) -> release_handler:create_RELEASES(DestDir, RelFileName ++ ".rel"). -subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) -> +subst_src_scripts(Scripts, SrcDir, DestDir, Vars, Opts) -> lists:foreach(fun(Script) -> - subst_src_script(Script, SrcDir, DestDir, + subst_src_script(Script, SrcDir, DestDir, Vars, Opts) end, Scripts). -subst_src_script(Script, SrcDir, DestDir, Vars, Opts) -> +subst_src_script(Script, SrcDir, DestDir, Vars, Opts) -> subst_file(filename:join([SrcDir, Script ++ ".src"]), filename:join([DestDir, Script]), Vars, Opts). @@ -465,7 +465,7 @@ do_copy_file(InFd, OutFd) -> eof -> ok end. - + write_file(FName, Conts) -> {ok, Fd} = file:open(FName, [write]), file:write(Fd, Conts), @@ -484,7 +484,7 @@ remove_all_files(Dir, Files) -> {ok, FileInfo} = file:read_file_info(FilePath), case FileInfo#file_info.type of directory -> - {ok, DirFiles} = file:list_dir(FilePath), + {ok, DirFiles} = file:list_dir(FilePath), remove_all_files(FilePath, DirFiles), file:del_dir(FilePath); _ -> @@ -494,4 +494,3 @@ remove_all_files(Dir, Files) -> ]]></code> </section> </chapter> - |