|
| 1 | +========================= |
| 2 | +Versioning and Task Names |
| 3 | +========================= |
| 4 | + |
| 5 | +.. warning:: |
| 6 | + Migrated from: |
| 7 | + https://cwiki.apache.org/confluence/display/NUTTX/Versioning+and+Task+Names |
| 8 | + |
| 9 | + And also seems outdated. |
| 10 | + |
| 11 | +Question |
| 12 | +======== |
| 13 | + |
| 14 | +I have strange output from the NSH: |
| 15 | + |
| 16 | +.. code-block:: bash |
| 17 | +
|
| 18 | + nsh> sysinfo |
| 19 | + System Information: |
| 20 | + NuttX Version: 0.0 Build: 0 |
| 21 | + System Time: 1325809119 [s] UTC |
| 22 | + |
| 23 | + nsh> ps |
| 24 | + PID PRI SCHD TYPE NP STATE NAME |
| 25 | + 0 0 FIFO KTHREAD READY <noname>() |
| 26 | + 1 50 FIFO KTHREAD WAITSIG <noname>() |
| 27 | + 2 100 FIFO TASK RUNNING <noname>() |
| 28 | +
|
| 29 | +No NAME and no version / build number |
| 30 | + |
| 31 | +Answer |
| 32 | +====== |
| 33 | + |
| 34 | +This is probably normal behavior. There are two separate, unrelated issues here. |
| 35 | + |
| 36 | +Versioning |
| 37 | +---------- |
| 38 | + |
| 39 | +There are two different ways to get NuttX: (1) You can download the versioned |
| 40 | +releases at https://bitbucket.org/nuttx/nuttx/downloads, or you can (2) take |
| 41 | +un-versioned snapshots from the GIT repository at |
| 42 | +https://github.com/apache/nuttx. Since you have no version information, |
| 43 | +I am assuming that you are using a un-versioned copy. |
| 44 | + |
| 45 | +The version number you are looking at comes from the header file |
| 46 | +``nuttx/include/nuttx/version.h``. That header file was created at build time |
| 47 | +from a hidden file that you can find in the top-level nuttx directory called |
| 48 | +.version. For NuttX-7.10, that file looks like this: |
| 49 | + |
| 50 | +.. code-block:: bash |
| 51 | +
|
| 52 | + #!/bin/bash |
| 53 | +
|
| 54 | + CONFIG_VERSION_STRING="7.10" |
| 55 | + CONFIG_VERSION_MAJOR=7 |
| 56 | + CONFIG_VERSION_MINOR=10 |
| 57 | + CONFIG_VERSION_BUILD="85981b37acc215ab795ef4ea4045f3e85a49a7af" |
| 58 | +
|
| 59 | +The ``.version`` file does not exist in the GIT repository; it is was added to |
| 60 | +the ``nuttx-7.10.tar.gz`` tarball when the NuttX-7.10 version was created. |
| 61 | + |
| 62 | +The ``version.h`` header file is then generated by ``tools/mkversion`` the |
| 63 | +first time that you build the RTOS. That tool generates this ``version.h`` |
| 64 | +header file for the above ``.version`` file: |
| 65 | + |
| 66 | +.. code-block:: c |
| 67 | +
|
| 68 | + /* version.h -- Autogenerated! Do not edit. */ |
| 69 | + |
| 70 | + #ifndef __INCLUDE_NUTTX_VERSION_H |
| 71 | + #define __INCLUDE_NUTTX_VERSION_H |
| 72 | + |
| 73 | + #define CONFIG_VERSION_STRING "7.10" |
| 74 | + #define CONFIG_VERSION_MAJOR 7 |
| 75 | + #define CONFIG_VERSION_MINOR 10 |
| 76 | + #define CONFIG_VERSION_BUILD "85981b37acc215ab795ef4ea4045f3e85a49a7af" |
| 77 | + |
| 78 | + #define CONFIG_VERSION ((CONFIG_VERSION_MAJOR << 8) | (CONFIG_VERSION_MINOR)) |
| 79 | + |
| 80 | + #endif /* __INCLUDE_NUTTX_VERSION_H */ |
| 81 | +
|
| 82 | +And that is where the sysinfo command gets the version information that it |
| 83 | +prints. |
| 84 | + |
| 85 | +If you are using an un-versioned snapshot of NuttX from the GIT repository, |
| 86 | +then the ``.version`` file will not exist. The make system will check if there |
| 87 | +is ``.version`` file every time you build. If there is no ``.version`` in the |
| 88 | +top-level nuttx directory, then the make system will use the script at |
| 89 | +``tools/version.sh`` to create one with version 0.0: |
| 90 | + |
| 91 | +.. code-block:: bash |
| 92 | +
|
| 93 | + $(TOPDIR)/.version: |
| 94 | + $(Q) if [ ! -f .version ]; then \ |
| 95 | + echo "No .version file found, creating one"; \ |
| 96 | + tools/version.sh -v 0.0 -b 0 .version; \ |
| 97 | + chmod 755 .version; \ |
| 98 | + fi |
| 99 | +
|
| 100 | +This is completely appropriate if you are using un-versioned code. You are, |
| 101 | +however, free to edit the top-level ``.version`` file to generate any kind of |
| 102 | +custom versioning information that you would like. It would, however, |
| 103 | +probably be inappropriate to say you are using a released version when you |
| 104 | +are not. |
| 105 | + |
| 106 | +Task Name Size |
| 107 | +-------------- |
| 108 | + |
| 109 | +This one is easy. The size of a task name is controlled by the following |
| 110 | +setting in your ``.config`` file: |
| 111 | + |
| 112 | +.. code-block:: c |
| 113 | +
|
| 114 | + CONFIG_TASK_NAME_SIZE=0 |
| 115 | +
|
| 116 | +It provides the maximum length of a task name. Zero, of course, then means no |
| 117 | +task names are supported. |
0 commit comments