1 | .. comment SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. comment: Copyright (c) 2016 Chris Johns <chrisj@rtems.org> |
---|
4 | .. comment: All rights reserved. |
---|
5 | |
---|
6 | .. _prefixes: |
---|
7 | |
---|
8 | Prefixes |
---|
9 | ======== |
---|
10 | |
---|
11 | You will see the term :ref:term:`prefix` referred to thoughout this |
---|
12 | documentation and in a wide number of software packages you can download from |
---|
13 | the internet. A **prefix** is the path on your computer a software package is |
---|
14 | built and installed under. Packages that have a **prefix** will place all parts |
---|
15 | under the **prefix** path. On a host computer like Linux the packages you |
---|
16 | install from your distribution typically use a platform specific standard |
---|
17 | **prefix**. For example on Linux it is :file:`/usr` and on FreeBSD it is |
---|
18 | :file:`/usr/local`. |
---|
19 | |
---|
20 | We recommend you *DO NOT* use the standard **prefix** when installing the RTEMS |
---|
21 | Tools. The standard **prefix** is the default **prefix** each package built by |
---|
22 | the RSB contains. If you are building the tools when logged in as a *Standard |
---|
23 | User* and not as the *Super User* (``root``) or *Administrator* the RTEMS |
---|
24 | Source Builder (RSB) *will* fail and report an error if the default **prefix** |
---|
25 | is not writable. We recommend you leave the standand **prefix** for the |
---|
26 | packages your operating system installs or software you manually install such |
---|
27 | as applications. |
---|
28 | |
---|
29 | A further reason not to use the standard **prefix** is to allow more than one |
---|
30 | version of RTEMS to exist on your host machine at a time. The ``autoconf`` and |
---|
31 | ``automake`` tools required by RTEMS are not versioned and vary between the |
---|
32 | various versions of RTEMS. If you use a single **prefix** such as the standard |
---|
33 | **prefix** there is a chance parts from a package of different versions may |
---|
34 | interact. This should not happen but it can. |
---|
35 | |
---|
36 | For POSIX or Unix hosts, the RTEMS Project uses :file:`/opt/rtems` as it's |
---|
37 | standard **prefix**. We view this **prefix** as a production level path, and we |
---|
38 | prefer to place development versions under a different **prefix** away from the |
---|
39 | production versions. Under this top level **prefix** we place the various |
---|
40 | versions we need for development. For example the version 4.11.0 **prefix** |
---|
41 | would be :file:`/opt/rtems/4.11.0`. If an update called 4.11.1 is released the |
---|
42 | **prefix** would be :file:`/opt/rtems/4.11.1`. These are recommendations and |
---|
43 | the choice of what you use is entirely yours. You may decide to have a single |
---|
44 | path for all RTEMS 4.11 releases of :file:`/opt/rtems/4.11`. |
---|
45 | |
---|
46 | For Windows a typical **prefix** is :file:`C:\\opt\\rtems` and as an MSYS2 path |
---|
47 | this is :file:`/c/opt/rtems`. |
---|
48 | |
---|
49 | .. _project_sandboxing: |
---|
50 | |
---|
51 | Project Sandboxing |
---|
52 | ================== |
---|
53 | |
---|
54 | Project specific sandboxes let you have a number of projects running in |
---|
55 | parallel with each project in its own sandbox. You simply have a |
---|
56 | :ref:term:`prefix` per project and under that prefix you create a simple yet |
---|
57 | repeatable structure. |
---|
58 | |
---|
59 | As an example lets say I have a large disk mounted under :file:`/bd` for *Big |
---|
60 | Disk*. As ``root`` create a directory called ``projects`` and give the |
---|
61 | directory suitable permissions to be writable by you as a user. |
---|
62 | |
---|
63 | Lets create a project sandbox for my *Box Sorter* project. First create a |
---|
64 | project directory called :file:`/bd/projects/box-sorter`. Under this create |
---|
65 | :file:`rtems` and under that create :file:`rtems-4.11.0`. Under this path you |
---|
66 | can follow the :ref:`released-version` procedure to build a tool set using the |
---|
67 | prefix of :file:`/bd/projects/box-sorter/rtems/4.11.0`. You are free to create |
---|
68 | your project specific directories under :file:`/bd/projects/box-sorter`. The |
---|
69 | top level directories would be: |
---|
70 | |
---|
71 | :file:`/bd/projects` |
---|
72 | Project specific development trees. |
---|
73 | |
---|
74 | :file:`/bd/projects/box-sorter` |
---|
75 | Box Sorter project sandbox. |
---|
76 | |
---|
77 | :file:`/bd/projects/box-sorter/rtems/4.11.0` |
---|
78 | Project prefix for RTEMS 4.11.0 compiler, debuggers, tools and installed |
---|
79 | Board Support Package (BSP). |
---|
80 | |
---|
81 | A variation is to use the ``--without-rtems`` option with the RSB to not build |
---|
82 | the BSPs when building the tools and to build RTEMS specifically for each |
---|
83 | project. This lets you have a production tools installed at a top level on your |
---|
84 | disk and each project can have a specific and possibly customised version of |
---|
85 | RTEMS. The top level directories would be: |
---|
86 | |
---|
87 | :file:`/bd/rtems` |
---|
88 | The top path to production tools. |
---|
89 | |
---|
90 | :file:`/bd/rtems/4.11.0` |
---|
91 | Production prefix for RTEMS 4.11.0 compiler, debuggers and tools. |
---|
92 | |
---|
93 | :file:`/bd/projects` |
---|
94 | Project specific development trees. |
---|
95 | |
---|
96 | :file:`/bd/projects/box-sorter` |
---|
97 | Box Sorter project sandbox. |
---|
98 | |
---|
99 | :file:`/bd/projects/box-sorter/rtems` |
---|
100 | Box Sorter project's custom RTEMS kernel source and installed BSP. |
---|
101 | |
---|
102 | A further varation if there is an RTEMS kernel you want to share between |
---|
103 | projects is it to move this to a top level and share. In this case you will end |
---|
104 | up with: |
---|
105 | |
---|
106 | :file:`/bd/rtems` |
---|
107 | The top path to production tools and kernels. |
---|
108 | |
---|
109 | :file:`/bd/rtems/4.11.0` |
---|
110 | Production prefix for RTEMS 4.11.0. |
---|
111 | |
---|
112 | :file:`/bd/rtems/4.11.0/tools` |
---|
113 | Production prefix for RTEMS 4.11.0 compiler, debuggers and tools. |
---|
114 | |
---|
115 | :file:`/bd/rtems/4.11.0/bsps` |
---|
116 | Production prefix for RTEMS 4.11.0 Board Support Packages (BSPs). |
---|
117 | |
---|
118 | :file:`/bd/projects` |
---|
119 | Project specific development trees. |
---|
120 | |
---|
121 | :file:`/bd/projects/box-sorter` |
---|
122 | Box Sorter project sandbox. |
---|
123 | |
---|
124 | Finally you can have a single set of *production* tools and RTEMS BSPs on the |
---|
125 | disk under :file:`/bd/rtems` you can share between your projects. The top level |
---|
126 | directories would be: |
---|
127 | |
---|
128 | :file:`/bd/rtems` |
---|
129 | The top path to production tools and kernels. |
---|
130 | |
---|
131 | :file:`/bd/rtems/4.11.0` |
---|
132 | Production prefix for RTEMS 4.11.0 compiler, debuggers, tools and Board |
---|
133 | Support Packages (BSPs). |
---|
134 | |
---|
135 | :file:`/bd/projects` |
---|
136 | Project specific development trees. |
---|
137 | |
---|
138 | :file:`/bd/projects/box-sorter` |
---|
139 | Box Sorter project sandbox. |
---|
140 | |
---|
141 | The project sandoxing approach allows you move a specific production part into |
---|
142 | the project's sandbox to allow you to customise it. This is useful if you are |
---|
143 | testing new releases. The typical dependency is the order listed above. You can |
---|
144 | test new RTEMS kernels with production tools but new tools will require you |
---|
145 | build the kernel with them. Release notes with each release will let know |
---|
146 | what you need to update. |
---|
147 | |
---|
148 | If the machine is a central project development machine simply replace |
---|
149 | :file:`projects` with :file:`users` and give each user a personal directory. |
---|