Environment » Historial » Versió 25
Jorge L. Florit, 12-02-2014 21:07
1 | 1 | Pau Escrich | h1. Development Environment |
---|---|---|---|
2 | 18 | Jorge L. Florit | |
3 | 1 | Pau Escrich | |
4 | 25 | Jorge L. Florit | To know how to set the basics for the development go to: http://qmp.cat/Development |
5 | 14 | Pau Escrich | |
6 | 25 | Jorge L. Florit | _Note: only tricks or hack articles in this wiki._ |
7 | 19 | Roger Pueyo Centelles | |
8 | |||
9 | |||
10 | 22 | Roger Pueyo Centelles | h3(#compiling_previous_revision). Compiling qMp from a "previous git revision":http://dev.qmp.cat/projects/qmp/repository of the source code |
11 | 19 | Roger Pueyo Centelles | |
12 | To ensure maximum compatibility between the nodes in a network, all of them should run the same qMp firmware version (or, at least, very similar ones). To compile the firmware from a previous release (for example, "revision 944c45d":http://dev.qmp.cat/projects/qmp/repository/show?branch=master-bugfixes&rev=944c45d, do the following: |
||
13 | |||
14 | * Get the qMp firmware generator using git: <pre>git clone git://qmp.cat/qmpfw.git qmpfw-r944c45d</pre> |
||
15 | |||
16 | * Enter the source directory: <pre>cd qmpfw-r944c45d</pre> |
||
17 | |||
18 | * Do a checkout specifying the revision: <pre>make .checkout_qmp QMP_GIT_BRANCH=%GIT_REVISION%</pre> |
||
19 | |||
20 | Example for revision 944c45d: <pre>make .checkout_qmp QMP_GIT_BRANCH=944c45d</pre> |
||
21 | |||
22 | The result is: |
||
23 | <pre> |
||
24 | git clone git://qmp.cat/qmp.git build/qmp |
||
25 | Cloning into 'build/qmp'... |
||
26 | remote: Counting objects: 8822, done. |
||
27 | remote: Compressing objects: 100% (4160/4160), done. |
||
28 | remote: Total 8822 (delta 4060), reused 7827 (delta 3544) |
||
29 | Receiving objects: 100% (8822/8822), 2.03 MiB | 670.00 KiB/s, done. |
||
30 | Resolving deltas: 100% (4060/4060), done. |
||
31 | Checking connectivity... done. |
||
32 | cd build/qmp; git checkout 944c45d; cd .. |
||
33 | Note: checking out '944c45d'. |
||
34 | |||
35 | You are in 'detached HEAD' state. You can look around, make experimental |
||
36 | changes and commit them, and you can discard any commits you make in this |
||
37 | state without impacting any branches by performing another checkout. |
||
38 | |||
39 | If you want to create a new branch to retain commits you create, you may |
||
40 | do so (now or later) by using -b with the checkout command again. Example: |
||
41 | |||
42 | git checkout -b new_branch_name |
||
43 | |||
44 | HEAD is now at 944c45d... Import "Fix typo in RouterStationPro switch configuration". |
||
45 | </pre> |
||
46 | |||
47 | However, git now is not in a branch, but in a detached state: |
||
48 | |||
49 | <pre> |
||
50 | git --git-dir=build/qmp/.git branch |
||
51 | |||
52 | * (detached from 944c45d) |
||
53 | master |
||
54 | </pre> |
||
55 | |||
56 | A new local branch must be created. Otherwise compilation will most surely fail. The new local branch can be named "pladebarris":http://www.guifi.net/raval: |
||
57 | |||
58 | <pre> |
||
59 | git --git-dir=build/qmp/.git checkout -b pladebarris |
||
60 | |||
61 | [...] |
||
62 | Switched to a new branch 'pladebarris' |
||
63 | </pre> |
||
64 | |||
65 | 21 | Roger Pueyo Centelles | * [Optional] qMp is based on "OpenWrt":http://www.openwrt.org, which is also developed using "revisions":https://dev.openwrt.org/timeline. The qMp firmware build process downloads, by default, the "stable OpenWrt release":http://wiki.openwrt.org/about/history with the latest revision (as of 4th January 2014, "Attitude Adjustment":https://dev.openwrt.org/browser/branches/attitude_adjustment "revision 39154":https://dev.openwrt.org/log/branches/attitude_adjustment?rev=39154. It might be possible that an old revision of qMp would not work with the latest OpenWrt revision. If, for any reason, the qMp firmware must be built from a previous OpenWrt revision, the Makefile file must be edited: |
66 | |||
67 | Uncomment the OWRT_SVN_REV variable and specify the desired OpenWrt revision, for example "r36842":https://dev.openwrt.org/log/branches/attitude_adjustment?rev=36842 |
||
68 | <pre> |
||
69 | OWRT_SVN_REV = 36842 |
||
70 | </pre> |
||
71 | |||
72 | Then add the OpenWrt revision declaration in every _svn co $(OWRT_SVN)..._ or _svn co ${OWRT_PKG_SVN}..._ command inside the Makefile: |
||
73 | |||
74 | <pre> |
||
75 | [...] |
||
76 | |||
77 | define checkout_src |
||
78 | 23 | Roger Pueyo Centelles | svn --quiet co $(OWRT_SVN) $(BUILD_PATH) |
79 | |||
80 | 21 | Roger Pueyo Centelles | [...] |
81 | 1 | Pau Escrich | |
82 | 21 | Roger Pueyo Centelles | define checkout_owrt_pkg_override |
83 | 23 | Roger Pueyo Centelles | svn --quiet co ${OWRT_PKG_SVN} $(BUILD_DIR)/packages.$(TARGET) |
84 | 21 | Roger Pueyo Centelles | |
85 | 1 | Pau Escrich | [...] |
86 | 21 | Roger Pueyo Centelles | |
87 | .checkout_owrt_pkg: |
||
88 | 23 | Roger Pueyo Centelles | svn --quiet co ${OWRT_PKG_SVN} $(BUILD_DIR)/packages |
89 | 21 | Roger Pueyo Centelles | |
90 | [...] |
||
91 | </pre> |
||
92 | |||
93 | for |
||
94 | |||
95 | 1 | Pau Escrich | <pre> |
96 | [...] |
||
97 | 21 | Roger Pueyo Centelles | |
98 | define checkout_src |
||
99 | 23 | Roger Pueyo Centelles | svn --quiet co --revision=$(OWRT_SVN_REV) $(OWRT_SVN) $(BUILD_PATH) |
100 | |||
101 | 21 | Roger Pueyo Centelles | [...] |
102 | |||
103 | 1 | Pau Escrich | define checkout_owrt_pkg_override |
104 | 23 | Roger Pueyo Centelles | svn --quiet co --revision=$(OWRT_SVN_REV) ${OWRT_PKG_SVN} $(BUILD_DIR)/packages.$(TARGET) |
105 | 21 | Roger Pueyo Centelles | |
106 | [...] |
||
107 | |||
108 | .checkout_owrt_pkg: |
||
109 | 23 | Roger Pueyo Centelles | svn --quiet co --revision=$(OWRT_SVN_REV) ${OWRT_PKG_SVN} $(BUILD_DIR)/packages |
110 | 21 | Roger Pueyo Centelles | |
111 | [...] |
||
112 | </pre> |
||
113 | 20 | Roger Pueyo Centelles | |
114 | 24 | Roger Pueyo Centelles | * And compile it specifying the target (follow the instructions above). For a Nanostation M5: <pre>make build T=nsm5</pre> |
115 | 19 | Roger Pueyo Centelles | |
116 | After that, you will find the images ready to install in your devices inside directory images/ |