diff options
author | Eyal Reizer | 2012-11-01 03:07:43 -0500 |
---|---|---|
committer | Eyal Reizer | 2012-11-01 03:07:43 -0500 |
commit | cef63e1e75d2bce98dbac3faee3d088fc4646fc0 (patch) | |
tree | 9a25fce84ea88d795ee004fc7c332158dcc82c2e | |
parent | 9f24541874473eaedbd9f8de179025d1a315a82e (diff) | |
parent | 42f8d0b5fba27019d028d2381b8aaa7452ab41ed (diff) | |
download | build-utilities-cef63e1e75d2bce98dbac3faee3d088fc4646fc0.tar.gz build-utilities-cef63e1e75d2bce98dbac3faee3d088fc4646fc0.tar.xz build-utilities-cef63e1e75d2bce98dbac3faee3d088fc4646fc0.zip |
Merge branch 'master' of github.com:TI-ECS/build-utilites
21 files changed, 2886 insertions, 7 deletions
diff --git a/functions/common-functions b/functions/common-functions new file mode 100644 index 0000000..9383a93 --- /dev/null +++ b/functions/common-functions | |||
@@ -0,0 +1,439 @@ | |||
1 | function check() | ||
2 | { | ||
3 | cd ${WORK_SPACE} || exit 1 | ||
4 | COMPONENT_NAME="check-0.9.8.tar.gz" | ||
5 | COMPONENT_DIR="check-0.9.8" | ||
6 | download_component "http://downloads.sourceforge.net/check/check-0.9.8.tar.gz" | ||
7 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
8 | add_fingerprint 0 | ||
9 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
10 | make || exit 1 | ||
11 | make install DESTDIR=${ROOTFS} || exit 1 | ||
12 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
13 | add_fingerprint 1 | ||
14 | fi | ||
15 | echo "check built successfully" | ||
16 | } | ||
17 | |||
18 | function expat() | ||
19 | { | ||
20 | cd ${WORK_SPACE} || exit 1 | ||
21 | COMPONENT_NAME="expat-2.1.0.tar.gz" | ||
22 | COMPONENT_DIR="expat-2.1.0" | ||
23 | |||
24 | download_component "http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz" | ||
25 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
26 | add_fingerprint 0 | ||
27 | ./configure --host=arm-arago-linux-gnueabi --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
28 | make || exit 1 | ||
29 | make install DESTDIR=${ROOTFS} || exit 1 | ||
30 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
31 | add_fingerprint 1 | ||
32 | fi | ||
33 | echo "expat built successfully" | ||
34 | } | ||
35 | |||
36 | function libIConv() | ||
37 | { | ||
38 | cd ${WORK_SPACE} || exit 1 | ||
39 | COMPONENT_NAME="libiconv-1.14.tar.gz" | ||
40 | COMPONENT_DIR="libiconv-1.14" | ||
41 | download_component "http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz" | ||
42 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
43 | add_fingerprint 0 | ||
44 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
45 | make || exit 1 | ||
46 | make install DESTDIR=${ROOTFS} || exit 1 | ||
47 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
48 | add_fingerprint 1 | ||
49 | fi | ||
50 | echo "libIConv built successfully" | ||
51 | } | ||
52 | |||
53 | function zlib() | ||
54 | { | ||
55 | cd ${WORK_SPACE} || exit 1 | ||
56 | COMPONENT_NAME="zlib-1.2.7.tar.gz" | ||
57 | COMPONENT_DIR="zlib-1.2.7" | ||
58 | download_component "http://zlib.net/zlib-1.2.7.tar.gz" | ||
59 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
60 | add_fingerprint 0 | ||
61 | ./configure --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
62 | make || exit 1 | ||
63 | make install DESTDIR=${ROOTFS} || exit 1 | ||
64 | add_fingerprint 1 | ||
65 | fi | ||
66 | echo "zlib built successfully" | ||
67 | } | ||
68 | |||
69 | function gettext() | ||
70 | { | ||
71 | cd ${WORK_SPACE} || exit 1 | ||
72 | COMPONENT_NAME="gettext-0.18.tar.gz" | ||
73 | COMPONENT_DIR="gettext-0.18" | ||
74 | download_component "http://ftp.gnu.org/gnu/gettext/gettext-0.18.tar.gz" | ||
75 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
76 | add_fingerprint 0 | ||
77 | echo "ac_cv_func_unsetenv=no" > arm-linux.cache || exit 1 | ||
78 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache || exit 1 | ||
79 | make || exit 1 | ||
80 | make install DESTDIR=${ROOTFS} || exit 1 | ||
81 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
82 | add_fingerprint 1 | ||
83 | fi | ||
84 | echo "gettext built successfully" | ||
85 | } | ||
86 | |||
87 | function glib() | ||
88 | { | ||
89 | if [ $# -eq 1 ]; then | ||
90 | START_MODULE="glib-2.34.0.tar.xz" | ||
91 | fi | ||
92 | # dependency section, in here we build the dependencies. We do not want to rebuild them each time | ||
93 | libIConv | ||
94 | zlib | ||
95 | |||
96 | cd ${WORK_SPACE} || exit 1 | ||
97 | COMPONENT_NAME="glib-2.34.0.tar.xz" | ||
98 | COMPONENT_DIR="glib-2.34.0" | ||
99 | download_component "http://ftp.gnome.org/pub/GNOME/sources/glib/2.34/glib-2.34.0.tar.xz" | ||
100 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
101 | add_fingerprint 0 | ||
102 | echo "glib_cv_stack_grows=no | ||
103 | glib_cv_have_qsort_r=no | ||
104 | glib_cv_uscore=yes | ||
105 | ac_cv_func_posix_getpwuid_r=yes | ||
106 | ac_cv_func_posix_getgrgid_r=yes | ||
107 | ac_cv_func_pipe2=no" > arm-linux.cache || exit 1 | ||
108 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --with-libiconv=gnu || exit 1 | ||
109 | sed -i 's/\(^Libs: .*\)/\1 -liconv/g' glib-2.0.pc || exit 1 | ||
110 | sed -i 's/\(^Libs: .*\)/\1 -lgmodule-2.0/g' gio-2.0.pc || exit 1 | ||
111 | make || exit 1 | ||
112 | make install DESTDIR=${ROOTFS} || exit 1 | ||
113 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
114 | add_fingerprint 1 | ||
115 | fi | ||
116 | echo "glib built successfully" | ||
117 | } | ||
118 | |||
119 | function dbus() | ||
120 | { | ||
121 | if [ $# -eq 1 ]; then | ||
122 | START_MODULE="dbus-1.6.8.tar.gz" | ||
123 | fi | ||
124 | # dependency section, in here we build the dependencies. We do not want to rebuild them each time | ||
125 | expat | ||
126 | libffi | ||
127 | glib | ||
128 | |||
129 | cd ${WORK_SPACE} || exit 1 | ||
130 | COMPONENT_NAME="dbus-1.6.8.tar.gz" | ||
131 | COMPONENT_DIR="dbus-1.6.8" | ||
132 | download_component "http://dbus.freedesktop.org/releases/dbus/dbus-1.6.8.tar.gz" | ||
133 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
134 | add_fingerprint 0 | ||
135 | echo "ac_cv_func_pipe2=no" > arm-linux.cache || exit 1 | ||
136 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache --disable-inotify --without-x || exit 1 | ||
137 | make V=1 LIBS="-lffi -lz" || exit 1 | ||
138 | make install DESTDIR=${ROOTFS} || exit 1 | ||
139 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
140 | echo "messagebus:x:102:105::${MY_LOCALSTATEDIR}/run/dbus:/bin/false" >> ${ROOTFS}${MY_SYSCONFDIR}/passwd || exit 1 | ||
141 | add_fingerprint 1 | ||
142 | fi | ||
143 | echo "dbus built successfully" | ||
144 | } | ||
145 | |||
146 | function dbus-glib() | ||
147 | { | ||
148 | if [ $# -eq 1 ]; then | ||
149 | START_MODULE="dbus-glib-0.86.tar.gz" | ||
150 | fi | ||
151 | # dependency section, in here we build the dependencies. We do not want to rebuild them each time | ||
152 | dbus | ||
153 | glib | ||
154 | |||
155 | cd ${WORK_SPACE} || exit 1 | ||
156 | COMPONENT_NAME="dbus-glib-0.86.tar.gz" | ||
157 | COMPONENT_DIR="dbus-glib-0.86" | ||
158 | download_component "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.86.tar.gz" | ||
159 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
160 | add_fingerprint 0 | ||
161 | echo "ac_cv_have_abstract_sockets=yes" > arm-linux.cache || exit 1 | ||
162 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --cache-file=arm-linux.cache || exit 1 | ||
163 | sed -i 's/examples//g' dbus/Makefile || exit 1 | ||
164 | sed -i 's/tools test/test/g' Makefile || exit 1 | ||
165 | make LIBS="-lffi -lgthread-2.0" || exit 1 | ||
166 | make install DESTDIR=${ROOTFS} || exit 1 | ||
167 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
168 | add_fingerprint 1 | ||
169 | fi | ||
170 | echo "dbus-glib built successfully" | ||
171 | } | ||
172 | |||
173 | function python() | ||
174 | { | ||
175 | cd ${WORK_SPACE} || exit 1 | ||
176 | #dependency section | ||
177 | glib | ||
178 | |||
179 | COMPONENT_NAME="Python-2.7.3.tgz" | ||
180 | COMPONENT_DIR="Python-2.7.3" | ||
181 | download_component "http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz" | ||
182 | echo "CURRENT_OPTION=$CURRENT_OPTION" | ||
183 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
184 | add_fingerprint 0 | ||
185 | CC=gcc CXX=g++ AR=ar RANLIB=ranlib ./configure || exit 1 | ||
186 | make python Parser/pgen || exit 1 | ||
187 | mv python hostpython || exit 1 | ||
188 | mv Parser/pgen Parser/hostpgen || exit 1 | ||
189 | make distclean || exit 1 | ||
190 | patch -p1 < ${old_dir}/patches/0001-Python-2.7.3-xcompile.patch || exit 1 | ||
191 | ./configure --host=arm-linux --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --with-system-expat --enable-unicode=ucs2 --without-wctype-functions || exit 1 | ||
192 | make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED="${CROSS_COMPILE}gcc -shared" CROSS_COMPILE_TARGET=yes HOSTARCH=arm-linux BUILDARCH=x86_64-linux-gnu || exit 1 | ||
193 | make install DESTDIR=${ROOTFS} HOSTPYTHON=./hostpython BLDSHARED="${CROSS_COMPILE}gcc -shared" CROSS_COMPILE_TARGET=y || exit 1 | ||
194 | add_fingerprint 1 | ||
195 | fi | ||
196 | echo "python built successfully" | ||
197 | } | ||
198 | |||
199 | function dbus-python() | ||
200 | { | ||
201 | cd ${WORK_SPACE} || exit 1 | ||
202 | #dependency section | ||
203 | glib | ||
204 | dbus | ||
205 | python | ||
206 | |||
207 | COMPONENT_NAME="dbus-python-0.84.0.tar.gz" | ||
208 | COMPONENT_DIR="dbus-python-0.84.0" | ||
209 | download_component "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-0.84.0.tar.gz" | ||
210 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
211 | add_fingerprint 0 | ||
212 | echo "am_cv_python_pythondir=${MY_PREFIX}/lib/python2.7/site-packages | ||
213 | am_cv_python_pyexecdir=${MY_PREFIX}/lib/python2.7/site-packages" > arm-linux.cache || exit 1 | ||
214 | PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" PYTHON_LIBS="-L${ROOTFS}/${MY_PREFIX}/lib/python2.7" ./configure --host=arm-linux --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --cache-file=arm-linux.cache || exit 1 | ||
215 | make PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" || exit 1 | ||
216 | make install DESTDIR=${ROOTFS} || exit 1 | ||
217 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
218 | add_fingerprint 1 | ||
219 | fi | ||
220 | echo "dbus-python built successfully" | ||
221 | } | ||
222 | |||
223 | function pygobject() | ||
224 | { | ||
225 | cd ${WORK_SPACE} || exit 1 | ||
226 | |||
227 | #dependency section | ||
228 | glib | ||
229 | python | ||
230 | |||
231 | COMPONENT_NAME="pygobject-2.21.1.tar.bz2" | ||
232 | COMPONENT_DIR="pygobject-2.21.1" | ||
233 | download_component "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.21/pygobject-2.21.1.tar.bz2" | ||
234 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
235 | add_fingerprint 0 | ||
236 | echo "am_cv_python_pyexecdir=${MY_PREFIX}/lib/python2.7/site-packages" > arm-linux.cache || exit 1 | ||
237 | CC=gcc CXX=g++ AR=ar RANLIB=ranlib ./configure --disable-glibtest --without-ffi || exit 1 | ||
238 | cd ./gobject | ||
239 | make generate-constants || exit 1 | ||
240 | cd .. | ||
241 | cp gobject/generate-constants host-generate-constants || exit 1 | ||
242 | patch -p1 -i ${old_dir}/patches/0001-pygobject-python-includes.patch | ||
243 | /usr/bin/libtoolize || exit 1 | ||
244 | /usr/bin/aclocal -I m4 || exit 1 | ||
245 | /usr/bin/autoheader || exit 1 | ||
246 | /usr/bin/automake --add-missing || exit 1 | ||
247 | /usr/bin/autoconf || exit 1 | ||
248 | PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" NM=nm ./configure --host=arm-linux --build=x86_64-linux-gnu --prefix=${MY_PREFIX} --cache-file=arm-linux.cache || exit 1 | ||
249 | cp host-generate-constants gobject/generate-constants || exit 1 | ||
250 | make PYTHON_INCLUDES="-I${ROOTFS}${MY_PREFIX}/include/python2.7/" || exit 1 | ||
251 | make || exit 1 | ||
252 | make install DESTDIR=${ROOTFS} || exit 1 | ||
253 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
254 | add_fingerprint 1 | ||
255 | fi | ||
256 | echo "pygobject built successfully" | ||
257 | } | ||
258 | |||
259 | |||
260 | function firmware | ||
261 | { | ||
262 | cd ${WORK_SPACE} || exit 1 | ||
263 | COMPONENT_NAME="bt-firmware" | ||
264 | COMPONENT_REV="c17a13b64e7b1bfb1d44658b2473bcbff763befd" | ||
265 | COMPONENT_DIR="bt-firmware" | ||
266 | download_component "git://github.com/TI-ECS/bt-firmware.git" | ||
267 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
268 | add_fingerprint 0 | ||
269 | mkdir -p ${ROOTFS}/lib/firmware || exit 1 | ||
270 | |||
271 | if [ x"$MACHINE_TYPE" = "x" ]; then | ||
272 | get_machine_used | ||
273 | fi | ||
274 | |||
275 | PRINT_STR="Invoking: cp ${MACHINE_TYPE}/TIInit_12.8.32.bts ${ROOTFS}/lib/firmware/" | ||
276 | echo ${PRINT_STR} | ||
277 | cp ./${MACHINE_TYPE}/TIInit_12.8.32.bts ${ROOTFS}/lib/firmware/ || exit 1 | ||
278 | add_fingerprint 1 | ||
279 | fi | ||
280 | echo "firmware built successfully" | ||
281 | } | ||
282 | |||
283 | function uim | ||
284 | { | ||
285 | cd ${WORK_SPACE} || exit 1 | ||
286 | COMPONENT_NAME="uim" | ||
287 | COMPONENT_REV="c73894456df5def97111cb33d2106b684b8b7959" | ||
288 | COMPONENT_DIR="uim" | ||
289 | download_component "git://gitorious.org/uim/uim.git" | ||
290 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
291 | add_fingerprint 0 | ||
292 | if [ x"$MACHINE_TYPE" = "x" ]; then | ||
293 | get_machine_used | ||
294 | fi | ||
295 | install -d ${ROOTFS}${MY_PREFIX}/sbin ${ROOTFS}/etc/init.d | ||
296 | install -d ${ROOTFS}/etc/rcS.d | ||
297 | make DESTDIR=${ROOTFS} install | ||
298 | install -c -m 755 ${old_dir}/scripts/uim-sysfs.sh ${ROOTFS}/etc/init.d/ || exit 1 | ||
299 | cd ${ROOTFS}/etc/init.d/ || exit 1 | ||
300 | ln -s -f ../init.d/uim-sysfs.sh ../rcS.d/S04uim-sysfs || exit 1 | ||
301 | add_fingerprint 1 | ||
302 | fi | ||
303 | echo "uim built successfully" | ||
304 | } | ||
305 | |||
306 | function libffi() | ||
307 | { | ||
308 | cd ${WORK_SPACE} || exit 1 | ||
309 | COMPONENT_REV="70084e70ddb13b29dd05c751b1904de206bbe790" | ||
310 | COMPONENT_NAME="libffi" | ||
311 | COMPONENT_DIR="libffi" | ||
312 | |||
313 | download_component "https://github.com/atgreen/libffi.git" | ||
314 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
315 | add_fingerprint 0 | ||
316 | ./configure --prefix=${MY_PREFIX} CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld RANLIB=${CROSS_COMPILE}ranlib --host=arm-linux || exit 1 | ||
317 | make || exit 1 | ||
318 | make install DESTDIR=${ROOTFS} || exit 1 | ||
319 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
320 | add_fingerprint 1 | ||
321 | fi | ||
322 | echo "libffi built successfully" | ||
323 | } | ||
324 | function add_fingerprint() | ||
325 | { | ||
326 | if [ x"$1" = "x" ]; then | ||
327 | echo "Function add_fingerprint() called with no parameters!!!" | ||
328 | exit 1 | ||
329 | fi | ||
330 | local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}" | ||
331 | touch ${FILENAME} || exit 1 | ||
332 | echo $1 > ${FILENAME} || exit | ||
333 | } | ||
334 | |||
335 | function fingerprint() | ||
336 | { | ||
337 | local FILENAME="${FINGURE_PRINT_DIR}/${COMPONENT_NAME##*/}" | ||
338 | # if no file exists | ||
339 | if [ ! -e ${FILENAME} ]; then | ||
340 | return 0 | ||
341 | fi | ||
342 | read MAX < ${FILENAME} | ||
343 | return ${MAX} | ||
344 | } | ||
345 | |||
346 | function download_component() | ||
347 | { | ||
348 | if [ x"$1" = "x" ]; then | ||
349 | echo "Function called with no parameters!!!" | ||
350 | exit 1 | ||
351 | fi | ||
352 | |||
353 | if [ ! x"${START_MODULE}" = "x" ]; then # if the START_MODULE is not empty | ||
354 | if [ ${START_MODULE} = ${COMPONENT_NAME} ]; then # if we are building the start module | ||
355 | CURRENT_OPTION=${USER_OPTION} # take the user option as is | ||
356 | else | ||
357 | CURRENT_OPTION="1" # else, we are building dependency, so we should only build not rebuild | ||
358 | fi | ||
359 | else | ||
360 | CURRENT_OPTION=${USER_OPTION} # take the user option as is | ||
361 | fi | ||
362 | # get the extension of the file | ||
363 | local EXT=${1/*./} | ||
364 | |||
365 | # check the fingerprint value | ||
366 | fingerprint | ||
367 | case "$?" in | ||
368 | 0) # 0 - File not compiled nor installed | ||
369 | CURRENT_OPTION="2" # override to "rebuild" option | ||
370 | ;; | ||
371 | 1) # 1 - File was installed properly | ||
372 | # if the option is build and fingerprint OK, nothing to do | ||
373 | if [ ${CURRENT_OPTION} = "1" ]; then | ||
374 | return | ||
375 | fi | ||
376 | ;; | ||
377 | *) | ||
378 | echo "Corrupted fingerprint for component ${COMPONENT_NAME}" | ||
379 | exit 1 | ||
380 | ;; | ||
381 | esac | ||
382 | # echo "Decided to rebuild for ${COMPONENT_NAME}" | ||
383 | # read | ||
384 | # I get here in one situation : USER_OPTION = 2 | ||
385 | case "${EXT}" in | ||
386 | git) | ||
387 | # if git directory exist, do not clone it again | ||
388 | if [ ! -d ${COMPONENT_DIR} ]; then | ||
389 | git clone $1 || exit 1 | ||
390 | fi | ||
391 | cd ${COMPONENT_DIR} || exit 1 | ||
392 | git reset --hard ${COMPONENT_REV} || exit 1 | ||
393 | ;; | ||
394 | |||
395 | tgz|gz|bz2|xz|tar) | ||
396 | # delete the working directory if exists | ||
397 | if [ ! x"${COMPONENT_DIR}" = "x" ]; then | ||
398 | rm -rf ${COMPONENT_DIR} || exit 1 | ||
399 | fi | ||
400 | |||
401 | local TAR_FLAGS="-xavf" | ||
402 | |||
403 | # if component doesn't exist, bring it | ||
404 | if [ ! -e ${COMPONENT_NAME} ]; then | ||
405 | wget $1 || exit 1 | ||
406 | fi | ||
407 | tar ${TAR_FLAGS} ${COMPONENT_NAME} || exit 1 | ||
408 | # move to the directory if not empty | ||
409 | if [ ! x"${COMPONENT_DIR}" = "x" ]; then | ||
410 | cd ${COMPONENT_DIR} || exit 1 | ||
411 | fi; | ||
412 | ;; | ||
413 | |||
414 | *) | ||
415 | echo "Unknown extension of remote package" | ||
416 | exit 1 | ||
417 | ;; | ||
418 | esac | ||
419 | } | ||
420 | |||
421 | function get_machine_used() | ||
422 | { | ||
423 | # check if the machine type is already defined | ||
424 | if [ ! x"${MACHINE_TYPE}" = "x" ]; then | ||
425 | return; | ||
426 | fi | ||
427 | echo "" | ||
428 | echo "Please select the machine you use:" | ||
429 | echo "===================================" | ||
430 | echo "3. am335x-evm (am335x)" | ||
431 | read choice | ||
432 | case $choice in | ||
433 | 1) MACHINE_TYPE="am335x" ;; | ||
434 | *) | ||
435 | echo "This is not a valid choice... Exitiing script" | ||
436 | exit 1 | ||
437 | ;; | ||
438 | esac | ||
439 | } | ||
diff --git a/patches/0001-Python-2.7.3-xcompile.patch b/patches/0001-Python-2.7.3-xcompile.patch new file mode 100644 index 0000000..3fc4666 --- /dev/null +++ b/patches/0001-Python-2.7.3-xcompile.patch | |||
@@ -0,0 +1,228 @@ | |||
1 | From 846cdf11adb55e88f311bf5ff3ec4173cbe073d9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eyal Reizer <eyalr@ti.com> | ||
3 | Date: Mon, 22 Oct 2012 18:57:22 +0300 | ||
4 | Subject: [PATCH] Python-2.7.3-xcompile | ||
5 | |||
6 | Signed-off-by: Eyal Reizer <eyalr@ti.com> | ||
7 | --- | ||
8 | Lib/plat-linux3/regen | 8 ++++++++ | ||
9 | Makefile.pre.in | 27 ++++++++++++++++----------- | ||
10 | configure | 4 ++-- | ||
11 | setup.py | 43 ++++++++++++++++++++++++++++++++----------- | ||
12 | 4 files changed, 58 insertions(+), 24 deletions(-) | ||
13 | create mode 100644 Lib/plat-linux3/regen | ||
14 | |||
15 | diff --git a/Lib/plat-linux3/regen b/Lib/plat-linux3/regen | ||
16 | new file mode 100644 | ||
17 | index 0000000..7a78072 | ||
18 | --- /dev/null | ||
19 | +++ b/Lib/plat-linux3/regen | ||
20 | @@ -0,0 +1,8 @@ | ||
21 | +#! /bin/sh | ||
22 | +case `uname` in | ||
23 | +Linux*) ;; | ||
24 | +*) echo Probably not on a Linux system 1>&2 | ||
25 | + exit 1;; | ||
26 | +esac | ||
27 | +set -v | ||
28 | +h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h | ||
29 | diff --git a/Makefile.pre.in b/Makefile.pre.in | ||
30 | index e2237a9..fc6b2d7 100644 | ||
31 | --- a/Makefile.pre.in | ||
32 | +++ b/Makefile.pre.in | ||
33 | @@ -182,6 +182,7 @@ UNICODE_OBJS= @UNICODE_OBJS@ | ||
34 | |||
35 | PYTHON= python$(EXE) | ||
36 | BUILDPYTHON= python$(BUILDEXE) | ||
37 | +HOSTPYTHON= ./$(BUILDPYTHON) | ||
38 | |||
39 | # The task to run while instrument when building the profile-opt target | ||
40 | PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck | ||
41 | @@ -215,6 +216,8 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ | ||
42 | # Parser | ||
43 | PGEN= Parser/pgen$(EXE) | ||
44 | |||
45 | +HOSTPGEN= $(PGEN) | ||
46 | + | ||
47 | POBJS= \ | ||
48 | Parser/acceler.o \ | ||
49 | Parser/grammar1.o \ | ||
50 | @@ -408,8 +411,8 @@ platform: $(BUILDPYTHON) | ||
51 | # Build the shared modules | ||
52 | sharedmods: $(BUILDPYTHON) | ||
53 | @case $$MAKEFLAGS in \ | ||
54 | - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ | ||
55 | - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ | ||
56 | + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ | ||
57 | + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ | ||
58 | esac | ||
59 | |||
60 | # Build static library | ||
61 | @@ -543,7 +546,7 @@ Modules/python.o: $(srcdir)/Modules/python.c | ||
62 | $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp | ||
63 | Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) | ||
64 | -@$(INSTALL) -d Include | ||
65 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
66 | + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
67 | -touch Parser/pgen.stamp | ||
68 | |||
69 | $(PGEN): $(PGENOBJS) | ||
70 | @@ -938,26 +941,26 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c | ||
71 | $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ | ||
72 | $(DESTDIR)$(LIBDEST)/distutils/tests ; \ | ||
73 | fi | ||
74 | - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
75 | - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
76 | + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
77 | + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
78 | -d $(LIBDEST) -f \ | ||
79 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ | ||
80 | $(DESTDIR)$(LIBDEST) | ||
81 | - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
82 | - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
83 | + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
84 | + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
85 | -d $(LIBDEST) -f \ | ||
86 | -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ | ||
87 | $(DESTDIR)$(LIBDEST) | ||
88 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
89 | - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
90 | + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
91 | -d $(LIBDEST)/site-packages -f \ | ||
92 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | ||
93 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
94 | - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
95 | + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \ | ||
96 | -d $(LIBDEST)/site-packages -f \ | ||
97 | -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages | ||
98 | -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ | ||
99 | - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" | ||
100 | + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" | ||
101 | |||
102 | # Create the PLATDIR source directory, if one wasn't distributed.. | ||
103 | $(srcdir)/Lib/$(PLATDIR): | ||
104 | @@ -1062,7 +1065,9 @@ libainstall: all python-config | ||
105 | # Install the dynamically loadable modules | ||
106 | # This goes into $(exec_prefix) | ||
107 | sharedinstall: sharedmods | ||
108 | - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ | ||
109 | + CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ | ||
110 | + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ | ||
111 | + --skip-build \ | ||
112 | --prefix=$(prefix) \ | ||
113 | --install-scripts=$(BINDIR) \ | ||
114 | --install-platlib=$(DESTSHARED) \ | ||
115 | diff --git a/configure b/configure | ||
116 | index 3948080..acf3c8a 100755 | ||
117 | --- a/configure | ||
118 | +++ b/configure | ||
119 | @@ -13697,7 +13697,7 @@ $as_echo_n "checking for %lld and %llu printf() format support... " >&6; } | ||
120 | $as_echo_n "(cached) " >&6 | ||
121 | else | ||
122 | if test "$cross_compiling" = yes; then : | ||
123 | - ac_cv_have_long_long_format=no | ||
124 | + ac_cv_have_long_long_format="cross -- assuming yes" | ||
125 | else | ||
126 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
127 | /* end confdefs.h. */ | ||
128 | @@ -13749,7 +13749,7 @@ fi | ||
129 | $as_echo "$ac_cv_have_long_long_format" >&6; } | ||
130 | fi | ||
131 | |||
132 | -if test "$ac_cv_have_long_long_format" = yes | ||
133 | +if test "$ac_cv_have_long_long_format" != no | ||
134 | then | ||
135 | |||
136 | $as_echo "#define PY_FORMAT_LONG_LONG \"ll\"" >>confdefs.h | ||
137 | diff --git a/setup.py b/setup.py | ||
138 | index 6b47451..ed56aed 100644 | ||
139 | --- a/setup.py | ||
140 | +++ b/setup.py | ||
141 | @@ -145,6 +145,7 @@ class PyBuildExt(build_ext): | ||
142 | def __init__(self, dist): | ||
143 | build_ext.__init__(self, dist) | ||
144 | self.failed = [] | ||
145 | + self.cross_compile = os.environ.get('CROSS_COMPILE_TARGET') == 'yes' | ||
146 | |||
147 | def build_extensions(self): | ||
148 | |||
149 | @@ -278,6 +279,14 @@ class PyBuildExt(build_ext): | ||
150 | (ext.name, sys.exc_info()[1])) | ||
151 | self.failed.append(ext.name) | ||
152 | return | ||
153 | + | ||
154 | + # Import check will not work when cross-compiling. | ||
155 | + if os.environ.has_key('PYTHONXCPREFIX'): | ||
156 | + self.announce( | ||
157 | + 'WARNING: skipping import check for cross-compiled: "%s"' % | ||
158 | + ext.name) | ||
159 | + return | ||
160 | + | ||
161 | # Workaround for Mac OS X: The Carbon-based modules cannot be | ||
162 | # reliably imported into a command-line Python | ||
163 | if 'Carbon' in ext.extra_link_args: | ||
164 | @@ -369,9 +378,10 @@ class PyBuildExt(build_ext): | ||
165 | |||
166 | def detect_modules(self): | ||
167 | # Ensure that /usr/local is always used | ||
168 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
169 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
170 | - self.add_multiarch_paths() | ||
171 | + if not self.cross_compile: | ||
172 | + add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
173 | + add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
174 | + self.add_multiarch_paths() | ||
175 | |||
176 | # Add paths specified in the environment variables LDFLAGS and | ||
177 | # CPPFLAGS for header and library files. | ||
178 | @@ -408,7 +418,8 @@ class PyBuildExt(build_ext): | ||
179 | add_dir_to_list(dir_list, directory) | ||
180 | |||
181 | if os.path.normpath(sys.prefix) != '/usr' \ | ||
182 | - and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
183 | + and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ | ||
184 | + and not self.cross_compile: | ||
185 | # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework | ||
186 | # (PYTHONFRAMEWORK is set) to avoid # linking problems when | ||
187 | # building a framework with different architectures than | ||
188 | @@ -426,11 +437,14 @@ class PyBuildExt(build_ext): | ||
189 | # lib_dirs and inc_dirs are used to search for files; | ||
190 | # if a file is found in one of those directories, it can | ||
191 | # be assumed that no additional -I,-L directives are needed. | ||
192 | - lib_dirs = self.compiler.library_dirs + [ | ||
193 | - '/lib64', '/usr/lib64', | ||
194 | - '/lib', '/usr/lib', | ||
195 | - ] | ||
196 | - inc_dirs = self.compiler.include_dirs + ['/usr/include'] | ||
197 | + lib_dirs = self.compiler.library_dirs | ||
198 | + inc_dirs = self.compiler.include_dirs | ||
199 | + if not self.cross_compile: | ||
200 | + lib_dirs += [ | ||
201 | + '/lib64', '/usr/lib64', | ||
202 | + '/lib', '/usr/lib', | ||
203 | + ] | ||
204 | + inc_dirs += ['/usr/include'] | ||
205 | exts = [] | ||
206 | missing = [] | ||
207 | |||
208 | @@ -1864,8 +1878,15 @@ class PyBuildExt(build_ext): | ||
209 | |||
210 | # Pass empty CFLAGS because we'll just append the resulting | ||
211 | # CFLAGS to Python's; -g or -O2 is to be avoided. | ||
212 | - cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ | ||
213 | - % (ffi_builddir, ffi_srcdir, " ".join(config_args)) | ||
214 | + if self.cross_compile: | ||
215 | + cmd = "cd %s && env CFLAGS='' %s/configure --host=%s --build=%s %s" \ | ||
216 | + % (ffi_builddir, ffi_srcdir, | ||
217 | + os.environ.get('HOSTARCH'), | ||
218 | + os.environ.get('BUILDARCH'), | ||
219 | + " ".join(config_args)) | ||
220 | + else: | ||
221 | + cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ | ||
222 | + % (ffi_builddir, ffi_srcdir, " ".join(config_args)) | ||
223 | |||
224 | res = os.system(cmd) | ||
225 | if res or not os.path.exists(ffi_configfile): | ||
226 | -- | ||
227 | 1.7.9.5 | ||
228 | |||
diff --git a/patches/0001-bluez-define-_GNU_SOURCE-macro.patch b/patches/0001-bluez-define-_GNU_SOURCE-macro.patch new file mode 100644 index 0000000..fcf932e --- /dev/null +++ b/patches/0001-bluez-define-_GNU_SOURCE-macro.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 1b09d640c1781e9b28f803c3dc20cea1a1a653a8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vita Preskovsky <vitap@ti.com> | ||
3 | Date: Tue, 30 Oct 2012 09:54:58 +0200 | ||
4 | Subject: [PATCH] bluez: define _GNU_SOURCE macro | ||
5 | |||
6 | * O_CLOEXEC flag used in bluez requires _GNU_SOURCE macro to be defined. | ||
7 | |||
8 | |||
9 | Signed-off-by: Vita Preskovsky <vitap@ti.com> | ||
10 | --- | ||
11 | profiles/input/hog_device.c | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c | ||
15 | index f6e945e..576fb3e 100644 | ||
16 | --- a/profiles/input/hog_device.c | ||
17 | +++ b/profiles/input/hog_device.c | ||
18 | @@ -26,7 +26,7 @@ | ||
19 | #ifdef HAVE_CONFIG_H | ||
20 | #include <config.h> | ||
21 | #endif | ||
22 | - | ||
23 | +#define _GNU_SOURCE | ||
24 | #include <stdlib.h> | ||
25 | #include <stdbool.h> | ||
26 | #include <errno.h> | ||
27 | -- | ||
28 | 1.7.9.5 | ||
29 | |||
diff --git a/patches/0001-bt-obex-new-dbus-api-for-obexd.patch b/patches/0001-bt-obex-new-dbus-api-for-obexd.patch new file mode 100644 index 0000000..73ce6ac --- /dev/null +++ b/patches/0001-bt-obex-new-dbus-api-for-obexd.patch | |||
@@ -0,0 +1,287 @@ | |||
1 | From 0d60f8a9da3f0e77d8703da96d4f9e954f3c7c04 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vita Preskovsky <vitap@ti.com> | ||
3 | Date: Tue, 30 Oct 2012 18:37:39 +0200 | ||
4 | Subject: [PATCH] bt-obex: new dbus api for obexd | ||
5 | |||
6 | * obexd's dbus APIs are changed from "org.openobex" to "org.bluez.obex" | ||
7 | |||
8 | |||
9 | Signed-off-by: Vita Preskovsky <vitap@ti.com> | ||
10 | |||
11 | diff --git a/src/lib/obexd-api.h b/src/lib/obexd-api.h | ||
12 | index 09695f6..7716df4 100644 | ||
13 | --- a/src/lib/obexd-api.h | ||
14 | +++ b/src/lib/obexd-api.h | ||
15 | @@ -33,8 +33,8 @@ | ||
16 | #include <dbus/dbus-glib.h> | ||
17 | |||
18 | #ifdef OBEX_SUPPORT | ||
19 | -#define OBEXS_DBUS_NAME "org.openobex" | ||
20 | -#define OBEXC_DBUS_NAME "org.openobex.client" | ||
21 | +#define OBEXS_DBUS_NAME "org.bluez.obex" | ||
22 | +#define OBEXC_DBUS_NAME "org.bluez.obex.client" | ||
23 | |||
24 | /* OBEXD DBus API */ | ||
25 | #include "obexd/obexagent.h" | ||
26 | diff --git a/src/lib/obexd/obexagent.h b/src/lib/obexd/obexagent.h | ||
27 | index b94fb2c..5bc5f9c 100644 | ||
28 | --- a/src/lib/obexd/obexagent.h | ||
29 | +++ b/src/lib/obexd/obexagent.h | ||
30 | @@ -89,7 +89,7 @@ static const DBusGObjectInfo dbus_glib_obexagent_object_info = { | ||
31 | 0, | ||
32 | dbus_glib_obexagent_methods, | ||
33 | 7, | ||
34 | - "org.openobex.Agent\0Authorize\0S\0transfer\0I\0o\0bt_address\0I\0s\0name\0I\0s\0type\0I\0s\0length\0I\0i\0time\0I\0i\0arg6\0O\0F\0N\0s\0\0org.openobex.Agent\0Cancel\0S\0\0org.openobex.Agent\0Release\0S\0\0org.openobex.Agent\0Request\0S\0transfer\0I\0o\0arg1\0O\0F\0N\0s\0\0org.openobex.Agent\0Progress\0S\0transfer\0I\0o\0transferred\0I\0t\0\0org.openobex.Agent\0Complete\0S\0transfer\0I\0o\0\0org.openobex.Agent\0Error\0S\0transfer\0I\0o\0message\0I\0s\0\0\0", | ||
35 | + "org.bluez.obex.Agent\0Authorize\0S\0transfer\0I\0o\0bt_address\0I\0s\0name\0I\0s\0type\0I\0s\0length\0I\0i\0time\0I\0i\0arg6\0O\0F\0N\0s\0\0org.bluez.obex.Agent\0Cancel\0S\0\0org.bluez.obex.Agent\0Release\0S\0\0org.bluez.obex.Agent\0Request\0S\0transfer\0I\0o\0arg1\0O\0F\0N\0s\0\0org.bluez.obex.Agent\0Progress\0S\0transfer\0I\0o\0transferred\0I\0t\0\0org.bluez.obex.Agent\0Complete\0S\0transfer\0I\0o\0\0org.bluez.obex.Agent\0Error\0S\0transfer\0I\0o\0message\0I\0s\0\0\0", | ||
36 | "\0", | ||
37 | "\0" | ||
38 | }; | ||
39 | diff --git a/src/lib/obexd/obexclient.c b/src/lib/obexd/obexclient.c | ||
40 | index d8cfa78..b8ac43e 100644 | ||
41 | --- a/src/lib/obexd/obexclient.c | ||
42 | +++ b/src/lib/obexd/obexclient.c | ||
43 | @@ -83,7 +83,7 @@ static void obexclient_init(OBEXClient *self) | ||
44 | GError *error = NULL; | ||
45 | |||
46 | /* Getting introspection XML */ | ||
47 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", OBEXCLIENT_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); | ||
48 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", OBEXCLIENT_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); | ||
49 | self->priv->introspection_xml = NULL; | ||
50 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
51 | g_critical("%s", error->message); | ||
52 | @@ -97,7 +97,7 @@ static void obexclient_init(OBEXClient *self) | ||
53 | } | ||
54 | g_free(check_intf_regex_str); | ||
55 | |||
56 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", OBEXCLIENT_DBUS_PATH, OBEXCLIENT_DBUS_INTERFACE); | ||
57 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", OBEXCLIENT_DBUS_PATH, OBEXCLIENT_DBUS_INTERFACE); | ||
58 | } | ||
59 | |||
60 | /* Methods */ | ||
61 | diff --git a/src/lib/obexd/obexclient.h b/src/lib/obexd/obexclient.h | ||
62 | index d999b76..59799db 100644 | ||
63 | --- a/src/lib/obexd/obexclient.h | ||
64 | +++ b/src/lib/obexd/obexclient.h | ||
65 | @@ -27,7 +27,7 @@ | ||
66 | #include <glib-object.h> | ||
67 | |||
68 | #define OBEXCLIENT_DBUS_PATH "/" | ||
69 | -#define OBEXCLIENT_DBUS_INTERFACE "org.openobex.Client" | ||
70 | +#define OBEXCLIENT_DBUS_INTERFACE "org.bluez.obex.Client" | ||
71 | |||
72 | /* | ||
73 | * Type macros | ||
74 | diff --git a/src/lib/obexd/obexclient_file_transfer.c b/src/lib/obexd/obexclient_file_transfer.c | ||
75 | index 05fa36d..683cdfa 100644 | ||
76 | --- a/src/lib/obexd/obexclient_file_transfer.c | ||
77 | +++ b/src/lib/obexd/obexclient_file_transfer.c | ||
78 | @@ -109,7 +109,7 @@ static void obexclient_file_transfer_post_init(OBEXClientFileTransfer *self, con | ||
79 | GError *error = NULL; | ||
80 | |||
81 | /* Getting introspection XML */ | ||
82 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
83 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
84 | self->priv->introspection_xml = NULL; | ||
85 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
86 | g_critical("%s", error->message); | ||
87 | @@ -122,7 +122,7 @@ static void obexclient_file_transfer_post_init(OBEXClientFileTransfer *self, con | ||
88 | g_assert(FALSE); | ||
89 | } | ||
90 | g_free(check_intf_regex_str); | ||
91 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE); | ||
92 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE); | ||
93 | } | ||
94 | |||
95 | static void _obexclient_file_transfer_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) | ||
96 | diff --git a/src/lib/obexd/obexclient_file_transfer.h b/src/lib/obexd/obexclient_file_transfer.h | ||
97 | index 5e796b2..750d411 100644 | ||
98 | --- a/src/lib/obexd/obexclient_file_transfer.h | ||
99 | +++ b/src/lib/obexd/obexclient_file_transfer.h | ||
100 | @@ -26,7 +26,7 @@ | ||
101 | |||
102 | #include <glib-object.h> | ||
103 | |||
104 | -#define OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE "org.openobex.FileTransfer" | ||
105 | +#define OBEXCLIENT_FILE_TRANSFER_DBUS_INTERFACE "org.bluez.obex.FileTransfer" | ||
106 | |||
107 | /* | ||
108 | * Type macros | ||
109 | diff --git a/src/lib/obexd/obexclient_session.c b/src/lib/obexd/obexclient_session.c | ||
110 | index a5b52f8..3b882d1 100644 | ||
111 | --- a/src/lib/obexd/obexclient_session.c | ||
112 | +++ b/src/lib/obexd/obexclient_session.c | ||
113 | @@ -133,7 +133,7 @@ static void obexclient_session_post_init(OBEXClientSession *self, const gchar *d | ||
114 | GError *error = NULL; | ||
115 | |||
116 | /* Getting introspection XML */ | ||
117 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
118 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
119 | self->priv->introspection_xml = NULL; | ||
120 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
121 | g_critical("%s", error->message); | ||
122 | @@ -146,7 +146,7 @@ static void obexclient_session_post_init(OBEXClientSession *self, const gchar *d | ||
123 | g_assert(FALSE); | ||
124 | } | ||
125 | g_free(check_intf_regex_str); | ||
126 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_SESSION_DBUS_INTERFACE); | ||
127 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, OBEXCLIENT_SESSION_DBUS_INTERFACE); | ||
128 | |||
129 | /* Properties init */ | ||
130 | GHashTable *properties = obexclient_session_get_properties(self, &error); | ||
131 | diff --git a/src/lib/obexd/obexclient_session.h b/src/lib/obexd/obexclient_session.h | ||
132 | index 87af06d..bffd844 100644 | ||
133 | --- a/src/lib/obexd/obexclient_session.h | ||
134 | +++ b/src/lib/obexd/obexclient_session.h | ||
135 | @@ -26,7 +26,7 @@ | ||
136 | |||
137 | #include <glib-object.h> | ||
138 | |||
139 | -#define OBEXCLIENT_SESSION_DBUS_INTERFACE "org.openobex.Session" | ||
140 | +#define OBEXCLIENT_SESSION_DBUS_INTERFACE "org.bluez.obex.Session" | ||
141 | |||
142 | /* | ||
143 | * Type macros | ||
144 | diff --git a/src/lib/obexd/obexclient_transfer.c b/src/lib/obexd/obexclient_transfer.c | ||
145 | index 68c4bf3..e11e2d4 100644 | ||
146 | --- a/src/lib/obexd/obexclient_transfer.c | ||
147 | +++ b/src/lib/obexd/obexclient_transfer.c | ||
148 | @@ -133,7 +133,7 @@ static void obexclient_transfer_post_init(OBEXClientTransfer *self, const gchar | ||
149 | GError *error = NULL; | ||
150 | |||
151 | /* Getting introspection XML */ | ||
152 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
153 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
154 | self->priv->introspection_xml = NULL; | ||
155 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
156 | g_critical("%s", error->message); | ||
157 | @@ -146,7 +146,7 @@ static void obexclient_transfer_post_init(OBEXClientTransfer *self, const gchar | ||
158 | g_assert(FALSE); | ||
159 | } | ||
160 | g_free(check_intf_regex_str); | ||
161 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex.client", dbus_object_path, OBEXCLIENT_TRANSFER_DBUS_INTERFACE); | ||
162 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex.client", dbus_object_path, OBEXCLIENT_TRANSFER_DBUS_INTERFACE); | ||
163 | |||
164 | /* Properties init */ | ||
165 | GHashTable *properties = obexclient_transfer_get_properties(self, &error); | ||
166 | diff --git a/src/lib/obexd/obexclient_transfer.h b/src/lib/obexd/obexclient_transfer.h | ||
167 | index f84fd69..f92e790 100644 | ||
168 | --- a/src/lib/obexd/obexclient_transfer.h | ||
169 | +++ b/src/lib/obexd/obexclient_transfer.h | ||
170 | @@ -26,7 +26,7 @@ | ||
171 | |||
172 | #include <glib-object.h> | ||
173 | |||
174 | -#define OBEXCLIENT_TRANSFER_DBUS_INTERFACE "org.openobex.Transfer" | ||
175 | +#define OBEXCLIENT_TRANSFER_DBUS_INTERFACE "org.bluez.obex.Transfer" | ||
176 | |||
177 | /* | ||
178 | * Type macros | ||
179 | diff --git a/src/lib/obexd/obexmanager.c b/src/lib/obexd/obexmanager.c | ||
180 | index 1e3e0d4..c77daad 100644 | ||
181 | --- a/src/lib/obexd/obexmanager.c | ||
182 | +++ b/src/lib/obexd/obexmanager.c | ||
183 | @@ -134,7 +134,7 @@ static void obexmanager_init(OBEXManager *self) | ||
184 | GError *error = NULL; | ||
185 | |||
186 | /* Getting introspection XML */ | ||
187 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", OBEXMANAGER_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); | ||
188 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", OBEXMANAGER_DBUS_PATH, "org.freedesktop.DBus.Introspectable"); | ||
189 | self->priv->introspection_xml = NULL; | ||
190 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
191 | g_critical("%s", error->message); | ||
192 | @@ -148,7 +148,7 @@ static void obexmanager_init(OBEXManager *self) | ||
193 | } | ||
194 | g_free(check_intf_regex_str); | ||
195 | |||
196 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", OBEXMANAGER_DBUS_PATH, OBEXMANAGER_DBUS_INTERFACE); | ||
197 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", OBEXMANAGER_DBUS_PATH, OBEXMANAGER_DBUS_INTERFACE); | ||
198 | |||
199 | /* DBus signals connection */ | ||
200 | |||
201 | diff --git a/src/lib/obexd/obexmanager.h b/src/lib/obexd/obexmanager.h | ||
202 | index 203fe59..c0fe168 100644 | ||
203 | --- a/src/lib/obexd/obexmanager.h | ||
204 | +++ b/src/lib/obexd/obexmanager.h | ||
205 | @@ -27,7 +27,7 @@ | ||
206 | #include <glib-object.h> | ||
207 | |||
208 | #define OBEXMANAGER_DBUS_PATH "/" | ||
209 | -#define OBEXMANAGER_DBUS_INTERFACE "org.openobex.Manager" | ||
210 | +#define OBEXMANAGER_DBUS_INTERFACE "org.bluez.obex.Manager" | ||
211 | |||
212 | /* | ||
213 | * Type macros | ||
214 | diff --git a/src/lib/obexd/obexsession.c b/src/lib/obexd/obexsession.c | ||
215 | index 48380cf..49cbeed 100644 | ||
216 | --- a/src/lib/obexd/obexsession.c | ||
217 | +++ b/src/lib/obexd/obexsession.c | ||
218 | @@ -120,7 +120,7 @@ static void obexsession_post_init(OBEXSession *self, const gchar *dbus_object_pa | ||
219 | GError *error = NULL; | ||
220 | |||
221 | /* Getting introspection XML */ | ||
222 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
223 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
224 | self->priv->introspection_xml = NULL; | ||
225 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
226 | g_critical("%s", error->message); | ||
227 | @@ -133,7 +133,7 @@ static void obexsession_post_init(OBEXSession *self, const gchar *dbus_object_pa | ||
228 | g_assert(FALSE); | ||
229 | } | ||
230 | g_free(check_intf_regex_str); | ||
231 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, OBEXSESSION_DBUS_INTERFACE); | ||
232 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, OBEXSESSION_DBUS_INTERFACE); | ||
233 | |||
234 | /* Properties init */ | ||
235 | GHashTable *properties = obexsession_get_properties(self, &error); | ||
236 | diff --git a/src/lib/obexd/obexsession.h b/src/lib/obexd/obexsession.h | ||
237 | index d39e15f..c045859 100644 | ||
238 | --- a/src/lib/obexd/obexsession.h | ||
239 | +++ b/src/lib/obexd/obexsession.h | ||
240 | @@ -26,7 +26,8 @@ | ||
241 | |||
242 | #include <glib-object.h> | ||
243 | |||
244 | -#define OBEXSESSION_DBUS_INTERFACE "org.openobex.Session" | ||
245 | +#define OBEXSESSION_DBUS_INTERFACE "org.bluez.obex.Session" | ||
246 | + | ||
247 | |||
248 | /* | ||
249 | * Type macros | ||
250 | diff --git a/src/lib/obexd/obextransfer.c b/src/lib/obexd/obextransfer.c | ||
251 | index 78dcf52..94c5979 100644 | ||
252 | --- a/src/lib/obexd/obextransfer.c | ||
253 | +++ b/src/lib/obexd/obextransfer.c | ||
254 | @@ -130,7 +130,7 @@ static void obextransfer_post_init(OBEXTransfer *self, const gchar *dbus_object_ | ||
255 | GError *error = NULL; | ||
256 | |||
257 | /* Getting introspection XML */ | ||
258 | - self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
259 | + self->priv->introspection_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, "org.freedesktop.DBus.Introspectable"); | ||
260 | self->priv->introspection_xml = NULL; | ||
261 | if (!dbus_g_proxy_call(self->priv->introspection_g_proxy, "Introspect", &error, G_TYPE_INVALID, G_TYPE_STRING, &self->priv->introspection_xml, G_TYPE_INVALID)) { | ||
262 | g_critical("%s", error->message); | ||
263 | @@ -143,7 +143,7 @@ static void obextransfer_post_init(OBEXTransfer *self, const gchar *dbus_object_ | ||
264 | g_assert(FALSE); | ||
265 | } | ||
266 | g_free(check_intf_regex_str); | ||
267 | - self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.openobex", dbus_object_path, OBEXTRANSFER_DBUS_INTERFACE); | ||
268 | + self->priv->dbus_g_proxy = dbus_g_proxy_new_for_name(session_conn, "org.bluez.obex", dbus_object_path, OBEXTRANSFER_DBUS_INTERFACE); | ||
269 | |||
270 | /* DBus signals connection */ | ||
271 | |||
272 | diff --git a/src/lib/obexd/obextransfer.h b/src/lib/obexd/obextransfer.h | ||
273 | index 99f3084..3ccdcbd 100644 | ||
274 | --- a/src/lib/obexd/obextransfer.h | ||
275 | +++ b/src/lib/obexd/obextransfer.h | ||
276 | @@ -26,7 +26,7 @@ | ||
277 | |||
278 | #include <glib-object.h> | ||
279 | |||
280 | -#define OBEXTRANSFER_DBUS_INTERFACE "org.openobex.Transfer" | ||
281 | +#define OBEXTRANSFER_DBUS_INTERFACE "org.bluez.obex.Transfer" | ||
282 | |||
283 | /* | ||
284 | * Type macros | ||
285 | -- | ||
286 | 1.7.9.5 | ||
287 | |||
diff --git a/patches/0001-compat-wireless-usb-missing-macro.patch b/patches/0001-compat-wireless-usb-missing-macro.patch new file mode 100644 index 0000000..c7f581a --- /dev/null +++ b/patches/0001-compat-wireless-usb-missing-macro.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | --- a/drivers/bluetooth/btusb.c 2012-10-29 17:00:17.000000000 +0200 | ||
2 | +++ b/drivers/bluetooth/btusb.c 2012-10-31 15:32:19.000000000 +0200 | ||
3 | @@ -29,6 +29,27 @@ | ||
4 | |||
5 | #define VERSION "0.6" | ||
6 | |||
7 | +/** | ||
8 | + * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces | ||
9 | + * @vend: the 16 bit USB Vendor ID | ||
10 | + * @cl: bInterfaceClass value | ||
11 | + * @sc: bInterfaceSubClass value | ||
12 | + * @pr: bInterfaceProtocol value | ||
13 | + * | ||
14 | + * This macro is used to create a struct usb_device_id that matches a | ||
15 | + * specific vendor with a specific class of interfaces. | ||
16 | + * | ||
17 | + * This is especially useful when explicitly matching devices that have | ||
18 | + * vendor specific bDeviceClass values, but standards-compliant interfaces. | ||
19 | + */ | ||
20 | +#define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \ | ||
21 | + .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \ | ||
22 | + | USB_DEVICE_ID_MATCH_VENDOR, \ | ||
23 | + .idVendor = (vend), \ | ||
24 | + .bInterfaceClass = (cl), \ | ||
25 | + .bInterfaceSubClass = (sc), \ | ||
26 | + .bInterfaceProtocol = (pr) | ||
27 | + | ||
28 | static bool ignore_dga; | ||
29 | static bool ignore_csr; | ||
30 | static bool ignore_sniffer; | ||
diff --git a/patches/0001-libnl-add-lnl-genl-to-default-configuration.patch b/patches/0001-libnl-add-lnl-genl-to-default-configuration.patch new file mode 100755 index 0000000..30f08ee --- /dev/null +++ b/patches/0001-libnl-add-lnl-genl-to-default-configuration.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From 395c60c2bc00f9f2685d662c006736e2fa562808 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eyal Reizer <eyalr@ti.com> | ||
3 | Date: Mon, 24 Sep 2012 16:39:19 +0300 | ||
4 | Subject: [PATCH] libnl: add lnl-genl to default configuration | ||
5 | |||
6 | Signed-off-by: Eyal Reizer <eyalr@ti.com> | ||
7 | --- | ||
8 | libnl-2.0.pc.in | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/libnl-2.0.pc.in b/libnl-2.0.pc.in | ||
12 | index e44f0fb..0bca566 100644 | ||
13 | --- a/libnl-2.0.pc.in | ||
14 | +++ b/libnl-2.0.pc.in | ||
15 | @@ -6,5 +6,5 @@ includedir=@includedir@ | ||
16 | Name: libnl | ||
17 | Description: Convenience library for netlink sockets | ||
18 | Version: @PACKAGE_VERSION@ | ||
19 | -Libs: -L${libdir} -lnl | ||
20 | +Libs: -L${libdir} -lnl -lnl-genl | ||
21 | Cflags: -I${includedir} | ||
22 | -- | ||
23 | 1.7.9.5 | ||
24 | |||
diff --git a/patches/0001-pygobject-python-includes.patch b/patches/0001-pygobject-python-includes.patch new file mode 100644 index 0000000..ffc07b3 --- /dev/null +++ b/patches/0001-pygobject-python-includes.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | --- a/configure.ac 2009-12-25 19:06:22.000000000 +0200 | ||
2 | +++ b/configure.ac 2012-10-30 16:59:12.000000000 +0200 | ||
3 | @@ -77,10 +77,12 @@ | ||
4 | |||
5 | AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h]) | ||
6 | py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` | ||
7 | -if test -x "$PYTHON-config"; then | ||
8 | -PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` | ||
9 | -else | ||
10 | -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" | ||
11 | +if test -z $PYTHON_INCLUDES; then | ||
12 | + if test -x "$PYTHON-config"; then | ||
13 | + PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` | ||
14 | + else | ||
15 | + PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}" | ||
16 | + fi | ||
17 | fi | ||
18 | old_CPPFLAGS=$CPPFLAGS | ||
19 | CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES" | ||
20 | --- a/m4/python.m4 2009-12-18 11:03:34.000000000 +0200 | ||
21 | +++ b/m4/python.m4 2012-10-30 17:41:19.000000000 +0200 | ||
22 | @@ -45,6 +45,7 @@ | ||
23 | dnl deduce PYTHON_INCLUDES | ||
24 | py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` | ||
25 | py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` | ||
26 | +if test -z "$PYTHON_INCLUDES"; then | ||
27 | if test -x "$PYTHON-config"; then | ||
28 | PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` | ||
29 | else | ||
30 | @@ -53,6 +54,7 @@ | ||
31 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
32 | >fi | ||
33 | fi | ||
34 | +fi | ||
35 | AC_SUBST(PYTHON_INCLUDES) | ||
36 | dnl check if the headers exist: | ||
37 | save_CPPFLAGS="$CPPFLAGS" | ||
38 | @@ -236,6 +238,7 @@ | ||
39 | dnl deduce PYTHON_INCLUDES | ||
40 | py_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` | ||
41 | py_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` | ||
42 | +if test -z "$PYTHON_INCLUDES"; then | ||
43 | if test -x "$PYTHON-config"; then | ||
44 | PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null` | ||
45 | else | ||
46 | @@ -244,6 +247,7 @@ | ||
47 | PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}" | ||
48 | fi | ||
49 | fi | ||
50 | +fi | ||
51 | AC_SUBST(PYTHON_INCLUDES) | ||
52 | dnl check if the headers exist: | ||
53 | save_CPPFLAGS="$CPPFLAGS" | ||
diff --git a/patches/0002-bluez-define-macro-lacking-in-compiler.patch b/patches/0002-bluez-define-macro-lacking-in-compiler.patch new file mode 100644 index 0000000..797fb67 --- /dev/null +++ b/patches/0002-bluez-define-macro-lacking-in-compiler.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 9c87b79edd1e92ba969eb43e7b8dcc1f3bd7c419 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vita Preskovsky <vitap@ti.com> | ||
3 | Date: Tue, 30 Oct 2012 10:12:43 +0200 | ||
4 | Subject: [PATCH] bluez: define macro lacking in compiler | ||
5 | |||
6 | * SO_DOMAIN and SO_PROTOCOL macros are lacking in arago | ||
7 | cross compiler. | ||
8 | |||
9 | |||
10 | Signed-off-by: Vita Preskovsky <vitap@ti.com> | ||
11 | --- | ||
12 | btio/btio.c | 6 ++++++ | ||
13 | 1 file changed, 6 insertions(+) | ||
14 | |||
15 | diff --git a/btio/btio.c b/btio/btio.c | ||
16 | index 9557503..e3b7088 100644 | ||
17 | --- a/btio/btio.c | ||
18 | +++ b/btio/btio.c | ||
19 | @@ -38,6 +38,12 @@ | ||
20 | |||
21 | #include "btio.h" | ||
22 | |||
23 | +#ifndef SO_PROTOCOL | ||
24 | +#define SO_PROTOCOL 38 | ||
25 | +#endif | ||
26 | +#ifndef SO_DOMAIN | ||
27 | +#define SO_DOMAIN 39 | ||
28 | +#endif | ||
29 | #ifndef BT_FLUSHABLE | ||
30 | #define BT_FLUSHABLE 8 | ||
31 | #endif | ||
32 | -- | ||
33 | 1.7.9.5 | ||
34 | |||
diff --git a/patches/0003-socket-enable-for-bluez-4_98.patch b/patches/0003-socket-enable-for-bluez-4_98.patch new file mode 100644 index 0000000..dc61dcd --- /dev/null +++ b/patches/0003-socket-enable-for-bluez-4_98.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | From e142a28897c0b0fe9e61259a96dad6fb9f818ecd Mon Sep 17 00:00:00 2001 | ||
2 | From: Moosa <moosa.baransi@babcomsoftware.com> | ||
3 | Date: Wed, 22 Feb 2012 10:06:37 +0200 | ||
4 | Subject: [PATCH] socket enable for bluez 0_98 | ||
5 | |||
6 | * This is necessary for working with A2DP | ||
7 | --- | ||
8 | audio/audio.conf | 1 + | ||
9 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
10 | |||
11 | diff --git a/audio/audio.conf b/audio/audio.conf | ||
12 | index 302e046..9533ada 100644 | ||
13 | --- a/audio/audio.conf | ||
14 | +++ b/audio/audio.conf | ||
15 | @@ -3,6 +3,7 @@ | ||
16 | # This section contains options which are not specific to any | ||
17 | # particular interface | ||
18 | [General] | ||
19 | +Enable=Socket | ||
20 | |||
21 | # Switch to master role for incoming connections (defaults to true) | ||
22 | #Master=true | ||
23 | -- | ||
24 | 1.7.1 | ||
25 | |||
diff --git a/patches/0004-bluez-enable-source-interface.patch b/patches/0004-bluez-enable-source-interface.patch new file mode 100644 index 0000000..661f60b --- /dev/null +++ b/patches/0004-bluez-enable-source-interface.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 87bcf52a6e9f2ec018bab9dd0da2a2b844b37108 Mon Sep 17 00:00:00 2001 | ||
2 | From: Moosa <moosab@ti.com> | ||
3 | Date: Wed, 14 Mar 2012 16:43:57 +0200 | ||
4 | Subject: [PATCH] bluez: enable source interface | ||
5 | |||
6 | Enable Source interface on D-Bus that can be used to access | ||
7 | the Sink functionality | ||
8 | |||
9 | Upstream-Status: Inappropriate [enable feature] | ||
10 | |||
11 | Signed-off-by: Moosa Baransi <moosab@ti.com> | ||
12 | --- | ||
13 | audio/audio.conf | 2 +- | ||
14 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/audio/audio.conf b/audio/audio.conf | ||
17 | index 9533ada..b554936 100644 | ||
18 | --- a/audio/audio.conf | ||
19 | +++ b/audio/audio.conf | ||
20 | @@ -3,7 +3,7 @@ | ||
21 | # This section contains options which are not specific to any | ||
22 | # particular interface | ||
23 | [General] | ||
24 | -Enable=Socket | ||
25 | +Enable=Socket,Source | ||
26 | |||
27 | # Switch to master role for incoming connections (defaults to true) | ||
28 | #Master=true | ||
29 | -- | ||
30 | 1.7.1 | ||
31 | |||
diff --git a/patches/0005-bluez-enable-gatt.patch b/patches/0005-bluez-enable-gatt.patch new file mode 100755 index 0000000..b58d4c3 --- /dev/null +++ b/patches/0005-bluez-enable-gatt.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | From 49ffdb67be763d92e4c103ebece9dd38605f50cf Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Ganir <chen.ganir@ti.com> | ||
3 | Date: Tue, 30 Oct 2012 10:04:45 +0200 | ||
4 | Subject: [PATCH 2/3] enable gatt | ||
5 | |||
6 | --- | ||
7 | src/main.conf | 2 +- | ||
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/src/main.conf b/src/main.conf | ||
11 | index 787ef4f..dfe4471 100644 | ||
12 | --- a/src/main.conf | ||
13 | +++ b/src/main.conf | ||
14 | @@ -61,4 +61,4 @@ NameResolving = true | ||
15 | DebugKeys = false | ||
16 | |||
17 | # Enable the GATT functionality. Default is false | ||
18 | -EnableGatt = false | ||
19 | +EnableGatt = true | ||
20 | -- | ||
21 | 1.7.9.5 | ||
22 | |||
diff --git a/patches/0006-bluez-fix-missing-include-directive.patch b/patches/0006-bluez-fix-missing-include-directive.patch new file mode 100755 index 0000000..bc7ea39 --- /dev/null +++ b/patches/0006-bluez-fix-missing-include-directive.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From c95a7cfb60e8601a238d4568dc9f20699aa64a70 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Ganir <chen.ganir@ti.com> | ||
3 | Date: Tue, 30 Oct 2012 10:05:08 +0200 | ||
4 | Subject: [PATCH 3/3] fix missing include directive | ||
5 | |||
6 | --- | ||
7 | test/rctest.c | 2 +- | ||
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/test/rctest.c b/test/rctest.c | ||
11 | index ac341b0..4a306b5 100644 | ||
12 | --- a/test/rctest.c | ||
13 | +++ b/test/rctest.c | ||
14 | @@ -38,6 +38,7 @@ | ||
15 | #include <sys/time.h> | ||
16 | #include <sys/ioctl.h> | ||
17 | #include <sys/socket.h> | ||
18 | +#include <sys/stat.h> | ||
19 | |||
20 | #include <bluetooth/bluetooth.h> | ||
21 | #include <bluetooth/hci.h> | ||
22 | @@ -45,7 +46,6 @@ | ||
23 | #include <bluetooth/rfcomm.h> | ||
24 | #include <bluetooth/sdp.h> | ||
25 | #include <bluetooth/sdp_lib.h> | ||
26 | - | ||
27 | /* Test modes */ | ||
28 | enum { | ||
29 | SEND, | ||
30 | -- | ||
31 | 1.7.9.5 | ||
32 | |||
diff --git a/scripts/neard.sh b/scripts/neard.sh new file mode 100755 index 0000000..0029904 --- /dev/null +++ b/scripts/neard.sh | |||
@@ -0,0 +1,26 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | neard=/usr/bin/neard | ||
4 | |||
5 | test -x "$neard" || exit 0 | ||
6 | |||
7 | case "$1" in | ||
8 | start) | ||
9 | echo -n "Starting neard nfc stack" | ||
10 | modprobe nfcwilink | ||
11 | start-stop-daemon --start --quiet --exec $neard & | ||
12 | /usr/share/nfc-demos/enable-adapter nfc0 | ||
13 | echo "." | ||
14 | ;; | ||
15 | stop) | ||
16 | echo -n "Stopping neard nfc stack" | ||
17 | start-stop-daemon --stop --quiet --pidfile /var/run/neard.pid | ||
18 | echo "." | ||
19 | ;; | ||
20 | *) | ||
21 | echo "Usage: /etc/init.d/neard.sh {start|stop}" | ||
22 | exit 1 | ||
23 | esac | ||
24 | |||
25 | exit 0 | ||
26 | |||
diff --git a/scripts/neard.sh~ b/scripts/neard.sh~ new file mode 100755 index 0000000..0029904 --- /dev/null +++ b/scripts/neard.sh~ | |||
@@ -0,0 +1,26 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | neard=/usr/bin/neard | ||
4 | |||
5 | test -x "$neard" || exit 0 | ||
6 | |||
7 | case "$1" in | ||
8 | start) | ||
9 | echo -n "Starting neard nfc stack" | ||
10 | modprobe nfcwilink | ||
11 | start-stop-daemon --start --quiet --exec $neard & | ||
12 | /usr/share/nfc-demos/enable-adapter nfc0 | ||
13 | echo "." | ||
14 | ;; | ||
15 | stop) | ||
16 | echo -n "Stopping neard nfc stack" | ||
17 | start-stop-daemon --stop --quiet --pidfile /var/run/neard.pid | ||
18 | echo "." | ||
19 | ;; | ||
20 | *) | ||
21 | echo "Usage: /etc/init.d/neard.sh {start|stop}" | ||
22 | exit 1 | ||
23 | esac | ||
24 | |||
25 | exit 0 | ||
26 | |||
diff --git a/scripts/nfc-demo-scripts-2012-10-16.tar.gz b/scripts/nfc-demo-scripts-2012-10-16.tar.gz new file mode 100644 index 0000000..3e51aa9 --- /dev/null +++ b/scripts/nfc-demo-scripts-2012-10-16.tar.gz | |||
Binary files differ | |||
diff --git a/scripts/uim-sysfs.sh b/scripts/uim-sysfs.sh new file mode 100755 index 0000000..356f085 --- /dev/null +++ b/scripts/uim-sysfs.sh | |||
@@ -0,0 +1,24 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | uim=/usr/sbin/uim | ||
4 | |||
5 | test -x "$uim" || exit 0 | ||
6 | |||
7 | case "$1" in | ||
8 | start) | ||
9 | echo -n "Starting uim-sysfs daemon" | ||
10 | start-stop-daemon --start --quiet --exec $uim & | ||
11 | echo "." | ||
12 | ;; | ||
13 | stop) | ||
14 | echo -n "Stopping uim-sysfs daemon" | ||
15 | start-stop-daemon --stop --quiet --pidfile /var/run/uim.pid | ||
16 | echo "." | ||
17 | ;; | ||
18 | *) | ||
19 | echo "Usage: /etc/init.d/uim-sysfs.sh {start|stop}" | ||
20 | exit 1 | ||
21 | esac | ||
22 | |||
23 | exit 0 | ||
24 | |||
diff --git a/setup-env.sample b/setup-env.sample index 032b6d5..141fd02 100644 --- a/setup-env.sample +++ b/setup-env.sample | |||
@@ -15,6 +15,7 @@ export PATH="$PATH:<toolchain path>" | |||
15 | export ROOTFS=<path to root filesystem> | 15 | export ROOTFS=<path to root filesystem> |
16 | export WORK_SPACE=<working directory> | 16 | export WORK_SPACE=<working directory> |
17 | export KLIB_BUILD=<linux-kernel> | 17 | export KLIB_BUILD=<linux-kernel> |
18 | export BUILD_VERSION="r8" | ||
18 | # MACHINE_TYPE - The target machine type. Can have one of the following values: "am1808" , "omap3evm" , "am335x" | 19 | # MACHINE_TYPE - The target machine type. Can have one of the following values: "am1808" , "omap3evm" , "am335x" |
19 | # This is needed to build bluetooth components. | 20 | # This is needed to build bluetooth components. |
20 | # This parameter is not relevant for ti814x board. | 21 | # This parameter is not relevant for ti814x board. |
diff --git a/wl12xx_build.sh b/wl12xx_build.sh index 6620593..39000ce 100755 --- a/wl12xx_build.sh +++ b/wl12xx_build.sh | |||
@@ -1,13 +1,6 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | BUILD_VERSION="r5" | 3 | BUILD_VERSION="r5" |
4 | #### R4 | ||
5 | #compat_download_target[r4]="https://gforge.ti.com/gf/download/frsrelease/801/5434/ti-compat-wireless-wl12xx-2012-02-06-r4-12.tgz ti-compat-wireless-wl12xx-2012-02-06-r4-12.tgz http://processors.wiki.ti.com/images/a/aa/Compat-wireless-patches.zip" | ||
6 | #ti_utils_download_target[r4]="git://github.com/TI-ECS/ti-utils.git" | ||
7 | #ti_utils_commit_ids[r4]="aaffc13e6c804291ac7dcefdcec181c0207ff67a" | ||
8 | #hostap_download_target[r4]="git://w1.fi/srv/git/hostap.git" | ||
9 | #hostap_commit_id[r4]="83fa07226debc2f7082b6ccd62dbb1cd47c30472" | ||
10 | #hostap_patches[r4]="http://processors.wiki.ti.com/images/8/8a/Hostapd-wpa-supplicant-patches.zip" | ||
11 | #### R5-SP2 | 4 | #### R5-SP2 |
12 | declare -A compat_download_target["r5"]="https://gforge.ti.com/gf/download/frsrelease/864/5621/ti-compat-wireless-wl12xx-2012-05-17-r5-18.tar.gz http://processors.wiki.ti.com/images/6/6e/Compat-wireless-patches-r5.zip" | 5 | declare -A compat_download_target["r5"]="https://gforge.ti.com/gf/download/frsrelease/864/5621/ti-compat-wireless-wl12xx-2012-05-17-r5-18.tar.gz http://processors.wiki.ti.com/images/6/6e/Compat-wireless-patches-r5.zip" |
13 | 6 | ||
diff --git a/wl18xx_build.sh b/wl18xx_build.sh new file mode 100755 index 0000000..4f1cd12 --- /dev/null +++ b/wl18xx_build.sh | |||
@@ -0,0 +1,1139 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | #### R8-a4.05 | ||
4 | declare -A compat_download_target["r8"]="https://gforge.ti.com/gf/download/frsrelease/973/6259/ti_compat_wireless_wl18xx_R8_A4_05.tar.gz https://gforge.ti.com/gf/download/frsrelease/974/6260/compat-wireless-patches-r8-a4-05.zip" | ||
5 | declare -A ti_utils_download_target["r8"]="git://github.com/TI-OpenLink/18xx-ti-utils.git" | ||
6 | declare -A ti_utils_commit_id["r8"]="ol_r8.a4.05" | ||
7 | declare -A wl18xx_fw_download_target["r8"]="git://github.com/TI-OpenLink/wl18xx_fw.git" | ||
8 | declare -A ti_utils_commit_id["r8"]="ol_r8.a4.05" | ||
9 | declare -A hostap_download_target["r8"]="git://github.com/TI-OpenLink/hostap.git" | ||
10 | declare -A hostap_commit_id["r8"]="ol_r8.a4.05" | ||
11 | declare -A hostap_patches["r8"]="" | ||
12 | declare -A conf_and_scripts["r8"]="https://gforge.ti.com/gf/download/frsrelease/910/5880/ecs-conf-files-and-scripts-2012-08-01.tar.gz" | ||
13 | |||
14 | if [ ! -e setup-env ] | ||
15 | then | ||
16 | echo "No setup-env" | ||
17 | exit 1 | ||
18 | fi | ||
19 | source setup-env | ||
20 | unset PKG_CONFIG_SYSROOT_DIR | ||
21 | ME=$0 | ||
22 | components="libnl openssl iw hostap wpa_supplicant crda ti-utils wl18xx-firmware compat-wireless" | ||
23 | |||
24 | function download () | ||
25 | { | ||
26 | file="$2" | ||
27 | [ -e ${WORK_SPACE}/${file} ] && echo "File $file already exists. Skipping download." && return 0 | ||
28 | wget "$1" | ||
29 | if [ $? -ne 0 ] | ||
30 | then | ||
31 | echo "Failed to download $file" | ||
32 | exit 1 | ||
33 | fi | ||
34 | } | ||
35 | |||
36 | function git_clone () | ||
37 | { | ||
38 | file="$2" | ||
39 | [ -e ${WORK_SPACE}/${file} ] && echo "File $file alread exists. Skipping git clone." && return 0 | ||
40 | git clone "$1" | ||
41 | if [ $? -ne 0 ] | ||
42 | then | ||
43 | echo "Failed to download $2 git repository" | ||
44 | exit 1 | ||
45 | fi | ||
46 | } | ||
47 | function compat-wireless() | ||
48 | { | ||
49 | stage=$1 | ||
50 | |||
51 | if [ x"$stage" = "xdownload" -o x"$stage" = "xall" ] | ||
52 | then | ||
53 | cd ${WORK_SPACE} | ||
54 | for url in ${compat_download_target["$BUILD_VERSION"]} | ||
55 | do | ||
56 | file=`basename $url` | ||
57 | download $url $file | ||
58 | local EXT=${url/*./} | ||
59 | case $EXT in | ||
60 | "gz") | ||
61 | [ ! -d ${WORK_SPACE}/compat-wireless ] && tar xzf $file | ||
62 | ;; | ||
63 | |||
64 | "zip") | ||
65 | if [ ! -e ${WORK_SPACE}/compat-wireless/patches-${BUILD_VERSION}.done ] | ||
66 | then | ||
67 | echo "Applying patches" | ||
68 | cd ${WORK_SPACE}/compat-wireless || exit 1 | ||
69 | mkdir tmp-patches | ||
70 | cd tmp-patches | ||
71 | unzip ${WORK_SPACE}/$file | ||
72 | local -a files=(*.patch) | ||
73 | cd - | ||
74 | for(( i=0; i<${#files[@]}; i++ )) | ||
75 | do | ||
76 | patch -p1 -i tmp-patches/${files[$i]} || exit 1; | ||
77 | done | ||
78 | res=`./scripts/driver-select wl18xx` | ||
79 | touch patches-${BUILD_VERSION}.done | ||
80 | fi | ||
81 | ;; | ||
82 | esac | ||
83 | done | ||
84 | |||
85 | fi | ||
86 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
87 | then | ||
88 | cd ${WORK_SPACE}/compat-wireless | ||
89 | make KLIB_BUILD=${KLIB_BUILD} KLIB=${ROOTFS} || exit 1 | ||
90 | fi | ||
91 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
92 | then | ||
93 | find ${ROOTFS} -name "wl12xx*.ko" | xargs rm -f | ||
94 | find ${ROOTFS} -name "mac80211.ko" | xargs rm -f | ||
95 | find ${ROOTFS} -name "cfg80211.ko" | xargs rm -f | ||
96 | find ${ROOTFS} -name "compat.ko" | xargs rm -f | ||
97 | cd ${WORK_SPACE}/compat-wireless | ||
98 | make KLIB_BUILD=${KLIB_BUILD} KLIB=${ROOTFS} install-modules | ||
99 | fi | ||
100 | |||
101 | if [ x"$stage" = "xclean" ] | ||
102 | then | ||
103 | cd $WORK_SPACE/compat-wireless | ||
104 | #make KLIB=${ROOTFS} uninstall | ||
105 | cd $WORK_SPACE && rm -rf compat-wireless | ||
106 | fi | ||
107 | |||
108 | cd $WORK_SPACE | ||
109 | } | ||
110 | function crda () | ||
111 | { | ||
112 | stage=$1 | ||
113 | if [ x"$stage" = "xdownload" -o x"$stage" = "xall" ] | ||
114 | then | ||
115 | download "http://wireless.kernel.org/download/crda/crda-1.1.1.tar.bz2" "crda-1.1.1.tar.bz2" | ||
116 | download "http://linuxwireless.org/download/wireless-regdb/regulatory.bins/2011.04.28-regulatory.bin" "2011.04.28-regulatory.bin" | ||
117 | tar xjf crda-1.1.1.tar.bz2 | ||
118 | cd ${WORK_SPACE}/crda-1.1.1 | ||
119 | cp ${WORK_SPACE}/2011.04.28-regulatory.bin . | ||
120 | fi | ||
121 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
122 | then | ||
123 | cd ${WORK_SPACE}/crda-1.1.1 | ||
124 | make USE_OPENSSL=1 all_noverify || exit 1 | ||
125 | fi | ||
126 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
127 | then | ||
128 | cd ${WORK_SPACE}/crda-1.1.1 | ||
129 | DESTDIR=${ROOTFS} make USE_OPENSSL=1 UDEV_RULE_DIR="etc/udev/rules.d/" install || exit 1 | ||
130 | mkdir -p ${ROOTFS}/usr/lib/crda | ||
131 | cp 2011.04.28-regulatory.bin ${ROOTFS}/usr/lib/crda/regulatory.bin | ||
132 | fi | ||
133 | if [ x"$stage" = "xclean" ] | ||
134 | then | ||
135 | cd $WORK_SPACE/crda-1.1.1 | ||
136 | DESTDIR=${ROOTFS} make clean | ||
137 | cd $WORK_SPACE && rm -rf crda-1.1.1 | ||
138 | fi | ||
139 | cd $WORK_SPACE | ||
140 | } | ||
141 | |||
142 | function iw () | ||
143 | { | ||
144 | stage=$1 | ||
145 | if [ x"$stage" = "xdownload" -o x"$stage" = "xall" ] | ||
146 | then | ||
147 | git_clone git://git.sipsolutions.net/iw.git iw | ||
148 | cd ${WORK_SPACE}/iw | ||
149 | git reset --hard 0a236ef5f8e4ba7218aac7d0cdacf45673d5b35c || exit 1 | ||
150 | fi | ||
151 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
152 | then | ||
153 | cd ${WORK_SPACE}/iw | ||
154 | make || exit 1 | ||
155 | fi | ||
156 | |||
157 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
158 | then | ||
159 | cd ${WORK_SPACE}/iw | ||
160 | DESTDIR=${ROOTFS} make install || exit 1 | ||
161 | fi | ||
162 | if [ x"$stage" = "xclean" ] | ||
163 | then | ||
164 | cd $WORK_SPACE/iw | ||
165 | make clean | ||
166 | fi | ||
167 | cd $WORK_SPACE | ||
168 | } | ||
169 | function libnl () | ||
170 | { | ||
171 | stage=$1 | ||
172 | if [ x"$stage" = x"download" -o x"$stage" = "xall" ] | ||
173 | then | ||
174 | download http://www.infradead.org/~tgr/libnl/files/libnl-2.0.tar.gz libnl-2.0.tar.gz | ||
175 | tar xzf libnl-2.0.tar.gz | ||
176 | cd ${WORK_SPACE}/libnl-2.0 | ||
177 | ./configure --prefix=${ROOTFS} CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld RANLIB=${CROSS_COMPILE}ranlib --host=arm-linux | ||
178 | if [ $? != 0 ] | ||
179 | then | ||
180 | echo "libnl failed to be configured" | ||
181 | exit 1 | ||
182 | fi | ||
183 | fi | ||
184 | |||
185 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
186 | then | ||
187 | cd ${WORK_SPACE}/libnl-2.0 | ||
188 | make || exit 1 | ||
189 | fi | ||
190 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
191 | then | ||
192 | cd ${WORK_SPACE}/libnl-2.0 | ||
193 | make install || exit 1 | ||
194 | fi | ||
195 | if [ x"$stage" = "xclean" ] | ||
196 | then | ||
197 | cd $WORK_SPACE/libnl-2.0 | ||
198 | make uninstall | ||
199 | cd .. && rm -rf libnl-2.0 | ||
200 | fi | ||
201 | cd $WORK_SPACE | ||
202 | |||
203 | } | ||
204 | function openssl () | ||
205 | { | ||
206 | stage=$1 | ||
207 | if [ x"$stage" = x"download" -o x"$stage" = "xall" ] | ||
208 | then | ||
209 | cd ${WORK_SPACE} | ||
210 | download "http://www.openssl.org/source/openssl-1.0.0d.tar.gz" "openssl-1.0.0d.tar.gz" | ||
211 | tar xzf openssl-1.0.0d.tar.gz | ||
212 | download http://processors.wiki.ti.com/images/e/ee/Openssl-1.0.0d-new-compilation-target-for-configure.zip Openssl-1.0.0d-new-compilation-target-for-configure.zip | ||
213 | cd ${WORK_SPACE}/openssl-1.0.0d | ||
214 | unzip ${WORK_SPACE}/Openssl-1.0.0d-new-compilation-target-for-configure.zip || exit 1 | ||
215 | patch -p1 -i 0001-openssl-1.0.0d-new-target-os-for-configure.patch || exit 1 | ||
216 | CROSS_COMPILE= perl ./Configure shared --prefix=$ROOTFS/usr --openssldir=$ROOTFS/usr/lib/ssl linux-elf-arm | ||
217 | fi || exit 1 | ||
218 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
219 | then | ||
220 | cd ${WORK_SPACE}/openssl-1.0.0d | ||
221 | make || exit 1 | ||
222 | fi | ||
223 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
224 | then | ||
225 | cd ${WORK_SPACE}/openssl-1.0.0d | ||
226 | make install_sw || exit 1 | ||
227 | fi | ||
228 | if [ x"$stage" = "xclean" ] | ||
229 | then | ||
230 | cd ${WORK_SPACE}/openssl-1.0.0d | ||
231 | rm -f ${ROOTFS}/usr/lib/*ssl* ${ROOTFS}/usr/lib/pkgconfig/*ssl* | ||
232 | cd .. && rm -rf openssl-1.0.0d | ||
233 | fi | ||
234 | cd $WORK_SPACE | ||
235 | } | ||
236 | function ti-utils () | ||
237 | { | ||
238 | stage=$1 | ||
239 | |||
240 | if [ x"$stage" = x"download" -o x"$stage" = "xall" ] | ||
241 | then | ||
242 | git_clone "${ti_utils_download_target[$BUILD_VERSION]}" 18xx-ti-utils | ||
243 | cd ${WORK_SPACE}/18xx-ti-utils | ||
244 | git reset --hard "${ti_utils_commit_id[$BUILD_VERSION]}" | ||
245 | fi | ||
246 | |||
247 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
248 | then | ||
249 | cd ${WORK_SPACE}/18xx-ti-utils | ||
250 | NFSROOT=${ROOTFS} make || exit 1 | ||
251 | fi | ||
252 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
253 | then | ||
254 | cd ${WORK_SPACE}/18xx-ti-utils | ||
255 | #NFSROOT=${ROOTFS} make install || exit 1 | ||
256 | if [ ! -x calibrator ] | ||
257 | then | ||
258 | echo "calibrator is not built, run 'make' first" | ||
259 | exit 1 | ||
260 | fi | ||
261 | cp -f ./calibrator ${ROOTFS}/usr/bin | ||
262 | chmod 755 ${ROOTFS}/usr/bin/calibrator | ||
263 | fi | ||
264 | if [ x"$stage" = "xclean" ] | ||
265 | then | ||
266 | cd ${WORK_SPACE}/18xx-ti-utils | ||
267 | NFSROOT=${ROOTFS} make clean | ||
268 | rm -f ${ROOTFS}/usr/bin/calibrator | ||
269 | cd ${WORK_SPACE}/18xx-ti-utils/wlconf | ||
270 | NFSROOT=${ROOTFS} make clean | ||
271 | rm -fr ${ROOTFS}/usr/sbin/wlconf | ||
272 | rm -fr ${ROOTFS}/home/root/scripts/wlconf/ | ||
273 | fi | ||
274 | cd $WORK_SPACE | ||
275 | } | ||
276 | |||
277 | function wl18xx-firmware() | ||
278 | { | ||
279 | stage=$1 | ||
280 | |||
281 | if [ x"$stage" = x"download" -o x"$stage" = "xall" ] | ||
282 | then | ||
283 | git_clone "${wl18xx_fw_download_target[$BUILD_VERSION]}" wl18xx_fw | ||
284 | cd ${WORK_SPACE}/wl18xx_fw | ||
285 | git reset --hard "${ti_utils_commit_id[$BUILD_VERSION]}" | ||
286 | fi | ||
287 | |||
288 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
289 | then | ||
290 | mkdir -p $ROOTFS/lib/firmware/ti-connectivity | ||
291 | case ${BUILD_VERSION} in | ||
292 | "r8") | ||
293 | cp ${WORK_SPACE}/wl18xx_fw/*.bin $ROOTFS/lib/firmware/ti-connectivity | ||
294 | ;; | ||
295 | esac | ||
296 | |||
297 | fi | ||
298 | if [ x"$stage" = "xclean" ] | ||
299 | then | ||
300 | rm -rf $ROOTFS/lib/firmware/ti-connectivity | ||
301 | fi | ||
302 | cd $WORK_SPACE | ||
303 | } | ||
304 | |||
305 | function hostap_patching () | ||
306 | { | ||
307 | local patch_dir | ||
308 | local filename=`basename ${hostap_patches[$BUILD_VERSION]}` | ||
309 | |||
310 | case ${BUILD_VERSION} in | ||
311 | "r8") | ||
312 | return | ||
313 | #patch_dir=patches-r5 | ||
314 | ;; | ||
315 | esac | ||
316 | [ -e ${WORK_SPACE}/hostap/$patch_dir/${patch_dir}.done ] && return | ||
317 | download "${hostap_patches[$BUILD_VERSION]}" "${filename}" | ||
318 | mkdir $patch_dir | ||
319 | cd $patch_dir && unzip ../$filename && cd - | ||
320 | local files=($patch_dir/*.patch) | ||
321 | for (( i=0; i<${#files[@]};i++)) | ||
322 | do | ||
323 | patch -p1 -i "${files[$i]}" | ||
324 | if [ $? -ne 0 ] | ||
325 | then | ||
326 | echo "Patch $patch_dir/$i failed. Exiting..." | ||
327 | exit 1 | ||
328 | fi | ||
329 | done | ||
330 | touch $patch_dir/$patch_dir.done | ||
331 | } | ||
332 | function make_hostapd_defconfig () | ||
333 | { | ||
334 | cat > .config <<"hostapd_defconfig" | ||
335 | # Example hostapd build time configuration | ||
336 | # | ||
337 | # This file lists the configuration options that are used when building the | ||
338 | # hostapd binary. All lines starting with # are ignored. Configuration option | ||
339 | # lines must be commented out complete, if they are not to be included, i.e., | ||
340 | # just setting VARIABLE=n is not disabling that variable. | ||
341 | # | ||
342 | # This file is included in Makefile, so variables like CFLAGS and LIBS can also | ||
343 | # be modified from here. In most cass, these lines should use += in order not | ||
344 | # to override previous values of the variables. | ||
345 | |||
346 | DESTDIR=$(ROOTFS) | ||
347 | # Driver interface for Host AP driver | ||
348 | CONFIG_DRIVER_HOSTAP=y | ||
349 | |||
350 | # Driver interface for wired authenticator | ||
351 | #CONFIG_DRIVER_WIRED=y | ||
352 | |||
353 | # Driver interface for drivers using the nl80211 kernel interface | ||
354 | CONFIG_DRIVER_NL80211=y | ||
355 | CONFIG_LIBNL20=y | ||
356 | # driver_nl80211.c requires a rather new libnl (version 1.1) which may not be | ||
357 | # shipped with your distribution yet. If that is the case, you need to build | ||
358 | # newer libnl version and point the hostapd build to use it. | ||
359 | #LIBNL=/usr/src/libnl | ||
360 | #CFLAGS += -I$(LIBNL)/include | ||
361 | #LIBS += -L$(LIBNL)/lib | ||
362 | |||
363 | # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) | ||
364 | #CONFIG_DRIVER_BSD=y | ||
365 | #CFLAGS += -I/usr/local/include | ||
366 | #LIBS += -L/usr/local/lib | ||
367 | #LIBS_p += -L/usr/local/lib | ||
368 | #LIBS_c += -L/usr/local/lib | ||
369 | |||
370 | # Driver interface for no driver (e.g., RADIUS server only) | ||
371 | #CONFIG_DRIVER_NONE=y | ||
372 | |||
373 | # IEEE 802.11F/IAPP | ||
374 | CONFIG_IAPP=y | ||
375 | |||
376 | # WPA2/IEEE 802.11i RSN pre-authentication | ||
377 | CONFIG_RSN_PREAUTH=y | ||
378 | |||
379 | # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) | ||
380 | CONFIG_PEERKEY=y | ||
381 | |||
382 | # IEEE 802.11w (management frame protection) | ||
383 | # This version is an experimental implementation based on IEEE 802.11w/D1.0 | ||
384 | # draft and is subject to change since the standard has not yet been finalized. | ||
385 | # Driver support is also needed for IEEE 802.11w. | ||
386 | #CONFIG_IEEE80211W=y | ||
387 | |||
388 | # Integrated EAP server | ||
389 | CONFIG_EAP=y | ||
390 | |||
391 | # EAP-MD5 for the integrated EAP server | ||
392 | CONFIG_EAP_MD5=y | ||
393 | |||
394 | # EAP-TLS for the integrated EAP server | ||
395 | CONFIG_EAP_TLS=y | ||
396 | |||
397 | # EAP-MSCHAPv2 for the integrated EAP server | ||
398 | CONFIG_EAP_MSCHAPV2=y | ||
399 | |||
400 | # EAP-PEAP for the integrated EAP server | ||
401 | CONFIG_EAP_PEAP=y | ||
402 | |||
403 | # EAP-GTC for the integrated EAP server | ||
404 | CONFIG_EAP_GTC=y | ||
405 | |||
406 | # EAP-TTLS for the integrated EAP server | ||
407 | CONFIG_EAP_TTLS=y | ||
408 | |||
409 | # EAP-SIM for the integrated EAP server | ||
410 | #CONFIG_EAP_SIM=y | ||
411 | |||
412 | # EAP-AKA for the integrated EAP server | ||
413 | #CONFIG_EAP_AKA=y | ||
414 | |||
415 | # EAP-AKA' for the integrated EAP server | ||
416 | # This requires CONFIG_EAP_AKA to be enabled, too. | ||
417 | #CONFIG_EAP_AKA_PRIME=y | ||
418 | |||
419 | # EAP-PAX for the integrated EAP server | ||
420 | #CONFIG_EAP_PAX=y | ||
421 | |||
422 | # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) | ||
423 | #CONFIG_EAP_PSK=y | ||
424 | |||
425 | # EAP-SAKE for the integrated EAP server | ||
426 | #CONFIG_EAP_SAKE=y | ||
427 | |||
428 | # EAP-GPSK for the integrated EAP server | ||
429 | #CONFIG_EAP_GPSK=y | ||
430 | # Include support for optional SHA256 cipher suite in EAP-GPSK | ||
431 | #CONFIG_EAP_GPSK_SHA256=y | ||
432 | |||
433 | # EAP-FAST for the integrated EAP server | ||
434 | # Note: Default OpenSSL package does not include support for all the | ||
435 | # functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, | ||
436 | # the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) | ||
437 | # to add the needed functions. | ||
438 | #CONFIG_EAP_FAST=y | ||
439 | |||
440 | # Wi-Fi Protected Setup (WPS) | ||
441 | CONFIG_WPS=y | ||
442 | # Enable WSC 2.0 support | ||
443 | CONFIG_WPS2=y | ||
444 | # Enable UPnP support for external WPS Registrars | ||
445 | CONFIG_WPS_UPNP=y | ||
446 | |||
447 | # EAP-IKEv2 | ||
448 | #CONFIG_EAP_IKEV2=y | ||
449 | |||
450 | # Trusted Network Connect (EAP-TNC) | ||
451 | #CONFIG_EAP_TNC=y | ||
452 | |||
453 | # PKCS#12 (PFX) support (used to read private key and certificate file from | ||
454 | # a file that usually has extension .p12 or .pfx) | ||
455 | CONFIG_PKCS12=y | ||
456 | |||
457 | # RADIUS authentication server. This provides access to the integrated EAP | ||
458 | # server from external hosts using RADIUS. | ||
459 | #CONFIG_RADIUS_SERVER=y | ||
460 | |||
461 | # Build IPv6 support for RADIUS operations | ||
462 | CONFIG_IPV6=y | ||
463 | |||
464 | # IEEE Std 802.11r-2008 (Fast BSS Transition) | ||
465 | #CONFIG_IEEE80211R=y | ||
466 | |||
467 | # Use the hostapd's IEEE 802.11 authentication (ACL), but without | ||
468 | # the IEEE 802.11 Management capability (e.g., madwifi or FreeBSD/net80211) | ||
469 | #CONFIG_DRIVER_RADIUS_ACL=y | ||
470 | |||
471 | # IEEE 802.11n (High Throughput) support | ||
472 | CONFIG_IEEE80211N=y | ||
473 | |||
474 | # Remove debugging code that is printing out debug messages to stdout. | ||
475 | # This can be used to reduce the size of the hostapd considerably if debugging | ||
476 | # code is not needed. | ||
477 | #CONFIG_NO_STDOUT_DEBUG=y | ||
478 | |||
479 | # Remove support for RADIUS accounting | ||
480 | #CONFIG_NO_ACCOUNTING=y | ||
481 | |||
482 | # Remove support for RADIUS | ||
483 | #CONFIG_NO_RADIUS=y | ||
484 | |||
485 | # Remove support for VLANs | ||
486 | #CONFIG_NO_VLAN=y | ||
487 | |||
488 | # Remove support for dumping state into a file on SIGUSR1 signal | ||
489 | # This can be used to reduce binary size at the cost of disabling a debugging | ||
490 | # option. | ||
491 | #CONFIG_NO_DUMP_STATE=y | ||
492 | |||
493 | CONFIG_NO_RANDOM_POOL=y | ||
494 | LIBNL=$(ROOTFS) | ||
495 | CFLAGS += -I$(LIBNL)/include -I$(ROOTFS)/usr/include/ | ||
496 | LIBS += -L$(LIBNL)/lib -L$(LIBNL)/lib -L$(ROOTFS)/usr/lib -lssl -lcrypto -ldl | ||
497 | LIBS_p += -L$(LIBNL)/lib -L$(LIBNL)/lib -L$(ROOTFS)/usr/lib -lssl -lcrypto -ldl | ||
498 | hostapd_defconfig | ||
499 | } | ||
500 | |||
501 | function hostap() | ||
502 | { | ||
503 | stage=$1 | ||
504 | if [ x"$stage" = x"download" -o x"$stage" = "xall" ] | ||
505 | then | ||
506 | cd ${WORK_SPACE} | ||
507 | git_clone "${hostap_download_target[$BUILD_VERSION]}" hostap | ||
508 | cd ${WORK_SPACE}/hostap | ||
509 | git reset --hard "${hostap_commit_id[$BUILD_VERSION]}" | ||
510 | hostap_patching | ||
511 | fi | ||
512 | if [ x"$stage" = "xbuild" -o x"$stage" = "xall" ] | ||
513 | then | ||
514 | cd ${WORK_SPACE}/hostap/hostapd | ||
515 | make_hostapd_defconfig | ||
516 | make clean || exit 1 | ||
517 | make || exit 1 | ||
518 | fi | ||
519 | if [ x"$stage" = "xinstall" -o x"$stage" = "xall" ] | ||
520 | then | ||
521 | cd ${WORK_SPACE}/hostap/hostapd | ||
522 | make install || exit 1 | ||
523 | for i in hostapd hostapd_cli; do cp -f $i ${ROOTFS}/usr/sbin/$i || exit 1; done | ||
524 | cp hostapd.conf ${ROOTFS}/etc/ | ||
525 | fi | ||
526 | if [ x"$stage" = "xclean" ] | ||
527 | then | ||
528 | cd ${WORK_SPACE}/hostap/hostapd | ||
529 | make clean | ||
530 | cd ../wpa_supplicant | ||
531 | make clean | ||
532 | fi | ||
533 | cd $WORK_SPACE | ||
534 | |||
535 | } | ||
536 | function make_wpa_sup_defconfig () | ||
537 | { | ||
538 | cat > .config <<"wpa_sup_defconfig" | ||
539 | # Example wpa_supplicant build time configuration | ||
540 | DESTDIR=$(ROOTFS) | ||
541 | CFLAGS += -I$(ROOTFS)/usr/include/ | ||
542 | LIBS += -L$(ROOTFS)/usr/lib | ||
543 | LIBS_p += -L$(ROOTFS)/usr/lib | ||
544 | CONFIG_WAPI=y | ||
545 | CONFIG_LIBNL20=y | ||
546 | NEED_BGSCAN=y | ||
547 | CONFIG_BGSCAN_LEARN=y | ||
548 | # Driver interface for generic Linux wireless extensions | ||
549 | CONFIG_DRIVER_WEXT=y | ||
550 | # Driver interface for Linux drivers using the nl80211 kernel interface | ||
551 | CONFIG_DRIVER_NL80211=y | ||
552 | # Driver interface for wired Ethernet drivers | ||
553 | CONFIG_DRIVER_WIRED=y | ||
554 | # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is | ||
555 | # included) | ||
556 | CONFIG_IEEE8021X_EAPOL=y | ||
557 | # EAP-MD5 | ||
558 | CONFIG_EAP_MD5=y | ||
559 | # EAP-MSCHAPv2 | ||
560 | CONFIG_EAP_MSCHAPV2=y | ||
561 | # EAP-TLS | ||
562 | CONFIG_EAP_TLS=y | ||
563 | # EAL-PEAP | ||
564 | CONFIG_EAP_PEAP=y | ||
565 | # EAP-TTLS | ||
566 | CONFIG_EAP_TTLS=y | ||
567 | # EAP-GTC | ||
568 | CONFIG_EAP_GTC=y | ||
569 | # EAP-OTP | ||
570 | CONFIG_EAP_OTP=y | ||
571 | # LEAP | ||
572 | CONFIG_EAP_LEAP=y | ||
573 | # Wi-Fi Protected Setup (WPS) | ||
574 | CONFIG_WPS=y | ||
575 | # Enable WSC 2.0 support | ||
576 | CONFIG_WPS2=y | ||
577 | # PKCS#12 (PFX) support (used to read private key and certificate file from | ||
578 | # a file that usually has extension .p12 or .pfx) | ||
579 | CONFIG_PKCS12=y | ||
580 | # Smartcard support (i.e., private key on a smartcard), e.g., with openssl | ||
581 | # engine. | ||
582 | CONFIG_SMARTCARD=y | ||
583 | # Select control interface backend for external programs, e.g, wpa_cli: | ||
584 | # unix = UNIX domain sockets (default for Linux/*BSD) | ||
585 | # udp = UDP sockets using localhost (127.0.0.1) | ||
586 | # named_pipe = Windows Named Pipe (default for Windows) | ||
587 | # y = use default (backwards compatibility) | ||
588 | # If this option is commented out, control interface is not included in the | ||
589 | # build. | ||
590 | CONFIG_CTRL_IFACE=y | ||
591 | # Select configuration backend: | ||
592 | # file = text file (e.g., wpa_supplicant.conf; note: the configuration file | ||
593 | # path is given on command line, not here; this option is just used to | ||
594 | # select the backend that allows configuration files to be used) | ||
595 | # winreg = Windows registry (see win_example.reg for an example) | ||
596 | CONFIG_BACKEND=file | ||
597 | # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) | ||
598 | CONFIG_PEERKEY=y | ||
599 | # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) | ||
600 | CONFIG_DEBUG_FILE=y | ||
601 | LIBNL=$(ROOTFS) | ||
602 | CFLAGS += -I$(LIBNL)/include | ||
603 | LIBS += -L$(LIBNL)/lib -lssl -lcrypto -ldl | ||
604 | LIBS_p += -L$(LIBNL)/lib -lssl -lcrypto -ldl | ||
605 | # for p2p | ||
606 | CONFIG_P2P=y | ||
607 | CONFIG_AP=y | ||
608 | wpa_sup_defconfig | ||
609 | } | ||
610 | function wpa_supplicant () | ||
611 | { | ||
612 | stage=$1 | ||
613 | if [ x"$stage" = x"build" -o x"$stage" = "xall" ] | ||
614 | then | ||
615 | cd ${WORK_SPACE}/hostap/wpa_supplicant | ||
616 | make clean | ||
617 | make_wpa_sup_defconfig | ||
618 | make || exit 1 | ||
619 | fi | ||
620 | if [ x"$stage" = x"install" -o x"$stage" = "xall" ] | ||
621 | then | ||
622 | cd ${WORK_SPACE}/hostap/wpa_supplicant | ||
623 | make install || exit 1 | ||
624 | for i in wpa_supplicant wpa_cli wpa_passphrase; do cp $i ${ROOTFS}/usr/sbin//$i || exit 1; done | ||
625 | cp wpa_supplicant.conf ${ROOTFS}/etc/ | ||
626 | fi | ||
627 | cd $WORK_SPACE | ||
628 | } | ||
629 | |||
630 | function ecs_tools() | ||
631 | { | ||
632 | stage=$1 | ||
633 | |||
634 | if [ x"$stage" = x"download" -o x"$stage" = "xall" ] | ||
635 | then | ||
636 | if [ ! -d ${WORK_SPACE}/conf_and_scripts ] | ||
637 | then | ||
638 | echo "Downloading scripts and configuration files" | ||
639 | cd ${WORK_SPACE} | ||
640 | mkdir -p ${WORK_SPACE}/conf_and_scripts | ||
641 | file=`basename ${conf_and_scripts["$BUILD_VERSION"]}` | ||
642 | download ${conf_and_scripts["$BUILD_VERSION"]} $file | ||
643 | cd ${WORK_SPACE}/conf_and_scripts | ||
644 | tar xzf ${WORK_SPACE}/${file} | ||
645 | cd ${WORK_SPACE} | ||
646 | fi | ||
647 | fi | ||
648 | cd $WORK_SPACE | ||
649 | } | ||
650 | |||
651 | function wlconf () | ||
652 | { | ||
653 | stage=$1 | ||
654 | if [ x"$stage" = x"build" -o x"$stage" = "xall" ] | ||
655 | then | ||
656 | cd ${WORK_SPACE}/18xx-ti-utils/wlconf | ||
657 | NFSROOT=${ROOTFS} make || exit 1 | ||
658 | fi | ||
659 | if [ x"$stage" = x"install" -o x"$stage" = "xall" ] | ||
660 | then | ||
661 | cd ${WORK_SPACE}/18xx-ti-utils/wlconf | ||
662 | if [ ! -x wlconf ] | ||
663 | then | ||
664 | echo "wlconf is not built, run 'make' first" | ||
665 | exit 1 | ||
666 | fi | ||
667 | mkdir -p ${ROOTFS}/usr/sbin/wlconf | ||
668 | mkdir -p ${ROOTFS}/usr/sbin/wlconf/official_inis | ||
669 | cp -f ./wlconf ${ROOTFS}/usr/sbin/wlconf | ||
670 | chmod 755 ${ROOTFS}/usr/sbin/wlconf | ||
671 | for i in dictionary.txt struct.bin wl18xx-conf-default.bin README example.conf example.ini; do cp $i ${ROOTFS}/usr/sbin/wlconf/$i || exit 1; done | ||
672 | cp official_inis/* ${ROOTFS}/usr/sbin/wlconf/official_inis | ||
673 | mkdir -p ${ROOTFS}/home/root/scripts/wlconf | ||
674 | ecs_tools "download" | ||
675 | cp ${WORK_SPACE}/conf_and_scripts/scripts/wlconf/* ${ROOTFS}/home/root/scripts/wlconf | ||
676 | chmod 755 ${ROOTFS}/home/root/scripts/wlconf/* | ||
677 | fi | ||
678 | cd $WORK_SPACE | ||
679 | } | ||
680 | |||
681 | function usage () | ||
682 | { | ||
683 | echo "This script compiles one of following utilities: libnl, openssl, hostapd, wpa_supplicant,wl18xx_modules,firmware,crda,calibrator" | ||
684 | echo "by calling specific utility name and action." | ||
685 | echo "In case the options is 'all' all utilities will be downloaded and installed on root file system." | ||
686 | echo "File setup-env contains all required environment variables, for example:" | ||
687 | echo " ROOTFS=<path to target root file system>." | ||
688 | echo "Part of operations requires root access." | ||
689 | echo "Usage: `basename $ME` target <libnl" | ||
690 | echo " openssl" | ||
691 | echo " hostapd" | ||
692 | echo " wpa_supplicant" | ||
693 | echo " wl18xx_modules" | ||
694 | echo " firmware" | ||
695 | echo " crda" | ||
696 | echo " wlconf" | ||
697 | echo " calibrator> action <download|build|install>" | ||
698 | echo " all" | ||
699 | echo " clean-all" | ||
700 | } | ||
701 | |||
702 | function check_libs() | ||
703 | { | ||
704 | local openssl=`pkg-config --exists openssl` | ||
705 | local libnl=`pkg-config --exists libnl-2.0` | ||
706 | package=$1 | ||
707 | |||
708 | if [ $openssl -ne 0 -o $libnl -ne 0 ] | ||
709 | then | ||
710 | echo "Cannot build $1: openssl and libnl should be installed first." | ||
711 | exit 1 | ||
712 | fi | ||
713 | } | ||
714 | function package_dir_exists() | ||
715 | { | ||
716 | if [ -d "$1" ] | ||
717 | then | ||
718 | echo "Package $2 already downloaded at: $1" | ||
719 | return 1 | ||
720 | fi | ||
721 | return 0 | ||
722 | } | ||
723 | function check_env() | ||
724 | { | ||
725 | [ -e ${WORK_SPACE}/.check_env.stamp ] && return 0 | ||
726 | which dpkg 2>&1>/dev/null || return 0 | ||
727 | err=0 | ||
728 | ret=0 | ||
729 | packages="python python-m2crypto bash bison flex perl bc corkscrew" | ||
730 | for p in ${packages} | ||
731 | do | ||
732 | echo -n "Checking ${p}..." | ||
733 | present=`dpkg --get-selections ${p} 2>/dev/null | awk '{print $1}'` | ||
734 | [ x"${present}" != x"${p}" ] && echo "Package ${p} is not found. Please run 'apt-get install ${p}' to install it." && err=1 && ret=1 | ||
735 | [ ${err} -ne 1 ] && echo "OK" | ||
736 | err=0 | ||
737 | done | ||
738 | return ${ret} | ||
739 | } | ||
740 | ############################# MAIN ############################################## | ||
741 | # First building environment should be checked | ||
742 | check_env || exit 1 | ||
743 | if [ -z $CROSS_COMPILE ] | ||
744 | then | ||
745 | #lets find some | ||
746 | tool_path=`which arm-none-linux-gnueabi-gcc` | ||
747 | if [ $? -ne 0 ] | ||
748 | then | ||
749 | echo "No tool chain is found" | ||
750 | exit 1 | ||
751 | fi | ||
752 | export CROSS_COMPILE=`dirname $tool_path`/arm-none-linux-gnueabi- | ||
753 | fi | ||
754 | |||
755 | if [ -z $KLIB_BUILD ] | ||
756 | then | ||
757 | echo "Path to kernel sources has to be defined" | ||
758 | exit 1 | ||
759 | fi | ||
760 | |||
761 | if [ -z $ROOTFS ] | ||
762 | then | ||
763 | echo "No path to root file system" | ||
764 | exit 1 | ||
765 | fi | ||
766 | argc=$# | ||
767 | if [ $argc -lt 1 ] | ||
768 | then | ||
769 | usage | ||
770 | exit 1 | ||
771 | elif [ $argc -eq 1 ] | ||
772 | then | ||
773 | if [ x"$1" != x"all" -a x"$1" != x"clean-all" ] | ||
774 | then | ||
775 | usage | ||
776 | exit 1 | ||
777 | else | ||
778 | package="$1" | ||
779 | fi | ||
780 | fi | ||
781 | |||
782 | if [ $argc -eq 2 ] | ||
783 | then | ||
784 | package=$1 | ||
785 | stage=$2 | ||
786 | fi | ||
787 | if [ ! -d $WORK_SPACE ] | ||
788 | then | ||
789 | mkdir -p $WORK_SPACE | ||
790 | touch ${WORK_SPACE}/.check_env.stamp | ||
791 | fi | ||
792 | cd ${WORK_SPACE} | ||
793 | |||
794 | case $package in | ||
795 | libnl) | ||
796 | case $stage in | ||
797 | download ) | ||
798 | package_dir_exists ${WORK_SPACE}/libnl-2.0 libnl-2 && libnl "download" | ||
799 | ;; | ||
800 | build) | ||
801 | package_dir_exists ${WORK_SPACE}/libnl-2.0 libnl-2 | ||
802 | if [ ! $? ] | ||
803 | then | ||
804 | libnl "download" | ||
805 | fi | ||
806 | cd ${WORK_SPACE}/libnl-2.0 | ||
807 | libnl "build" | ||
808 | ;; | ||
809 | install) | ||
810 | package_dir_exists ${WORK_SPACE}/libnl-2.0 libnl-2 | ||
811 | if [ ! $? ] | ||
812 | then | ||
813 | libnl "all" && exit | ||
814 | else | ||
815 | cd ${WORK_SPACE}/libnl-2.0 | ||
816 | libnl "install" | ||
817 | fi | ||
818 | ;; | ||
819 | all) | ||
820 | package_dir_exists ${WORK_SPACE}/libnl-2.0 libnl-2 || rm -rf libnl-2.0 | ||
821 | libnl "all" | ||
822 | ;; | ||
823 | *) | ||
824 | echo "Error: illegal action for libnl" | ||
825 | exit 1 | ||
826 | esac | ||
827 | ;; | ||
828 | openssl) | ||
829 | case $stage in | ||
830 | download ) | ||
831 | package_dir_exists ${WORK_SPACE}/openssl-1.0.0d openssl || exit 1 | ||
832 | openssl "download" | ||
833 | ;; | ||
834 | build) | ||
835 | package_dir_exists ${WORK_SPACE}/openssl-1.0.0d openssl | ||
836 | if [ ! $? ] | ||
837 | then | ||
838 | openssl "download" | ||
839 | fi | ||
840 | cd ${WORK_SPACE}/openssl-1.0.0d | ||
841 | openssl "build" | ||
842 | ;; | ||
843 | install) | ||
844 | package_dir_exists ${WORK_SPACE}/openssl-1.0.0d openssl | ||
845 | test [ ! $? ] && openssl "all" && exit 0 | ||
846 | cd ${WORK_SPACE}/openssl-1.0.0d | ||
847 | openssl "install" | ||
848 | ;; | ||
849 | all) | ||
850 | package_dir_exists ${WORK_SPACE}/openssl-1.0.0d openssl || rm -rf openssl-1.0.0d | ||
851 | openssl "all" | ||
852 | ;; | ||
853 | esac | ||
854 | ;; | ||
855 | iw) | ||
856 | case $stage in | ||
857 | download ) | ||
858 | package_dir_exists ${WORK_SPACE}/iw iw || exit 1 | ||
859 | iw "download" | ||
860 | ;; | ||
861 | build) | ||
862 | package_dir_exists ${WORK_SPACE}/iw iw | ||
863 | [ ! $? ] && iw "download" | ||
864 | check_libs iw | ||
865 | iw "build" | ||
866 | ;; | ||
867 | install) | ||
868 | package_dir_exists ${WORK_SPACE}/iw iw | ||
869 | [ ! $? ] && iw "donwload" | ||
870 | [ ! -x ${WORK_SPACE}/iw/iw ] && iw "build" | ||
871 | iw "install" | ||
872 | ;; | ||
873 | all) | ||
874 | |||
875 | package_dir_exists ${WORK_SPACE}/iw iw || rm -rf ${WORK_SPACE}/iw | ||
876 | iw "all" | ||
877 | ;; | ||
878 | *) | ||
879 | echo "Error: illegal action for iw" | ||
880 | exit 1 | ||
881 | ;; | ||
882 | esac | ||
883 | ;; | ||
884 | hostapd) | ||
885 | case $stage in | ||
886 | download) | ||
887 | package_dir_exists ${WORK_SPACE}/hostap hostapd || exit 1 | ||
888 | hostap "download" | ||
889 | ;; | ||
890 | build) | ||
891 | if [ ! -d ${WORK_SPACE}/hostap ] | ||
892 | then | ||
893 | hostap "download" | ||
894 | fi | ||
895 | cd ${WORK_SPACE}/hostap | ||
896 | hostap "build" | ||
897 | ;; | ||
898 | install) | ||
899 | if [ ! -d ${WORK_SPACE}/hostap ] | ||
900 | then | ||
901 | hostap "download" | ||
902 | fi | ||
903 | if [ ! -e ${WORK_SPACE}/hostap/hostapd/hostapd ] | ||
904 | then | ||
905 | hostap "build" | ||
906 | fi | ||
907 | hostap "install" | ||
908 | ;; | ||
909 | all) | ||
910 | package_dir_exists ${WORK_SPACE}/hostap hostapd || rm -rf ${WORK_SPACE}/hostap | ||
911 | hostap "all" | ||
912 | ;; | ||
913 | *) | ||
914 | echo "Error: illegal action for hostapd" | ||
915 | exit 1 | ||
916 | ;; | ||
917 | esac | ||
918 | |||
919 | ;; | ||
920 | wpa_supplicant) | ||
921 | case $stage in | ||
922 | download) | ||
923 | package_dir_exists ${WORK_SPACE}/hostap wpa_supplicant || exit 1 | ||
924 | hostap "download" | ||
925 | ;; | ||
926 | build) | ||
927 | if [ ! -e ${WORK_SPACE}/hostap ] | ||
928 | then | ||
929 | hostap "download" | ||
930 | fi | ||
931 | wpa_supplicant "build" | ||
932 | ;; | ||
933 | install) | ||
934 | if [ ! -e ${WORK_SPACE}/hostap ] | ||
935 | then | ||
936 | hostap "download" | ||
937 | fi | ||
938 | if [ ! -e ${WORK_SPACE}/hostap/wpa_supplicant/wpa_supplicant ] | ||
939 | then | ||
940 | wpa_supplicant "build" | ||
941 | fi | ||
942 | wpa_supplicant "install" | ||
943 | ;; | ||
944 | *) | ||
945 | echo "Error: illegal action for hostapd" | ||
946 | exit 1 | ||
947 | ;; | ||
948 | esac | ||
949 | ;; | ||
950 | wl18xx_modules) | ||
951 | case $stage in | ||
952 | download) | ||
953 | package_dir_exists ${WORK_SPACE}/compat-wireless compat-wireless || exit 1 | ||
954 | compat-wireless "download" | ||
955 | ;; | ||
956 | build) | ||
957 | if [ ! -d ${WORK_SPACE}/compat-wireless ] | ||
958 | then | ||
959 | compat-wireless "download" | ||
960 | fi | ||
961 | cd ${WORK_SPACE}/compat-wireless | ||
962 | compat-wireless "build" | ||
963 | ;; | ||
964 | install) | ||
965 | if [ ! -d ${WORK_SPACE}/compat-wireless ] | ||
966 | then | ||
967 | compat-wireless "all" | ||
968 | else | ||
969 | cd ${WORK_SPACE}/compat-wireless | ||
970 | compat-wireless "install" | ||
971 | fi | ||
972 | ;; | ||
973 | all) | ||
974 | package_dir_exists ${WORK_SPACE}/compat-wireless compat-wireless || rm -rf ${WORK_SPACE}/compat-wireless | ||
975 | compat-wireless "all" | ||
976 | ;; | ||
977 | *) | ||
978 | echo "Error: illegal action for wl18xx_modules" | ||
979 | exit 1 | ||
980 | ;; | ||
981 | esac | ||
982 | |||
983 | ;; | ||
984 | calibrator) | ||
985 | case $stage in | ||
986 | download) | ||
987 | if [ -d ${WORK_SPACE}/ti-utils ] | ||
988 | then | ||
989 | echo "Calibrator is part of ti-utils package that already exists at: ${WORK_SPACE}/18xx-ti-utils" | ||
990 | exit 0 | ||
991 | fi | ||
992 | ti-utils "download" | ||
993 | ;; | ||
994 | build) | ||
995 | if [ ! -d ${WORK_SPACE}/18xx-ti-utils ] | ||
996 | then | ||
997 | ti-utils "download" | ||
998 | fi | ||
999 | cd ${WORK_SPACE}/ti-utils | ||
1000 | ti-utils "build" | ||
1001 | ;; | ||
1002 | install) | ||
1003 | if [ ! -d ${WORK_SPACE}/18xx-ti-utils ] | ||
1004 | then | ||
1005 | ti-utils "all" | ||
1006 | else | ||
1007 | if [ ! -e ${WORK_SPACE}/18xx-ti-utils/calibrator ] | ||
1008 | then | ||
1009 | ti-utils "build" | ||
1010 | fi | ||
1011 | ti-utils "install" | ||
1012 | fi | ||
1013 | ;; | ||
1014 | all) | ||
1015 | ti-utils "all" | ||
1016 | ;; | ||
1017 | *) | ||
1018 | echo "Error: illegal action for calibrator" | ||
1019 | exit 1 | ||
1020 | ;; | ||
1021 | esac | ||
1022 | ;; | ||
1023 | wlconf) | ||
1024 | case $stage in | ||
1025 | download) | ||
1026 | if [ ! -d ${WORK_SPACE}/18xx-ti-utils ] | ||
1027 | then | ||
1028 | ti-utils "download" | ||
1029 | fi | ||
1030 | if [ ! -d ${WORK_SPACE}/conf_and_scripts ] | ||
1031 | then | ||
1032 | ecs_tools "download" | ||
1033 | fi | ||
1034 | ;; | ||
1035 | build) | ||
1036 | if [ ! -d ${WORK_SPACE}/18xx-ti-utils ] | ||
1037 | then | ||
1038 | ti-utils "download" | ||
1039 | fi | ||
1040 | wlconf "build" | ||
1041 | ;; | ||
1042 | install) | ||
1043 | if [ ! -d ${WORK_SPACE}/18xx-ti-utils ] | ||
1044 | then | ||
1045 | ti-utils "download" | ||
1046 | fi | ||
1047 | if [ ! -e ${WORK_SPACE}/18xx-ti-utils/wlconf/wlconf ] | ||
1048 | then | ||
1049 | wlconf "build" | ||
1050 | fi | ||
1051 | if [ ! -d ${WORK_SPACE}/conf_and_scripts ] | ||
1052 | then | ||
1053 | ecs_tools "download" | ||
1054 | fi | ||
1055 | wlconf "install" | ||
1056 | ;; | ||
1057 | all) | ||
1058 | wlconf "all" | ||
1059 | ;; | ||
1060 | *) | ||
1061 | echo "Error: illegal action for wlconf" | ||
1062 | exit 1 | ||
1063 | ;; | ||
1064 | esac | ||
1065 | ;; | ||
1066 | firmware) | ||
1067 | if [ x$stage = "xclean" -o x$stage = "xdownload" -o x$stage = "xinstall" -o x$stage = "xall" ] | ||
1068 | then | ||
1069 | |||
1070 | if [ ! -d wl18xx_fw/ ] | ||
1071 | then | ||
1072 | wl18xx-firmware "download" | ||
1073 | fi | ||
1074 | |||
1075 | wl18xx-firmware $2 | ||
1076 | else | ||
1077 | echo "illegal action for firmware" | ||
1078 | exit 1 | ||
1079 | fi | ||
1080 | ;; | ||
1081 | crda) | ||
1082 | case $stage in | ||
1083 | download) | ||
1084 | package_dir_exists ${WORK_SPACE}/crda-1.1.1 crda || exit 1 | ||
1085 | crda "download" | ||
1086 | ;; | ||
1087 | build) | ||
1088 | if [ ! -d ${WORK_SPACE}/crda-1.1.1 ] | ||
1089 | then | ||
1090 | crda "download" | ||
1091 | fi | ||
1092 | cd ${WORK_SPACE}/crda-1.1.1 | ||
1093 | crda "build" | ||
1094 | ;; | ||
1095 | install) | ||
1096 | if [ ! -d ${WORK_SPACE}/crda-1.1.1 ] | ||
1097 | then | ||
1098 | crda "all" | ||
1099 | else | ||
1100 | cd ${WORK_SPACE}/crda-1.1.1 | ||
1101 | crda "install" | ||
1102 | fi | ||
1103 | ;; | ||
1104 | all) | ||
1105 | package_dir_exists ${WORK_SPACE}/crda-1.1.1 crda || rm -rf ${WORK_SPACE}/crda-1.1.1 | ||
1106 | crda "all" | ||
1107 | ;; | ||
1108 | *) | ||
1109 | echo "Error: illegal action for crda" | ||
1110 | exit 1 | ||
1111 | ;; | ||
1112 | esac | ||
1113 | ;; | ||
1114 | all) | ||
1115 | libnl "all" | ||
1116 | openssl "all" | ||
1117 | iw "all" | ||
1118 | hostap "all" | ||
1119 | wpa_supplicant "all" | ||
1120 | crda "all" | ||
1121 | ti-utils "all" | ||
1122 | wl18xx-firmware "all" | ||
1123 | compat-wireless "all" | ||
1124 | wlconf "all" | ||
1125 | ;; | ||
1126 | clean-all) | ||
1127 | compat-wireless "clean" | ||
1128 | ti-utils "clean" | ||
1129 | crda "clean" | ||
1130 | hostap "clean" | ||
1131 | iw "clean" | ||
1132 | openssl "clean" | ||
1133 | libnl "clean" | ||
1134 | wl18xx-firmware "clean" | ||
1135 | ;; | ||
1136 | *) | ||
1137 | usage | ||
1138 | exit 1 | ||
1139 | esac | ||
diff --git a/wl18xx_build_bt.sh b/wl18xx_build_bt.sh new file mode 100755 index 0000000..832632a --- /dev/null +++ b/wl18xx_build_bt.sh | |||
@@ -0,0 +1,433 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # \\\// | ||
4 | # -(o o)- | ||
5 | #========================oOO==(_)==OOo======================= | ||
6 | # | ||
7 | # This file contains the Bluetooth components which should | ||
8 | # be built and installed on the target filesystem | ||
9 | # | ||
10 | |||
11 | BUILD_VERSION="r8" | ||
12 | declare -A compat_bluetooth["r8"]="https://gforge.ti.com/gf/download/frsrelease/977/6265/ti-compat-nfc-2012-10-29.tar.gz" | ||
13 | |||
14 | source ./functions/common-functions | ||
15 | function usage() | ||
16 | { | ||
17 | echo | ||
18 | echo | ||
19 | echo "************************************" | ||
20 | echo "* Bluetooth Modules Builder Script *" | ||
21 | echo "************************************" | ||
22 | echo | ||
23 | echo "This script compiles the BT modules components" | ||
24 | echo "The script can build each component as standalone by invoking: \"./wl12xx_build_bt.sh <module name> <build/rebuild>\"" | ||
25 | echo "For example: \"./wl12xx_build_bt.sh bt-modules rebuild\"" | ||
26 | echo | ||
27 | echo "Available components are:" | ||
28 | echo "bt-modules, expat, libffi, dbus, libIConv, zlib, gettext, glib, dbus-glib," | ||
29 | echo "check, python, pygobject, dbus-python,bluez, hcidump, ncurses" | ||
30 | echo "readline, alsa-lib, openobex, libical, obexd, bt-obex, firmware, wl1271-demo, bt-enable" | ||
31 | echo | ||
32 | echo "You may also build all components by typing: \"./wl12xx_build_bt.sh all build\"" | ||
33 | echo | ||
34 | echo "Prerequisites" | ||
35 | echo "=============" | ||
36 | echo "The following variables should be exported in order to run the script:" | ||
37 | echo "1) ROOTFS - should point to the root filesystem where the BT components will be installed" | ||
38 | echo "2) WORK_SPACE - should point to the workspace where the components will be downloaded and compiled" | ||
39 | echo "3) KLIB_BUILD - should point to the kernel which the compat bluetooth will be compiled against." | ||
40 | echo "4) Path to cross compiler in PATH" | ||
41 | echo "" | ||
42 | } | ||
43 | |||
44 | function all() | ||
45 | { | ||
46 | get_machine_used | ||
47 | #bt-modules 1 | ||
48 | uim 1 | ||
49 | expat 1 | ||
50 | libffi | ||
51 | glib 1 | ||
52 | dbus 1 | ||
53 | libIConv 1 | ||
54 | zlib 1 | ||
55 | gettext 1 | ||
56 | dbus-glib 1 | ||
57 | check 1 | ||
58 | python 1 | ||
59 | pygobject 1 | ||
60 | dbus-python 1 | ||
61 | bluez 1 | ||
62 | hcidump 1 | ||
63 | ncurses 1 | ||
64 | readline 1 | ||
65 | alsa-lib 1 | ||
66 | openobex 1 | ||
67 | libical 1 | ||
68 | obexd 1 | ||
69 | bt-obex 1 | ||
70 | firmware 1 | ||
71 | wl1271-demo 1 | ||
72 | #bt-enable 1 | ||
73 | } | ||
74 | |||
75 | function apply_patches() | ||
76 | { | ||
77 | [ ! -e $LS ] && echo "Please set full path of ls utility in setup-env file." && exit 1 | ||
78 | files=`$LS *.patch` | ||
79 | for f in ${files}; do patch -p1 -i ${f} || exit 1; done | ||
80 | return 0 | ||
81 | } | ||
82 | function bt-modules() | ||
83 | { | ||
84 | if [ x"$KLIB_BUILD" = "x" ]; then | ||
85 | echo "Please set KLIB_BUILD variable to point to your Linux kernel" | ||
86 | exit 1 | ||
87 | fi | ||
88 | |||
89 | cd ${WORK_SPACE} || exit 1 | ||
90 | COMPONENT_NAME=`basename ${compat_nfc[$BUILD_VERSION]}` | ||
91 | COMPONENT_DIR="compat-bluetooth" | ||
92 | download_component "${compat_bluetooth[$BUILD_VERSION]}" | ||
93 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
94 | add_fingerprint 0 | ||
95 | [ ! -e Compat-patch-zip-v1.zip ] && { wget http://processors.wiki.ti.com/images/9/99/Compat-patch-zip-v1.zip || exit 1; } | ||
96 | unzip -o Compat-patch-zip-v1.zip || exit 1 | ||
97 | #apply_patches | ||
98 | patch -p1 -i ${old_dir}/patches/0001-compat-wireless-usb-missing-macro.patch | ||
99 | |||
100 | ./scripts/driver-select bt || exit 1 | ||
101 | make KLIB=${ROOTFS} "install-modules" || exit 1 | ||
102 | add_fingerprint 1 | ||
103 | fi | ||
104 | echo "bt-modules built successfully" | ||
105 | } | ||
106 | |||
107 | function bluez() | ||
108 | { | ||
109 | if [ $# -eq 1 ]; then | ||
110 | START_MODULE="bluez" | ||
111 | fi | ||
112 | # dependency section, in here we build the dependencies. We do not want to rebuild them each time | ||
113 | check | ||
114 | dbus | ||
115 | glib | ||
116 | uim | ||
117 | |||
118 | cd ${WORK_SPACE} || exit 1 | ||
119 | COMPONENT_NAME="bluez" | ||
120 | COMPONENT_REV="18a5dc6cdcf0828443c415eaea82b6834a8f9825" | ||
121 | COMPONENT_DIR="bluez" | ||
122 | download_component "git://git.kernel.org/pub/scm/bluetooth/bluez.git" | ||
123 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
124 | add_fingerprint 0 | ||
125 | patch -p1 -i ${old_dir}patches/0001-bluez-define-_GNU_SOURCE-macro.patch | ||
126 | patch -p1 -i ${old_dir}patches/0002-bluez-define-macro-lacking-in-compiler.patch | ||
127 | patch -p1 -i ${old_dir}patches/0003-socket-enable-for-bluez-4_98.patch | ||
128 | patch -p1 -i ${old_dir}patches/0004-bluez-enable-source-interface.patch | ||
129 | patch -p1 -i ${old_dir}patches/0005-bluez-enable-gatt.patch | ||
130 | patch -p1 -i ${old_dir}patches/0006-bluez-fix-missing-include-directive.patch | ||
131 | |||
132 | /usr/bin/libtoolize || exit 1 | ||
133 | /usr/bin/aclocal || exit 1 | ||
134 | /usr/bin/autoheader || exit 1 | ||
135 | /usr/bin/automake --add-missing || exit 1 | ||
136 | /usr/bin/autoconf || exit 1 | ||
137 | |||
138 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-tools --enable-dund --enable-alsa --enable-test --enable-audio --enable-serial --enable-service --enable-hidd --enable-gstreamer --enable-usb --enable-tools --enable-bccmd --enable-hid2hci --enable-dfutool --enable-pand --disable-cups --enable-debug --enable-gatt --enable-hid2hci --enable-health | ||
139 | make LIBS='-lffi' || exit 1 | ||
140 | make install DESTDIR=${ROOTFS} || exit 1 | ||
141 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
142 | cp audio/audio.conf profiles/input/input.conf ${ROOTFS}${MY_SYSCONFDIR}/bluetooth/ || exit 1 | ||
143 | cp test/agent ${ROOTFS}${MY_PREFIX}/bin/agent || exit 1 | ||
144 | add_fingerprint 1 | ||
145 | fi | ||
146 | echo "bluez built successfully" | ||
147 | } | ||
148 | |||
149 | function hcidump | ||
150 | { | ||
151 | cd ${WORK_SPACE} || exit 1 | ||
152 | COMPONENT_NAME="bluez-hcidump-2.2.tar.gz" | ||
153 | COMPONENT_DIR="bluez-hcidump-2.2" | ||
154 | download_component "http://pkgs.fedoraproject.org/repo/pkgs/bluez-hcidump/bluez-hcidump-2.2.tar.gz/3c298a8be67099fe227f3e4d9de539d5/bluez-hcidump-2.2.tar.gz" | ||
155 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
156 | add_fingerprint 0 | ||
157 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
158 | make || exit 1 | ||
159 | make install DESTDIR=${ROOTFS} || exit 1 | ||
160 | add_fingerprint 1 | ||
161 | fi | ||
162 | echo "hcidump built successfully" | ||
163 | } | ||
164 | |||
165 | function ncurses | ||
166 | { | ||
167 | cd ${WORK_SPACE} || exit 1 | ||
168 | COMPONENT_NAME="ncurses-5.9.tar.gz" | ||
169 | COMPONENT_DIR="ncurses-5.9" | ||
170 | download_component "http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz" | ||
171 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
172 | add_fingerprint 0 | ||
173 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} -with-shared --without-debug --without-normal || exit 1 | ||
174 | make || exit 1 | ||
175 | make install DESTDIR=${ROOTFS} || exit 1 | ||
176 | add_fingerprint 1 | ||
177 | fi | ||
178 | echo "ncurses built successfully" | ||
179 | } | ||
180 | |||
181 | function readline | ||
182 | { | ||
183 | cd ${WORK_SPACE} || exit 1 | ||
184 | COMPONENT_NAME="readline-6.2.tar.gz" | ||
185 | COMPONENT_DIR="readline-6.2" | ||
186 | download_component "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz" | ||
187 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
188 | add_fingerprint 0 | ||
189 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
190 | make || exit 1 | ||
191 | make install DESTDIR=${ROOTFS} || exit 1 | ||
192 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
193 | add_fingerprint 1 | ||
194 | fi | ||
195 | echo "readline built successfully" | ||
196 | } | ||
197 | |||
198 | |||
199 | function alsa-lib | ||
200 | { | ||
201 | cd ${WORK_SPACE} || exit 1 | ||
202 | COMPONENT_NAME="alsa-lib-1.0.24.1.tar.gz" | ||
203 | COMPONENT_DIR="alsa-lib-1.0.25" | ||
204 | download_component "http://fossies.org/linux/misc/alsa-lib-1.0.24.1.tar.gz" | ||
205 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
206 | add_fingerprint 0 | ||
207 | ./configure --prefix=${MY_PREFIX} --host=${BUILD_HOST} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} || exit 1 | ||
208 | make || exit 1 | ||
209 | make install DESTDIR=${ROOTFS} || exit 1 | ||
210 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
211 | add_fingerprint 1 | ||
212 | fi | ||
213 | echo "alsa-lib built successfully" | ||
214 | } | ||
215 | |||
216 | function openobex | ||
217 | { | ||
218 | cd ${WORK_SPACE} || exit 1 | ||
219 | COMPONENT_NAME="openobex-1.5.tar.gz" | ||
220 | COMPONENT_DIR="openobex-1.5" | ||
221 | download_component "http://ftp.osuosl.org/pub/linux/bluetooth/openobex-1.5.tar.gz" | ||
222 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
223 | # wget 'http://mirror.anl.gov/pub/linux/bluetooth/openobex-1.5.tar.gz' || exit 1 | ||
224 | add_fingerprint 0 | ||
225 | sed -i '11227 i *)\n;;' configure || exit 1 | ||
226 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} --localstatedir=${MY_LOCALSTATEDIR} --enable-apps --disable-usb || exit 1 | ||
227 | sed -i 's/^\(libdir=\).*/\1\$\{prefix\}\/lib/g' openobex.pc || exit 1 | ||
228 | make || exit 1 | ||
229 | make install DESTDIR=${ROOTFS} || exit 1 | ||
230 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
231 | add_fingerprint 1 | ||
232 | fi | ||
233 | echo "openobex built successfully" | ||
234 | } | ||
235 | |||
236 | function libical | ||
237 | { | ||
238 | cd ${WORK_SPACE} || exit 1 | ||
239 | COMPONENT_NAME="libical-0.44.tar.gz" | ||
240 | COMPONENT_DIR="libical-0.44" | ||
241 | download_component "http://downloads.sourceforge.net/project/freeassociation/libical/libical-0.44/libical-0.44.tar.gz" | ||
242 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
243 | add_fingerprint 0 | ||
244 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1 | ||
245 | make || exit 1 | ||
246 | make install DESTDIR=${ROOTFS} || exit 1 | ||
247 | rm `find ${ROOTFS}${MY_PREFIX}/lib/ -name '*.la'` >& /dev/null | ||
248 | add_fingerprint 1 | ||
249 | fi | ||
250 | echo "libical built successfully" | ||
251 | } | ||
252 | |||
253 | function obexd | ||
254 | { | ||
255 | if [ $# -eq 1 ]; then | ||
256 | START_MODULE="2281d4fac9fec97993b0a6dc0e2ec42911eac194" | ||
257 | fi | ||
258 | # dependency section, in here we build the dependencies. We do not want to rebuild them each time | ||
259 | bluez | ||
260 | openobex | ||
261 | libical | ||
262 | readline | ||
263 | ncurses | ||
264 | |||
265 | cd ${WORK_SPACE} || exit 1 | ||
266 | COMPONENT_NAME="obexd" | ||
267 | COMPONENT_REV="2281d4fac9fec97993b0a6dc0e2ec42911eac194" | ||
268 | COMPONENT_DIR="obexd" | ||
269 | download_component "git://git.kernel.org/pub/scm/bluetooth/obexd.git" | ||
270 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
271 | add_fingerprint 0 | ||
272 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1 | ||
273 | #wget http://processors.wiki.ti.com/images/2/22/Obexd-fix-UTF-conversions-1.tar.gz || exit 1 | ||
274 | wget http://processors.wiki.ti.com/images/4/43/Obexd-patches_v1.tar.gz || exit 1 | ||
275 | echo "Openning archive: Obexd-patches_v1.tar.gz" && tar -xzf Obexd-patches_v1.tar.gz || exit 1 | ||
276 | #apply_patches | ||
277 | make || exit 1 | ||
278 | make install DESTDIR=${ROOTFS} || exit 1 | ||
279 | add_fingerprint 1 | ||
280 | fi | ||
281 | echo "obexd built successfully" | ||
282 | } | ||
283 | |||
284 | function bt-obex | ||
285 | { | ||
286 | if [ $# -eq 1 ]; then | ||
287 | START_MODULE="171181b6ef6c94aefc828dc7fd8de136b9f97532" | ||
288 | fi | ||
289 | # dependency section, in here we build the dependencies. We do not want to rebuild them each time | ||
290 | dbus-glib | ||
291 | readline | ||
292 | ncurses | ||
293 | |||
294 | cd ${WORK_SPACE} || exit 1 | ||
295 | COMPONENT_NAME="bluez-tools" | ||
296 | COMPONENT_REV="171181b6ef6c94aefc828dc7fd8de136b9f97532" | ||
297 | COMPONENT_DIR="bluez-tools" | ||
298 | download_component "git://gitorious.org/bluez-tools/bluez-tools.git" | ||
299 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
300 | add_fingerprint 0 | ||
301 | [ ! -e Bt-obex-patches.zip ] && { wget 'http://processors.wiki.ti.com/images/f/f5/Bt-obex-patches.zip' || exit 1; } | ||
302 | unzip -o Bt-obex-patches.zip || exit 1 | ||
303 | apply_patches | ||
304 | patch -p1 -i ${old_dir}/patches/0001-bt-obex-new-dbus-api-for-obexd.patch | ||
305 | |||
306 | /usr/bin/libtoolize || exit 1 | ||
307 | /usr/bin/aclocal || exit 1 | ||
308 | /usr/bin/autoheader || exit 1 | ||
309 | /usr/bin/automake --add-missing || exit 1 | ||
310 | /usr/bin/autoconf || exit 1 | ||
311 | ./configure --host=${BUILD_HOST} --prefix=${MY_PREFIX} --sysconfdir=${MY_SYSCONFDIR} || exit 1 | ||
312 | make LIBS="$LIBS -lncurses" || exit 1 | ||
313 | make install DESTDIR=${ROOTFS} || exit 1 | ||
314 | add_fingerprint 1 | ||
315 | fi | ||
316 | echo "bt-obex built successfully" | ||
317 | } | ||
318 | |||
319 | function wl1271-demo | ||
320 | { | ||
321 | cd ${WORK_SPACE} || exit 1 | ||
322 | COMPONENT_NAME="wl1271-bluetooth-2012-03-26.tar.gz" | ||
323 | COMPONENT_DIR="wl1271-bluetooth" | ||
324 | download_component "https://gforge.ti.com/gf/download/frsrelease/827/5494/wl1271-bluetooth-2012-03-26.tar.gz" | ||
325 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
326 | add_fingerprint 0 | ||
327 | #https://github.com/TI-ECS/wl1271-bluetooth/zipball/master | ||
328 | mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1 | ||
329 | mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1 | ||
330 | mkdir -p ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1 | ||
331 | |||
332 | if [ x"$MACHINE_TYPE" = "x" ]; then | ||
333 | get_machine_used | ||
334 | fi | ||
335 | |||
336 | cp ./gallery/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/gallery || exit 1 | ||
337 | cp ./script/common/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1 | ||
338 | cp ./script/${MACHINE_TYPE}/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/scripts || exit 1 | ||
339 | cp ./ftp_folder/* ${ROOTFS}/usr/share/wl1271-demos/bluetooth/ftp_folder || exit 1 | ||
340 | add_fingerprint 1 | ||
341 | fi | ||
342 | echo "wl1271-demo built successfully" | ||
343 | } | ||
344 | |||
345 | function bt-enable | ||
346 | { | ||
347 | cd ${WORK_SPACE} || exit 1 | ||
348 | if [ x"$KLIB_BUILD" = "x" ]; then | ||
349 | echo "Please set KLIB_BUILD variable to point to your Linux kernel" | ||
350 | exit 1 | ||
351 | fi | ||
352 | COMPONENT_NAME="bt_enable" | ||
353 | COMPONENT_REV="dd75971705ada8fb0e88a0fb3f68833086c5bba4" | ||
354 | COMPONENT_DIR="bt_enable" | ||
355 | download_component "git://github.com/TI-ECS/bt_enable.git" | ||
356 | if [ ${CURRENT_OPTION} = "2" ]; then | ||
357 | [ ! -e Bt-enable-standalone-makefile.zip ] && { wget 'http://processors.wiki.ti.com/images/8/8f/Bt-enable-standalone-makefile.zip' || exit 1; } | ||
358 | unzip -o Bt-enable-standalone-makefile.zip || exit 1 | ||
359 | apply_patches | ||
360 | |||
361 | if [ x"$MACHINE_TYPE" = "x" ]; then | ||
362 | get_machine_used | ||
363 | fi | ||
364 | cp ./gpio_en_${MACHINE_TYPE}.c ./gpio_en.c | ||
365 | make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} || exit 1 | ||
366 | make DEST_DIR=${ROOTFS} KERNEL_DIR=${KLIB_BUILD} install || exit 1 | ||
367 | add_fingerprint 1 | ||
368 | fi | ||
369 | echo "bt-enable built successfully" | ||
370 | } | ||
371 | |||
372 | #================================================================================== | ||
373 | # Main | ||
374 | #================================================================================== | ||
375 | old_dir=`pwd` | ||
376 | MACHINE_TYPE="" | ||
377 | |||
378 | source setup-env || exit 1 | ||
379 | # if there are no sufficient arguments... | ||
380 | if [ $# -lt 2 ]; then | ||
381 | usage | ||
382 | exit 0 | ||
383 | fi | ||
384 | |||
385 | if [ x"$CROSS_COMPILE" = "x" ]; then | ||
386 | echo "define CROSS_COMPILE variable" | ||
387 | exit 1 | ||
388 | fi | ||
389 | |||
390 | which ${CROSS_COMPILE}gcc > /dev/null | ||
391 | |||
392 | if [ $? -ne 0 ]; then | ||
393 | echo "No toolchain in path" | ||
394 | exit 1 | ||
395 | fi | ||
396 | |||
397 | BUILD_HOST=`echo $CROSS_COMPILE | sed s/-$//` | ||
398 | |||
399 | if [ x"$ROOTFS" = "x" ]; then | ||
400 | echo "Please set ROOTFS variable to point to your root filesystem" | ||
401 | exit 1 | ||
402 | fi | ||
403 | |||
404 | if [ x"$WORK_SPACE" = "x" ]; then | ||
405 | echo "Please set WORK_SPACE variable to point to your preferred work space" | ||
406 | exit 1 | ||
407 | fi | ||
408 | |||
409 | FINGURE_PRINT_DIR="${WORK_SPACE}/.FingurePrint" | ||
410 | mkdir -p ${FINGURE_PRINT_DIR} || exit 1 | ||
411 | |||
412 | USER_OPTION=0 | ||
413 | CURRENT_OPTION=0 | ||
414 | |||
415 | case "$2" in | ||
416 | build) | ||
417 | USER_OPTION=1 | ||
418 | ;; | ||
419 | rebuild) | ||
420 | USER_OPTION=2 | ||
421 | ;; | ||
422 | *) | ||
423 | echo "Unknown option $2" | ||
424 | exit 1 | ||
425 | ;; | ||
426 | esac | ||
427 | |||
428 | CURRENT_OPTION=${USER_OPTION} | ||
429 | |||
430 | MODULE_TO_INVOKE=$1 | ||
431 | $MODULE_TO_INVOKE 1 | ||
432 | |||
433 | cd ${old_dir} | ||
diff --git a/wlan_enable_config.sh b/wlan_enable_config.sh index 631626b..4c837bc 100755 --- a/wlan_enable_config.sh +++ b/wlan_enable_config.sh | |||
@@ -35,6 +35,9 @@ CONFIG_NF_NAT=y | |||
35 | CONFIG_NF_NAT_NEEDED=y | 35 | CONFIG_NF_NAT_NEEDED=y |
36 | CONFIG_IP_NF_TARGET_MASQUERADE=y | 36 | CONFIG_IP_NF_TARGET_MASQUERADE=y |
37 | CONFIG_INPUT_UINPUT=y | 37 | CONFIG_INPUT_UINPUT=y |
38 | CONFIG_NET_SCHED=y | ||
39 | CONFIG_NET_SCH_FIFO=y | ||
40 | CONFIG_TI_ST=y | ||
38 | CONFIG | 41 | CONFIG |
39 | `; do | 42 | `; do |
40 | echo -n "Option $i: " | 43 | echo -n "Option $i: " |