1 | .. SPDX-License-Identifier: CC-BY-SA-4.0 |
---|
2 | |
---|
3 | .. Copyright (C) 2016 Chris Johns <chrisj@rtems.org> |
---|
4 | |
---|
5 | .. _rtems-kernel: |
---|
6 | |
---|
7 | RTEMS Kernel |
---|
8 | ============ |
---|
9 | |
---|
10 | RTEMS is an open source real-time operating system. As a user you have access |
---|
11 | to all the source code. The ``RTEMS Kernel`` section will show you how you |
---|
12 | build the RTEMS kernel on your host. |
---|
13 | |
---|
14 | Development Sources |
---|
15 | ------------------- |
---|
16 | |
---|
17 | Create a new location to build the RTEMS kernel: |
---|
18 | |
---|
19 | .. code-block:: none |
---|
20 | |
---|
21 | $ cd |
---|
22 | $ cd development/rtems |
---|
23 | $ mkdir kernel |
---|
24 | $ cd kernel |
---|
25 | |
---|
26 | Clone the RTEMS respository: |
---|
27 | |
---|
28 | .. code-block:: none |
---|
29 | |
---|
30 | $ git clone git://git.rtems.org/rtems.git rtems |
---|
31 | Cloning into 'rtems'... |
---|
32 | remote: Counting objects: 483342, done. |
---|
33 | remote: Compressing objects: 100% (88974/88974), done. |
---|
34 | remote: Total 483342 (delta 390053), reused 475669 (delta 383809) |
---|
35 | Receiving objects: 100% (483342/483342), 69.88 MiB | 1.37 MiB/s, done. |
---|
36 | Resolving deltas: 100% (390053/390053), done. |
---|
37 | Checking connectivity... done. |
---|
38 | |
---|
39 | Tools Path Set Up |
---|
40 | ----------------- |
---|
41 | |
---|
42 | We need to set our path to include the RTEMS tools we built in the previous |
---|
43 | section. The RTEMS tools needs to be first in your path because RTEMS provides |
---|
44 | specific versions of the ``autoconf`` and ``automake`` tools. We want to use |
---|
45 | the RTEMS version and not your host's versions: |
---|
46 | |
---|
47 | .. code-block:: none |
---|
48 | |
---|
49 | $ export PATH=$HOME/development/rtems/5/bin:$PATH |
---|
50 | |
---|
51 | .. _bootstrapping: |
---|
52 | |
---|
53 | Bootstrapping |
---|
54 | ------------- |
---|
55 | |
---|
56 | The developers version of the code from git requires we ``bootstrap`` the |
---|
57 | source code. This is an ``autoconf`` and ``automake`` bootstrap to create the |
---|
58 | various files generated by ``autoconf`` and ``automake``. RTEMS does not keep |
---|
59 | these generated files under version control. The bootstrap process is slow so |
---|
60 | to speed it up the RSB provides a command that can perform the bootstrap in |
---|
61 | parallel using your available cores. We need to enter the cloned source |
---|
62 | directory then run the bootstrap commands: |
---|
63 | |
---|
64 | .. code-block:: none |
---|
65 | |
---|
66 | $ cd rtems |
---|
67 | $ ./bootstrap -c && $HOME/development/rtems/rsb/source-builder/sb-bootstrap |
---|
68 | removing automake generated Makefile.in files |
---|
69 | removing configure files |
---|
70 | removing aclocal.m4 files |
---|
71 | RTEMS Source Builder - RTEMS Bootstrap, 5 (089327b5dcf9) |
---|
72 | 1/139: autoreconf: configure.ac |
---|
73 | 2/139: autoreconf: cpukit/configure.ac |
---|
74 | 3/139: autoreconf: tools/cpu/configure.ac |
---|
75 | 4/139: autoreconf: tools/cpu/generic/configure.ac |
---|
76 | 5/139: autoreconf: tools/cpu/sh/configure.ac |
---|
77 | 6/139: autoreconf: tools/cpu/nios2/configure.ac |
---|
78 | 7/139: autoreconf: tools/build/configure.ac |
---|
79 | 8/139: autoreconf: doc/configure.ac |
---|
80 | ...... |
---|
81 | 124/139: autoreconf: c/src/make/configure.ac |
---|
82 | 125/139: autoreconf: c/src/librtems++/configure.ac |
---|
83 | 126/139: autoreconf: c/src/ada-tests/configure.ac |
---|
84 | 127/139: autoreconf: testsuites/configure.ac |
---|
85 | 128/139: autoreconf: testsuites/libtests/configure.ac |
---|
86 | 129/139: autoreconf: testsuites/mptests/configure.ac |
---|
87 | 130/139: autoreconf: testsuites/fstests/configure.ac |
---|
88 | 131/139: autoreconf: testsuites/sptests/configure.ac |
---|
89 | 132/139: autoreconf: testsuites/tmtests/configure.ac |
---|
90 | 133/139: autoreconf: testsuites/smptests/configure.ac |
---|
91 | 134/139: autoreconf: testsuites/tools/configure.ac |
---|
92 | 135/139: autoreconf: testsuites/tools/generic/configure.ac |
---|
93 | 136/139: autoreconf: testsuites/psxtests/configure.ac |
---|
94 | 137/139: autoreconf: testsuites/psxtmtests/configure.ac |
---|
95 | 138/139: autoreconf: testsuites/rhealstone/configure.ac |
---|
96 | 139/139: autoreconf: testsuites/samples/configure.ac |
---|
97 | Bootstrap time: 0:02:47.398824 |
---|
98 | |
---|
99 | Building a BSP |
---|
100 | -------------- |
---|
101 | |
---|
102 | We build RTEMS in a directory outside of the source tree we have just cloned |
---|
103 | and ``bootstrapped``. You cannot build RTEMS while in the source tree. Lets |
---|
104 | create a suitable directory using the name of the BSP we are going to build: |
---|
105 | |
---|
106 | .. code-block:: none |
---|
107 | |
---|
108 | $ cd .. |
---|
109 | $ mkdir erc32 |
---|
110 | $ cd erc32 |
---|
111 | |
---|
112 | Configure RTEMS using the ``configure`` command. We use a full path to |
---|
113 | ``configure`` so the object files built contain the absolute path of the source |
---|
114 | files. If you are source level debugging you will be able to access the source |
---|
115 | code to RTEMS from the debugger. We will build for the ``erc32`` BSP with POSIX |
---|
116 | enabled and the networking stack disabled: |
---|
117 | |
---|
118 | .. code-block:: none |
---|
119 | |
---|
120 | $ $HOME/development/rtems/kernel/rtems/configure --prefix=$HOME/development/rtems/5 \ |
---|
121 | --target=sparc-rtems5 --enable-rtemsbsp=erc32 --enable-posix \ |
---|
122 | --disable-networking |
---|
123 | checking for gmake... no |
---|
124 | checking for make... make |
---|
125 | checking for RTEMS Version... 4.11.99.0 |
---|
126 | checking build system type... x86_64-pc-linux-gnu |
---|
127 | checking host system type... x86_64-pc-linux-gnu |
---|
128 | checking target system type... sparc-unknown-rtems5 |
---|
129 | checking for a BSD-compatible install... /usr/bin/install -c |
---|
130 | checking whether build environment is sane... yes |
---|
131 | checking for a thread-safe mkdir -p... /bin/mkdir -p |
---|
132 | checking for gawk... no |
---|
133 | checking for mawk... mawk |
---|
134 | checking whether make sets $(MAKE)... yes |
---|
135 | checking whether to enable maintainer-specific portions of Makefiles... no |
---|
136 | checking that generated files are newer than configure... done |
---|
137 | ...... |
---|
138 | checking target system type... sparc-unknown-rtems5 |
---|
139 | checking rtems target cpu... sparc |
---|
140 | checking for a BSD-compatible install... /usr/bin/install -c |
---|
141 | checking whether build environment is sane... yes |
---|
142 | checking for sparc-rtems5-strip... sparc-rtems5-strip |
---|
143 | checking for a thread-safe mkdir -p... /bin/mkdir -p |
---|
144 | checking for gawk... no |
---|
145 | checking for mawk... mawk |
---|
146 | checking whether make sets $(MAKE)... yes |
---|
147 | checking whether to enable maintainer-specific portions of Makefiles... no |
---|
148 | checking that generated files are newer than configure... done |
---|
149 | configure: creating ./config.status |
---|
150 | config.status: creating Makefile |
---|
151 | |
---|
152 | target architecture: sparc. |
---|
153 | available BSPs: erc32. |
---|
154 | 'make all' will build the following BSPs: erc32. |
---|
155 | other BSPs can be built with 'make RTEMS_BSP="bsp1 bsp2 ..."' |
---|
156 | |
---|
157 | config.status: creating Makefile |
---|
158 | |
---|
159 | Build RTEMS using two cores: |
---|
160 | |
---|
161 | .. code-block:: none |
---|
162 | |
---|
163 | $ make -j 2 |
---|
164 | Making all in tools/build |
---|
165 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
166 | make all-am |
---|
167 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
168 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT cklength.o -MD -MP -MF .deps/cklength.Tpo -c -o cklength.o /home/chris/development/rtems/kernel/rtems/tools/build/cklength.c |
---|
169 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT eolstrip.o -MD -MP -MF .deps/eolstrip.Tpo -c -o eolstrip.o /home/chris/development/rtems/kernel/rtems/tools/build/eolstrip.c |
---|
170 | mv -f .deps/cklength.Tpo .deps/cklength.Po |
---|
171 | mv -f .deps/eolstrip.Tpo .deps/eolstrip.Po |
---|
172 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT compat.o -MD -MP -MF .deps/compat.Tpo -c -o compat.o /home/chris/development/rtems/kernel/rtems/tools/build/compat.c |
---|
173 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT packhex.o -MD -MP -MF .deps/packhex.Tpo -c -o packhex.o /home/chris/development/rtems/kernel/rtems/tools/build/packhex.c |
---|
174 | mv -f .deps/compat.Tpo .deps/compat.Po |
---|
175 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT unhex.o -MD -MP -MF .deps/unhex.Tpo -c -o unhex.o /home/chris/development/rtems/kernel/rtems/tools/build/unhex.c |
---|
176 | mv -f .deps/packhex.Tpo .deps/packhex.Po |
---|
177 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT rtems-bin2c.o -MD -MP -MF .deps/rtems-bin2c.Tpo -c -o rtems-bin2c.o /home/chris/development/rtems/kernel/rtems/tools/build/rtems-bin2c.c |
---|
178 | mv -f .deps/unhex.Tpo .deps/unhex.Po |
---|
179 | gcc -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/tools/build -g -O2 -MT binpatch.o -MD -MP -MF .deps/binpatch.Tpo -c -o binpatch.o /home/chris/development/rtems/kernel/rtems/tools/build/binpatch.c |
---|
180 | mv -f .deps/rtems-bin2c.Tpo .deps/rtems-bin2c.Po |
---|
181 | gcc -g -O2 -o cklength cklength.o |
---|
182 | mv -f .deps/binpatch.Tpo .deps/binpatch.Po |
---|
183 | gcc -g -O2 -o eolstrip eolstrip.o compat.o |
---|
184 | gcc -g -O2 -o packhex packhex.o |
---|
185 | gcc -g -O2 -o rtems-bin2c rtems-bin2c.o compat.o |
---|
186 | gcc -g -O2 -o unhex unhex.o compat.o |
---|
187 | gcc -g -O2 -o binpatch binpatch.o |
---|
188 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
189 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
190 | Making all in tools/cpu |
---|
191 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
192 | Making all in generic |
---|
193 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu/generic' |
---|
194 | make[2]: Nothing to be done for 'all'. |
---|
195 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu/generic' |
---|
196 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
197 | make[2]: Nothing to be done for 'all-am'. |
---|
198 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
199 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
200 | Making all in testsuites/tools |
---|
201 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32/testsuites/tools' |
---|
202 | Making all in generic |
---|
203 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/testsuites/tools/generic' |
---|
204 | make[2]: Nothing to be done for 'all'. |
---|
205 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/testsuites/tools/generic' |
---|
206 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/testsuites/tools' |
---|
207 | make[2]: Nothing to be done for 'all-am'. |
---|
208 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/testsuites/tools' |
---|
209 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/testsuites/tools' |
---|
210 | Making all in sparc-rtems5/c |
---|
211 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/c' |
---|
212 | Making all in . |
---|
213 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/c' |
---|
214 | Configuring RTEMS_BSP=erc32 |
---|
215 | checking for gmake... no |
---|
216 | checking for make... make |
---|
217 | checking build system type... x86_64-pc-linux-gnu |
---|
218 | checking host system type... sparc-unknown-rtems5 |
---|
219 | ...... |
---|
220 | sparc-rtems5-gcc -B../../../../../erc32/lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/c/src/../../testsuites/samples/nsecs -I.. -I/home/chris/development/rtems/kernel/rtems/c/src/../../testsuites/samples/../support/include -mcpu=cypress -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT init.o -MD -MP -MF .deps/init.Tpo -c -o init.o /home/chris/development/rtems/kernel/rtems/c/src/../../testsuites/samples/nsecs/init.c |
---|
221 | sparc-rtems5-gcc -B../../../../../erc32/lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H -I. -I/home/chris/development/rtems/kernel/rtems/c/src/../../testsuites/samples/nsecs -I.. -I/home/chris/development/rtems/kernel/rtems/c/src/../../testsuites/samples/../support/include -mcpu=cypress -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -MT empty.o -MD -MP -MF .deps/empty.Tpo -c -o empty.o /home/chris/development/rtems/kernel/rtems/c/src/../../testsuites/samples/nsecs/empty.c |
---|
222 | mv -f .deps/empty.Tpo .deps/empty.Po |
---|
223 | mv -f .deps/init.Tpo .deps/init.Po |
---|
224 | sparc-rtems5-gcc -B../../../../../erc32/lib/ -specs bsp_specs -qrtems -mcpu=cypress -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -Wl,--gc-sections -mcpu=cypress -o nsecs.exe init.o empty.o |
---|
225 | sparc-rtems5-nm -g -n nsecs.exe > nsecs.num |
---|
226 | sparc-rtems5-size nsecs.exe |
---|
227 | text data bss dec hex filename |
---|
228 | 121392 1888 6624 129904 1fb70 nsecs.exe |
---|
229 | cp nsecs.exe nsecs.ralf |
---|
230 | make[6]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32/testsuites/samples/nsecs' |
---|
231 | make[5]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32/testsuites/samples' |
---|
232 | make[4]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32/testsuites/samples' |
---|
233 | make[4]: Entering directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32/testsuites' |
---|
234 | make[4]: Nothing to be done for 'all-am'. |
---|
235 | make[4]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32/testsuites' |
---|
236 | make[3]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32/testsuites' |
---|
237 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/ c/erc32' |
---|
238 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/c' |
---|
239 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32' |
---|
240 | make[1]: Nothing to be done for 'all-am'. |
---|
241 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32' |
---|
242 | |
---|
243 | Installing A BSP |
---|
244 | ---------------- |
---|
245 | |
---|
246 | All that remains to be done is to install the kernel. Installing RTEMS copies |
---|
247 | the API headers and architecture specific libraries to a locaiton under the |
---|
248 | `prefix` you provide. You can install any number of BSPs under the same |
---|
249 | `prefix`. We recommend you have a separate `prefix` for different versions of |
---|
250 | RTEMS. Do not mix versions of RTEMS under the same `prefix`. Make installs |
---|
251 | RTEMS with the following command: |
---|
252 | |
---|
253 | .. code-block:: none |
---|
254 | |
---|
255 | $ make install |
---|
256 | Making install in tools/build |
---|
257 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
258 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
259 | /bin/mkdir -p '/home/chris/development/rtems/5/bin' |
---|
260 | /usr/bin/install -c cklength eolstrip packhex unhex rtems-bin2c '/home/chris/development/rtems/5/bin' |
---|
261 | /bin/mkdir -p '/home/chris/development/rtems/5/bin' |
---|
262 | /usr/bin/install -c install-if-change '/home/chris/development/rtems/5/bin' |
---|
263 | make[2]: Nothing to be done for 'install-data-am'. |
---|
264 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
265 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/build' |
---|
266 | Making install in tools/cpu |
---|
267 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
268 | Making install in generic |
---|
269 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu/generic' |
---|
270 | make[3]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu/generic' |
---|
271 | make[3]: Nothing to be done for 'install-exec-am'. |
---|
272 | make[3]: Nothing to be done for 'install-data-am'. |
---|
273 | make[3]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu/generic' |
---|
274 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu/generic' |
---|
275 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
276 | make[3]: Entering directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
277 | make[3]: Nothing to be done for 'install-exec-am'. |
---|
278 | make[3]: Nothing to be done for 'install-data-am'. |
---|
279 | make[3]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
280 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
281 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/tools/cpu' |
---|
282 | .... |
---|
283 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32/sparc-rtems5/c' |
---|
284 | make[1]: Entering directory '/home/chris/development/rtems/kernel/erc32' |
---|
285 | make[2]: Entering directory '/home/chris/development/rtems/kernel/erc32' |
---|
286 | make[2]: Nothing to be done for 'install-exec-am'. |
---|
287 | /bin/mkdir -p '/home/chris/development/rtems/5/make' |
---|
288 | /usr/bin/install -c -m 644 /home/chris/development/rtems/kernel/rtems/make/main.cfg /home/chris/development/rtems/kernel/rtems/make/leaf.cfg '/home/chris/development/rtems/5/make' |
---|
289 | /bin/mkdir -p '/home/chris/development/rtems/5/share/rtems5/make/Templates' |
---|
290 | /usr/bin/install -c -m 644 /home/chris/development/rtems/kernel/rtems/make/Templates/Makefile.dir /home/chris/development/rtems/kernel/rtems/make/Templates/Makefile.leaf /home/chris/development/rtems/kernel/rtems/make/Templates/Makefile.lib '/home/chris/development/rtems/5/share/rtems5/make/Templates' |
---|
291 | /bin/mkdir -p '/home/chris/development/rtems/5/make/custom' |
---|
292 | /usr/bin/install -c -m 644 /home/chris/development/rtems/kernel/rtems/make/custom/default.cfg '/home/chris/development/rtems/5/make/custom' |
---|
293 | make[2]: Leaving directory '/home/chris/development/rtems/kernel/erc32' |
---|
294 | make[1]: Leaving directory '/home/chris/development/rtems/kernel/erc32' |
---|
295 | |
---|
296 | Contributing Patches |
---|
297 | -------------------- |
---|
298 | |
---|
299 | RTEMS welcomes fixes to bugs and new features. The RTEMS Project likes to have |
---|
300 | bugs fixed against a ticket created on our :r:url:`devel`. Please raise a |
---|
301 | ticket if you have a bug. Any changes that are made can be tracked against the |
---|
302 | ticket. If you want to add a new a feature please post a message to |
---|
303 | :r:list:`devel` describing what you would like to implement. The RTEMS |
---|
304 | maintainer will help decide if the feature is in the best interest of the |
---|
305 | project. Not everything is and the maintainers need to evalulate how much |
---|
306 | effort it is to maintain the feature. Once accepted into the source tree it |
---|
307 | becomes the responsibility of the maintainers to keep the feature updated and |
---|
308 | working. |
---|
309 | |
---|
310 | Changes to the source tree are tracked using git. If you have not made changes |
---|
311 | and enter the source tree and enter a git status command you will see nothing |
---|
312 | has changed: |
---|
313 | |
---|
314 | .. code-block:: none |
---|
315 | |
---|
316 | $ cd ../rtems |
---|
317 | $ git status |
---|
318 | On branch master |
---|
319 | Your branch is up-to-date with 'origin/master'. |
---|
320 | nothing to commit, working directory clean |
---|
321 | |
---|
322 | We will make a change to the source code. In this example I change the help |
---|
323 | message to the RTEMS shell's ``halt`` command. Running the same git status |
---|
324 | command reports: |
---|
325 | |
---|
326 | .. code-block:: none |
---|
327 | |
---|
328 | $ git status |
---|
329 | On branch master |
---|
330 | Your branch is up-to-date with 'origin/master'. |
---|
331 | Changes not staged for commit: |
---|
332 | (use "git add <file>..." to update what will be committed) |
---|
333 | (use "git checkout -- <file>..." to discard changes in working directory) |
---|
334 | |
---|
335 | modified: cpukit/libmisc/shell/main_halt.c |
---|
336 | |
---|
337 | no changes added to commit (use "git add" and/or "git commit -a") |
---|
338 | |
---|
339 | As an example I have a ticket open and the ticket number is 9876. I commit the |
---|
340 | change with the follow git command: |
---|
341 | |
---|
342 | .. code-block:: none |
---|
343 | |
---|
344 | $ git commit cpukit/libmisc/shell/main_halt.c |
---|
345 | |
---|
346 | An editor is opened and I enter my commit message. The first line is a title |
---|
347 | and the following lines form a body. My message is: |
---|
348 | |
---|
349 | .. code-block:: none |
---|
350 | |
---|
351 | shell: Add more help detail to the halt command. |
---|
352 | |
---|
353 | Closes #9876. |
---|
354 | |
---|
355 | # Please enter the commit message for your changes. Lines starting |
---|
356 | # with '#' will be ignored, and an empty message aborts the commit. |
---|
357 | # Explicit paths specified without -i or -o; assuming --only paths... |
---|
358 | # |
---|
359 | # Committer: Chris Johns <chrisj@rtems.org> |
---|
360 | # |
---|
361 | # On branch master |
---|
362 | # Your branch is up-to-date with 'origin/master'. |
---|
363 | # |
---|
364 | # Changes to be committed: |
---|
365 | # modified: cpukit/libmisc/shell/main_halt.c |
---|
366 | |
---|
367 | When you save and exit the editor git will report the commit's status: |
---|
368 | |
---|
369 | .. code-block:: none |
---|
370 | |
---|
371 | $ git commit cpukit/libmisc/shell/main_halt.c |
---|
372 | [master 9f44dc9] shell: Add more help detail to the halt command. |
---|
373 | 1 file changed, 1 insertion(+), 1 deletion(-) |
---|
374 | |
---|
375 | You can either email the patch to :r:list:`devel` with the following git |
---|
376 | command, and it is `minus one` on the command line: |
---|
377 | |
---|
378 | .. code-block:: none |
---|
379 | |
---|
380 | $ git send-email --to=devel@rtems.org -1 |
---|
381 | <add output here> |
---|
382 | |
---|
383 | Or you can ask git to create a patch file using: |
---|
384 | |
---|
385 | .. code-block:: none |
---|
386 | |
---|
387 | $ git format-patch -1 |
---|
388 | 0001-shell-Add-more-help-detail-to-the-halt-command.patch |
---|
389 | |
---|
390 | This patch can be attached to a ticket. |
---|