From version 16.1
edited by jehan monnier
on 2017/10/04 11:29
To version 17.1
edited by MatthieuTanon
on 2018/01/08 16:14
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.jehan
1 +xwiki:XWiki.MatthieuTanon
Content
... ... @@ -9,7 +9,7 @@
9 9  The target machine detailed packages setup itself is also out of this wiki page's scope.
10 10  However a few leads (and links) are given to get you on the right track.
11 11  
12 -This setup has been tested with **Yocto Fido .**
12 +This setup has been tested with **Yocto Fido** and **Yocto Morty**.
13 13  
14 14  == Set up your build system ==
15 15  
... ... @@ -25,6 +25,7 @@
25 25  
26 26  {{info}}
27 27  You only need to to this step if you are using new linphone recipes ( in the *.inc recipe files, look for "inherit cmake") . The older ones use the autotools and are working fine( in the *.inc recipe files, look for "inherit autotools").
28 +You don't need this step if you are using Yocto Morty
28 28  {{/info}}
29 29  
30 30  Yocto Fido uses **cmake version 2.8.12**. However, the linphone recipes require **cmake version 3 and higher** to be compiled.
... ... @@ -31,7 +31,7 @@
31 31  
32 32  Fortunately, a patch has been done to allow porting cmake 3.2.2 to Fido , the commit is here [[http:~~/~~/cgit.openembedded.org/openembedded-core/patch/?id=c171909352b5ed92166857b0bbcd901ae0f74996>>url:http://cgit.openembedded.org/openembedded-core/patch/?id=c171909352b5ed92166857b0bbcd901ae0f74996]] from [[http:~~/~~/cgit.openembedded.org/openembedded-core/commit/?id=c171909352b5ed92166857b0bbcd901ae0f74996>>url:http://cgit.openembedded.org/openembedded-core/commit/?id=c171909352b5ed92166857b0bbcd901ae0f74996]] . The following file contains the patch based on this commit [[cmake_upgrade_to_3.2.2.patch>>attach:cmake_upgrade_to_3.2.2.patch]]
33 33  
34 -If you put the file under the poky directory, starting the patch from the same directory, the command would be:
35 +If you put the file under the openembedded-core **(TBD)** directory, starting the patch from the same directory, the command would be:
35 35  
36 36  {{code}}
37 37  git apply cmake_ugrade_to_3.2.2.patch
... ... @@ -40,52 +40,73 @@
40 40  
41 41  === Get the Yocto build system for your platform ===
42 42  
43 -The Yocto project Complete documentation set covers this in details, and is available on their official website here : [[Yocto Documentation Website>>https://www.yoctoproject.org/documentation ]]
44 +The Yocto project Complete documentation set covers this in details, and is available on their official website here : [[Yocto Documentation Website>>https://www.yoctoproject.org/documentation ]]. The Yocto Project Quick Start guide is particularly helpful for the execution of the following steps.
45 +
44 44  The main steps to setup the adequate Yocto build environment and layers for your platform are as follows:
45 45  
46 -* Getting Bitbake and the OpenEmbedded components (known as Poky)
47 -* Checking out the wanted distribution version
48 -* Initializing the build environment to setup Bitbake
48 +* Get Bitbake and the OpenEmbedded components (known as Poky)
49 +** poky
50 +** openembedded-core
51 +** meta-openembedded
52 +* Check out the corresponding distribution version for each repository
53 +* Initialize the build environment to setup Bitbake
49 49  
55 +{{code}}
56 +source oe-init-build-env
57 +{{/code}}
58 +
59 +* Add the openembedded layers to the bblayers configuration file
60 +
61 +
50 50  == Add the Linphone recipe ==
51 51  
52 52  In order to build Linphone and its dependencies with Yocto , the following steps must be completed :
53 53  
54 54  * Get the Linphone recipe by cloning the repository
55 -* Add the layer to the bblayers configuration file
67 +* Add the layer to the bblayers configuration file
68 +* Add linphone to the image build
56 56  * Add the commercial license to the white flags list (needed by a linphone dependency)
57 57  * Make sure either antlr3 is available on your host or set JAVA_HOME environment variable.
58 58  * Add JAVA_HOME to BB_ENV_EXTRAWHITE.
59 59  
60 -There are a few optional additional steps described here, if you need to:
73 +There are a few optional additional steps described here:
61 61  
62 -* Disable video support
63 63  * Change the packaging options
76 +* Add liblinphone_tester
77 +* Disable video support
78 +* Select the number of CPU cores used for the build
79 +* Add networking packages
80 +* Save disk space during builds
81 +* Add an ssh server
64 64  
65 65  === Get Linphone recipes ===
66 66  
67 -Clone the Linphone layers repository on the same level as the other metadata. If you are using a
68 -a Yocto distribution from Yocto's offcial website, go under the //sources// directory and clone the
69 -repo there.
85 +Clone the Linphone layers repository on the same level as the other metadata.
70 70  
71 -{{info}}
72 -The master branch provides the linphone from master.
87 +The master branch provides the linphone from master.
73 73  
74 -{{/info}}
89 +{{code}}
90 +git clone git://git.linphone.org/meta-bc
91 +{{/code}}
75 75  
76 -{{code}}git clone git://git.linphone.org/meta-bc {{/code}}
77 -The resulting tree should look like this:
78 -{{code}}base Documentation meta-bc meta-fsl-arm meta-fsl-arm-extra meta-fsl-demos meta-openembedded poky
79 -jenkins@shuttle:~/fsl-dizzy/sources/meta-bc/recipes-bc$ ls
80 -flexisip linphone
81 -jenkins@shuttle:~/fsl-dizzy/sources/meta-bc/recipes-bc/linphone$ ls
82 -antlr3 bcunit belle-sip bzrtp libgsm mediastreamer2 msopenh264 opus polarssl speex-bc tunnel
83 -bctoolbox belcard belr libav linphone msamr mswebrtc ortp spandsp srtp{{/code}}
93 +Your metadata directory should now look like this:
94 +\\{{code}}[matthieu@linux-3 sources]$ ls
95 +meta-bc meta-openembedded openembedded-core
84 84  
97 +[matthieu@linux-3 meta-bc]$ ls
98 +conf README recipes-bc
99 +
100 +[matthieu@linux-3 recipes-bc]$ ls
101 +flexisip linphone
102 +
103 +[matthieu@linux-3 linphone]$ ls
104 +antlr3 belr msamr spandsp bcg729 bzrtp msopenh264 speex-bc bctoolbox libav mswebrtc srtp
105 +bcunit libgsm opus tunnel belcard linphone ortp belle-sip mediastreamer2 polarssl{{/code}}
106 +
85 85  This repository also contains the bitbake recipes for Flexisip (SIP proxy server).
86 86  
87 87  
88 -=== Add the linphone recipe to the build ===
110 +=== Add the linphone recipe to the layers ===
89 89  
90 90  In the bblayers.conf file, under build/conf/ add the following line:
91 91  {{code}}${BSPDIR}/sources/meta-bc {{/code}}
... ... @@ -99,34 +99,92 @@
99 99  BBLAYERS = " \
100 100   ${BSPDIR}/sources/poky/meta \
101 101   ${BSPDIR}/sources/poky/meta-yocto \
124 + ${BSPDIR}/sources/openembedded-core/meta \
102 102   ${BSPDIR}/sources/meta-openembedded/meta-oe \
103 103   ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
104 - ${BSPDIR}/sources/meta-fsl-arm \
105 - ${BSPDIR}/sources/meta-fsl-arm-extra \
106 - ${BSPDIR}/sources/meta-fsl-demos \
127 + ${BSPDIR}/sources/meta-openembedded/meta-networking \
128 + ${BSPDIR}/sources/meta-openembedded/meta-python \
107 107   ${BSPDIR}/sources/meta-bc \
108 108  "{{/code}}
109 109  
132 +=== Add linphone to the image build ===
133 +
134 +Once Linphone is built you can add it to the final image using the following lines:
135 +{{code}}IMAGE_INSTALL_append = " linphone"{{/code}}
136 +
110 110  === Add the commercial license to the white flags list ===
111 111  
112 -In the local.conf file under build/conf , add the following line :
113 -{{code}}LICENSE_FLAGS_WHITELIST = "commercial"
114 -BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE JAVA_HOME"{{/code}}
115 115  This is useful for libav, otherwise the linphone build will fail.
116 116  
117 -=== Disable the video options if there is no video output ===
141 +In the local.conf file under build/conf , add the following lines :
142 +{{code}}LICENSE_FLAGS_WHITELIST = "commercial"
143 +BB_ENV_EXTRAWHITE += "JAVA_HOME"{{/code}}
118 118  
119 -In the local.conf file under build/conf, add the following line :
120 -{{code}} DISTRO_FEATURES_remove = "x11 wayland" {{/code}}
121 -In the linphone.inc recipe file under /meta-bc/recipes-bc/linphone/linphone, remove the video in the following line :
122 -{{code}} PACKAGECONFIG ??= "sqlite zlib video ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" {{/code}}
123 123  
146 +{{info}}
147 +The following steps are optional but can be very useful if you want to customize your build
148 +{{/info}}
149 +
124 124  === Change the packaging option ===
125 125  
126 -In the file local.conf, under build/conf , make sure the PACKAGE_CLASSES is set to package_ipk :
152 +In the file local.conf, under build/conf, make sure the PACKAGE_CLASSES is set to package_ipk:
127 127  {{code}} PACKAGE_CLASSES ?= "package_ipk" {{/code}}
128 128  
129 -Build linphone
130 130  
156 +=== Add liblinphone_tester ===
157 +
158 +If you want to add liblinphone_tester to the final image you can add the following line in local.conf:
159 +{{code}}IMAGE_INSTALL_append = " linphone-tester"{{/code}}
160 +
161 +
162 +=== Disable the video options ===
163 +
164 +If you don't need video support, add the following line in the local.conf file under build/conf:
165 +{{code}} DISTRO_FEATURES_remove = "x11 wayland" {{/code}}
166 +
167 +
168 +In the linphone.inc recipe file under /meta-bc/recipes-bc/linphone/linphone, remove the video with the following line :
169 +{{code}} PACKAGECONFIG ??= "sqlite zlib video ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"{{/code}}
170 +
171 +
172 +Do not disable the video options if you intend to use liblinphone_tester on the final image. If you want to use liblinphoner_tester without having a video output, you might need to build glew and add it to the image using the following line:
173 +{{code}}IMAGE_INSTALL_append = " glew"{{/code}}
174 +
175 +
176 +=== Select number of CPU cores used for the build ===
177 +
178 +In the local.conf file under build/conf, add the following line:
179 +{{code}} BB_NUMBER_THREADS ?= "X"{{/code}}
180 +
181 +X being the number of threads that you want to use (twice the number of CPU cores)
182 +
183 +
184 +=== Add networking packages if necessary ===
185 +
186 +If you want to add networking packages to the core images, you can add the following lines to local.conf:
187 +{{code}} CORE_IMAGE_EXTRA_INSTALL += "dhcpcd"
188 + CORE_IMAGE_EXTRA_INSTALL += "init-ifupdown"{{/code}}
189 +
190 +
191 +=== Save disk space during builds ===
192 +
193 +You can save disk space during build by adding the following line to local.conf:
194 +{{code}}INHERIT += "rm_work"{{/code}}
195 +
196 +
197 +=== Add ssh server if necessary ===
198 +
199 +If you want to add an ssh server to the core images, you can modify the following line to local.conf:
200 +{{code}}EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh"
201 +{{/code}}
202 +
203 +
204 +== Build linphone ==
205 +
131 131  Now that you're environment is all set up, run the following command to build the Linphone package:
132 132  {{code}} bitbake linphone{{/code}}
208 +
209 +Then you can build the image you want using the following example command:
210 +{{code}} bitbake core-image-minimal{{/code}}
211 +
212 +