diff options
Diffstat (limited to 'meta/recipes-devtools')
36 files changed, 2241 insertions, 331 deletions
diff --git a/meta/recipes-devtools/exmap-console/exmap-console.inc b/meta/recipes-devtools/exmap-console/exmap-console.inc new file mode 100644 index 0000000000..efbd79fce1 --- /dev/null +++ b/meta/recipes-devtools/exmap-console/exmap-console.inc | |||
@@ -0,0 +1,59 @@ | |||
1 | DESCRIPTION = "Console based version of exmap, a memory usage analysis tool" | ||
2 | HOMEPAGE = "http://projects.o-hand.com/exmap-console" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "GPL" | ||
5 | DEPENDS = "virtual/kernel readline glib-2.0" | ||
6 | |||
7 | SRC_URI = "http://projects.o-hand.com/sources/exmap-console/exmap-console-${PV}.tgz" | ||
8 | |||
9 | TEMPPACKAGE_ARCH := "${PACKAGE_ARCH}" | ||
10 | |||
11 | inherit module-base | ||
12 | inherit autotools | ||
13 | |||
14 | PACKAGE_ARCH = "${TEMPPACKAGE_ARCH}" | ||
15 | |||
16 | PACKAGES =+ "exmap-server kernel-module-exmap" | ||
17 | |||
18 | FILES_exmap-console = "${bindir}/exmap ${bindir}/exmapd" | ||
19 | RDEPENDS_exmap-console += "kernel-module-exmap" | ||
20 | |||
21 | FILES_exmap-server = "${bindir}/exmapserver" | ||
22 | RDEPENDS_exmap-server += "kernel-module-exmap" | ||
23 | |||
24 | FILES_kernel-module-exmap = "${base_libdir}" | ||
25 | PACKAGE_ARCH_kernel-module-exmap = "${MACHINE_ARCH}" | ||
26 | RDEPENDS_kernel-module-exmap += "update-modules kernel-image-${KERNEL_VERSION}" | ||
27 | |||
28 | S = "${WORKDIR}/exmap-console-${PV}" | ||
29 | |||
30 | export MODULE_PATH="${D}${base_libdir}/modules/${KERNEL_VERSION}" | ||
31 | |||
32 | do_compile() { | ||
33 | cd ${S}/src | ||
34 | make | ||
35 | |||
36 | cd ${S}/kernel | ||
37 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | ||
38 | oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR} \ | ||
39 | KERNEL_SRC=${STAGING_KERNEL_DIR} \ | ||
40 | KERNEL_VERSION=${KERNEL_VERSION} \ | ||
41 | CC="${KERNEL_CC}" LD="${KERNEL_LD}" \ | ||
42 | ${MAKE_TARGETS} | ||
43 | } | ||
44 | |||
45 | do_install() { | ||
46 | oe_runmake 'DESTDIR=${D}' 'DEPMOD=/bin/true' install | ||
47 | } | ||
48 | |||
49 | pkg_postinst_append_kernel-module-exmap () { | ||
50 | if [ -n "$D" ]; then | ||
51 | exit 1 | ||
52 | fi | ||
53 | depmod -a | ||
54 | update-modules || true | ||
55 | } | ||
56 | |||
57 | pkg_postrm_append_kernel-module-exmap () { | ||
58 | update-modules || true | ||
59 | } | ||
diff --git a/meta/recipes-devtools/exmap-console/exmap-console_0.4.1.bb b/meta/recipes-devtools/exmap-console/exmap-console_0.4.1.bb new file mode 100644 index 0000000000..c76c5c3b4c --- /dev/null +++ b/meta/recipes-devtools/exmap-console/exmap-console_0.4.1.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require exmap-console.inc | ||
2 | |||
3 | PR = "r8" | ||
diff --git a/meta/recipes-devtools/exmap-console/exmap-console_svn.bb b/meta/recipes-devtools/exmap-console/exmap-console_svn.bb new file mode 100644 index 0000000000..ce222854e2 --- /dev/null +++ b/meta/recipes-devtools/exmap-console/exmap-console_svn.bb | |||
@@ -0,0 +1,8 @@ | |||
1 | require exmap-console.inc | ||
2 | |||
3 | PV = "0.4+svnr${SRCREV}" | ||
4 | PR = "r5" | ||
5 | |||
6 | SRC_URI = "svn://svn.o-hand.com/repos/misc/trunk;module=exmap-console;proto=http" | ||
7 | |||
8 | S = "${WORKDIR}/exmap-console" | ||
diff --git a/meta/recipes-devtools/gmp/gmp-4.2.1/disable-stdc.patch b/meta/recipes-devtools/gmp/gmp-4.2.1/disable-stdc.patch deleted file mode 100644 index 83c9eae36a..0000000000 --- a/meta/recipes-devtools/gmp/gmp-4.2.1/disable-stdc.patch +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | # "extern inline" in traditional gcc means that the function should be | ||
2 | # inlined wherever it's seen, while in C99, "extern inline" means that i | ||
3 | # the function should only be inlined where the inline definition is | ||
4 | # seen while in other places it's not inlined: | ||
5 | # http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html | ||
6 | # | ||
7 | # gmp checks "--std=gnu99" to use C99 convention however it internally | ||
8 | # defines some "extern inline" functions in gmp.h, which is included | ||
9 | # by mainly .c files and finally lead a flood of redefinition function | ||
10 | # errors when linking objects together. | ||
11 | # | ||
12 | # So disable C99/ANSI detection to stick to tranditional gcc behavior | ||
13 | # | ||
14 | # by Kevin Tian <kevin.tian@intel.com>, 2010-08-13 | ||
15 | # | ||
16 | # (this patch is licensed under GPLv2+) | ||
17 | |||
18 | diff --git a/configure.in b/configure.in | ||
19 | index 450cc92..aab0b59 100644 | ||
20 | --- a/configure.in | ||
21 | +++ b/configure.in | ||
22 | @@ -1869,9 +1869,7 @@ AC_SUBST(DEFN_LONG_LONG_LIMB) | ||
23 | |||
24 | # The C compiler and preprocessor, put into ANSI mode if possible. | ||
25 | AC_PROG_CC | ||
26 | -AC_PROG_CC_STDC | ||
27 | AC_PROG_CPP | ||
28 | -GMP_H_ANSI | ||
29 | |||
30 | |||
31 | # The C compiler on the build system, and associated tests. | ||
diff --git a/meta/recipes-devtools/gmp/gmp.inc b/meta/recipes-devtools/gmp/gmp.inc deleted file mode 100644 index 6b56f7e7c8..0000000000 --- a/meta/recipes-devtools/gmp/gmp.inc +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | SECTION = "devel" | ||
2 | DESCRIPTION = "GNU multiprecision arithmetic library" | ||
3 | HOMEPAGE = "http://www.swox.com/gmp/" | ||
4 | LICENSE = "GPLv3 LGPLv3" | ||
5 | |||
6 | SRC_URI = "ftp://ftp.gnu.org/gnu/gmp/gmp-${PV}.tar.bz2 \ | ||
7 | file://configure.patch \ | ||
8 | file://amd64.patch " | ||
9 | |||
10 | inherit autotools | ||
11 | |||
12 | ARM_INSTRUCTION_SET = "arm" | ||
13 | |||
14 | acpaths = "" | ||
15 | |||
16 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/gmp/gmp/amd64.patch b/meta/recipes-devtools/gmp/gmp/amd64.patch deleted file mode 100644 index 67be9dd350..0000000000 --- a/meta/recipes-devtools/gmp/gmp/amd64.patch +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | --- gmp-4.1.4/longlong.h.orig 2004-04-22 00:34:28.000000000 +0200 | ||
2 | +++ gmp-4.1.4/longlong.h 2005-07-18 01:13:06.000000000 +0200 | ||
3 | @@ -738,8 +738,10 @@ | ||
4 | count is only an int. */ | ||
5 | #define count_trailing_zeros(count, x) \ | ||
6 | do { \ | ||
7 | + UDItype __cbtmp; \ | ||
8 | ASSERT ((x) != 0); \ | ||
9 | - __asm__ ("bsfq %1,%q0" : "=r" (count) : "rm" ((UDItype)(x))); \ | ||
10 | + __asm__ ("bsfq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x))); \ | ||
11 | + (count) = __cbtmp; \ | ||
12 | } while (0) | ||
13 | #endif /* x86_64 */ | ||
14 | |||
diff --git a/meta/recipes-devtools/gmp/gmp/configure.patch b/meta/recipes-devtools/gmp/gmp/configure.patch deleted file mode 100644 index ed0c02d86c..0000000000 --- a/meta/recipes-devtools/gmp/gmp/configure.patch +++ /dev/null | |||
@@ -1,195 +0,0 @@ | |||
1 | acinclude.m4 | 26 ++++++++++++++------------ | ||
2 | configure.in | 24 +++++++++--------------- | ||
3 | 2 files changed, 23 insertions(+), 27 deletions(-) | ||
4 | |||
5 | Index: gmp-5.0.1/acinclude.m4 | ||
6 | =================================================================== | ||
7 | --- gmp-5.0.1.orig/acinclude.m4 | ||
8 | +++ gmp-5.0.1/acinclude.m4 | ||
9 | @@ -30,20 +30,20 @@ dnl a_out.exe - OpenVMS DEC C called | ||
10 | dnl conftest.exe - various DOS compilers | ||
11 | |||
12 | |||
13 | -define(IA64_PATTERN, | ||
14 | +define([IA64_PATTERN], | ||
15 | [[ia64*-*-* | itanium-*-* | itanium2-*-*]]) | ||
16 | |||
17 | dnl Need to be careful not to match m6811, m6812, m68hc11 and m68hc12, all | ||
18 | dnl of which config.sub accepts. (Though none of which are likely to work | ||
19 | dnl with GMP.) | ||
20 | dnl | ||
21 | -define(M68K_PATTERN, | ||
22 | +define([M68K_PATTERN], | ||
23 | [[m68k-*-* | m68[0-9][0-9][0-9]-*-*]]) | ||
24 | |||
25 | -define(POWERPC64_PATTERN, | ||
26 | +define([POWERPC64_PATTERN], | ||
27 | [[powerpc64-*-* | powerpc64le-*-* | powerpc620-*-* | powerpc630-*-* | powerpc970-*-* | power[3-9]-*-*]]) | ||
28 | |||
29 | -define(X86_PATTERN, | ||
30 | +define([X86_PATTERN], | ||
31 | [[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-*]]) | ||
32 | |||
33 | define(X86_64_PATTERN, | ||
34 | @@ -64,7 +64,7 @@ dnl x86 -> x86 | ||
35 | dnl x86/k6 -> k6 | ||
36 | dnl x86/k6/mmx -> k6_mmx | ||
37 | |||
38 | -define(GMP_FAT_SUFFIX, | ||
39 | +define([GMP_FAT_SUFFIX], | ||
40 | [[$1=`echo $2 | sed -e '/\//s:^[^/]*/::' -e 's:[\\/]:_:g'`]]) | ||
41 | |||
42 | |||
43 | @@ -73,7 +73,7 @@ dnl ---------------------------------- | ||
44 | dnl Emit code to remove any occurrence of ITEM from $LISTVAR. ITEM can be a | ||
45 | dnl shell expression like $foo if desired. | ||
46 | |||
47 | -define(GMP_REMOVE_FROM_LIST, | ||
48 | +define([GMP_REMOVE_FROM_LIST], | ||
49 | [remove_from_list_tmp= | ||
50 | for remove_from_list_i in $[][$1]; do | ||
51 | if test $remove_from_list_i = [$2]; then :; | ||
52 | @@ -89,12 +89,12 @@ dnl GMP_STRIP_PATH(subdir) | ||
53 | dnl ---------------------- | ||
54 | dnl Strip entries */subdir from $path and $fat_path. | ||
55 | |||
56 | -define(GMP_STRIP_PATH, | ||
57 | +define([GMP_STRIP_PATH], | ||
58 | [GMP_STRIP_PATH_VAR(path, [$1]) | ||
59 | GMP_STRIP_PATH_VAR(fat_path, [$1]) | ||
60 | ]) | ||
61 | |||
62 | -define(GMP_STRIP_PATH_VAR, | ||
63 | +define([GMP_STRIP_PATH_VAR], | ||
64 | [tmp_path= | ||
65 | for i in $[][$1]; do | ||
66 | case $i in | ||
67 | @@ -115,7 +115,7 @@ dnl | ||
68 | dnl Dummy value for GMP_LIMB_BITS is enough | ||
69 | dnl for all current configure-time uses of gmp.h. | ||
70 | |||
71 | -define(GMP_INCLUDE_GMP_H, | ||
72 | +define([GMP_INCLUDE_GMP_H], | ||
73 | [[#define __GMP_WITHIN_CONFIGURE 1 /* ignore template stuff */ | ||
74 | #define GMP_NAIL_BITS $GMP_NAIL_BITS | ||
75 | #define GMP_LIMB_BITS 123 | ||
76 | @@ -130,7 +130,7 @@ dnl Expand at autoconf time to the valu | ||
77 | dnl FILE. The regexps here aren't very rugged, but are enough for gmp. | ||
78 | dnl /dev/null as a parameter prevents a hang if $2 is accidentally omitted. | ||
79 | |||
80 | -define(GMP_HEADER_GETVAL, | ||
81 | +define([GMP_HEADER_GETVAL], | ||
82 | [patsubst(patsubst( | ||
83 | esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]), | ||
84 | [^.*$1[ ]+],[]), | ||
85 | @@ -144,7 +144,7 @@ dnl The gmp version number, extracted f | ||
86 | dnl autoconf time. Two digits like 3.0 if patchlevel <= 0, or three digits | ||
87 | dnl like 3.0.1 if patchlevel > 0. | ||
88 | |||
89 | -define(GMP_VERSION, | ||
90 | +define([GMP_VERSION], | ||
91 | [GMP_HEADER_GETVAL(__GNU_MP_VERSION,gmp-h.in)[]dnl | ||
92 | .GMP_HEADER_GETVAL(__GNU_MP_VERSION_MINOR,gmp-h.in)[]dnl | ||
93 | .GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp-h.in)]) | ||
94 | @@ -1506,7 +1506,9 @@ esac | ||
95 | echo ["define(<CONFIG_TOP_SRCDIR>,<\`$tmp'>)"] >>$gmp_tmpconfigm4 | ||
96 | |||
97 | # All CPUs use asm-defs.m4 | ||
98 | -echo ["include][(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')"] >>$gmp_tmpconfigm4i | ||
99 | +echo -n ["include("] >>$gmp_tmpconfigm4i | ||
100 | +echo -n ["CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4'"] >>$gmp_tmpconfigm4i | ||
101 | +echo [")"] >>$gmp_tmpconfigm4i | ||
102 | ]) | ||
103 | |||
104 | |||
105 | Index: gmp-5.0.1/configure.in | ||
106 | =================================================================== | ||
107 | --- gmp-5.0.1.orig/configure.in | ||
108 | +++ gmp-5.0.1/configure.in | ||
109 | @@ -29,12 +29,6 @@ AC_REVISION($Revision$) | ||
110 | AC_PREREQ(2.59) | ||
111 | AC_INIT(GNU MP, GMP_VERSION, gmp-bugs@gmplib.org, gmp) | ||
112 | AC_CONFIG_SRCDIR(gmp-impl.h) | ||
113 | -m4_pattern_forbid([^[ \t]*GMP_]) | ||
114 | -m4_pattern_allow(GMP_LDFLAGS) | ||
115 | -m4_pattern_allow(GMP_LIMB_BITS) | ||
116 | -m4_pattern_allow(GMP_MPARAM_H_SUGGEST) | ||
117 | -m4_pattern_allow(GMP_NAIL_BITS) | ||
118 | -m4_pattern_allow(GMP_NUMB_BITS) | ||
119 | |||
120 | # If --target is not used then $target_alias is empty, but if say | ||
121 | # "./configure athlon-pc-freebsd3.5" is used, then all three of | ||
122 | @@ -303,7 +297,7 @@ AH_VERBATIM([HAVE_HOST_CPU_1], | ||
123 | # After GMP specific searches and tests, the standard autoconf AC_PROG_CC is | ||
124 | # called. User selections of CC etc are respected. | ||
125 | # | ||
126 | -# Care is taken not to use macros like AC_TRY_COMPILE during the GMP | ||
127 | +# Care is taken not to use macros like AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) during the GMP | ||
128 | # pre-testing, since they of course depend on AC_PROG_CC, and also some of | ||
129 | # them cache their results, which is not wanted. | ||
130 | # | ||
131 | @@ -395,7 +389,7 @@ abilist="standard" | ||
132 | # FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring | ||
133 | # c89 over cc here. But note that on HP-UX c89 provides a castrated | ||
134 | # environment, and would want to be excluded somehow. Maybe | ||
135 | -# AC_PROG_CC_STDC already does enough to stick cc into ANSI mode and | ||
136 | +# already does enough to stick cc into ANSI mode and | ||
137 | # we don't need to worry. | ||
138 | # | ||
139 | cclist="gcc cc" | ||
140 | @@ -1580,7 +1574,7 @@ esac | ||
141 | CFLAGS_or_unset=${CFLAGS-'(unset)'} | ||
142 | CPPFLAGS_or_unset=${CPPFLAGS-'(unset)'} | ||
143 | |||
144 | -cat >&AC_FD_CC <<EOF | ||
145 | +cat >&AS_MESSAGE_LOG_FD() <<EOF | ||
146 | User: | ||
147 | ABI=$ABI | ||
148 | CC=$CC | ||
149 | @@ -1987,7 +1981,6 @@ AC_SUBST(DEFN_LONG_LONG_LIMB) | ||
150 | |||
151 | # The C compiler and preprocessor, put into ANSI mode if possible. | ||
152 | AC_PROG_CC | ||
153 | -AC_PROG_CC_STDC | ||
154 | AC_PROG_CPP | ||
155 | GMP_H_ANSI | ||
156 | |||
157 | @@ -2010,11 +2003,11 @@ AC_SUBST(CCAS) | ||
158 | |||
159 | # The C++ compiler, if desired. | ||
160 | want_cxx=no | ||
161 | +AC_PROG_CXX | ||
162 | if test $enable_cxx != no; then | ||
163 | test_CXXFLAGS=${CXXFLAGS+set} | ||
164 | - AC_PROG_CXX | ||
165 | |||
166 | - echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC | ||
167 | + echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AS_MESSAGE_LOG_FD() | ||
168 | cxxflags_ac_prog_cxx=$CXXFLAGS | ||
169 | cxxflags_list=ac_prog_cxx | ||
170 | |||
171 | @@ -2120,7 +2113,7 @@ case $host in | ||
172 | esac | ||
173 | |||
174 | |||
175 | -cat >&AC_FD_CC <<EOF | ||
176 | +cat >&AS_MESSAGE_LOG_FD() <<EOF | ||
177 | Decided: | ||
178 | ABI=$ABI | ||
179 | CC=$CC | ||
180 | @@ -3376,7 +3369,7 @@ GMP_FINISH | ||
181 | # FIXME: Upcoming version of autoconf/automake may not like broken lines. | ||
182 | # Right now automake isn't accepting the new AC_CONFIG_FILES scheme. | ||
183 | |||
184 | -AC_OUTPUT(Makefile \ | ||
185 | +AC_CONFIG_FILES([Makefile \ | ||
186 | mpbsd/Makefile mpf/Makefile mpn/Makefile mpq/Makefile \ | ||
187 | mpz/Makefile printf/Makefile scanf/Makefile cxx/Makefile \ | ||
188 | tests/Makefile tests/devel/Makefile tests/mpbsd/Makefile \ | ||
189 | @@ -3385,4 +3378,5 @@ AC_OUTPUT(Makefile \ | ||
190 | tests/cxx/Makefile \ | ||
191 | doc/Makefile tune/Makefile \ | ||
192 | demos/Makefile demos/calc/Makefile demos/expr/Makefile \ | ||
193 | - gmp.h:gmp-h.in mp.h:mp-h.in) | ||
194 | + gmp.h:gmp-h.in mp.h:mp-h.in]) | ||
195 | +AC_OUTPUT | ||
diff --git a/meta/recipes-devtools/gmp/gmp/sh4-asmfix.patch b/meta/recipes-devtools/gmp/gmp/sh4-asmfix.patch deleted file mode 100644 index 1a01f61533..0000000000 --- a/meta/recipes-devtools/gmp/gmp/sh4-asmfix.patch +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | --- gmp-4.1.4/mpn/sh/add_n.s 2005/11/17 08:44:00 1.1 | ||
2 | +++ gmp-4.1.4/mpn/sh/add_n.s 2005/11/17 08:18:57 | ||
3 | @@ -29,8 +29,8 @@ | ||
4 | |||
5 | .text | ||
6 | .align 2 | ||
7 | - .global ___gmpn_add_n | ||
8 | -___gmpn_add_n: | ||
9 | + .global __gmpn_add_n | ||
10 | +__gmpn_add_n: | ||
11 | mov #0,r3 ! clear cy save reg | ||
12 | |||
13 | Loop: mov.l @r5+,r1 | ||
14 | --- gmp-4.1.4/mpn/sh/sub_n.s 2005/11/17 08:44:04 1.1 | ||
15 | +++ gmp-4.1.4/mpn/sh/sub_n.s 2005/11/17 08:18:59 | ||
16 | @@ -29,8 +29,8 @@ | ||
17 | |||
18 | .text | ||
19 | .align 2 | ||
20 | - .global ___gmpn_sub_n | ||
21 | -___gmpn_sub_n: | ||
22 | + .global __gmpn_sub_n | ||
23 | +__gmpn_sub_n: | ||
24 | mov #0,r3 ! clear cy save reg | ||
25 | |||
26 | Loop: mov.l @r5+,r1 | ||
diff --git a/meta/recipes-devtools/gmp/gmp/use-includedir.patch b/meta/recipes-devtools/gmp/gmp/use-includedir.patch deleted file mode 100644 index ee3891f807..0000000000 --- a/meta/recipes-devtools/gmp/gmp/use-includedir.patch +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | Index: gmp-4.2.4/Makefile.am | ||
2 | =================================================================== | ||
3 | --- gmp-4.2.4.orig/Makefile.am 2008-09-10 19:31:27.000000000 +0000 | ||
4 | +++ gmp-4.2.4/Makefile.am 2009-07-06 20:19:19.000000000 +0000 | ||
5 | @@ -106,7 +106,7 @@ | ||
6 | # but anyone knowledgable enough to be playing with exec_prefix will be able | ||
7 | # to address that. | ||
8 | # | ||
9 | -includeexecdir = $(exec_prefix)/include | ||
10 | +includeexecdir = $(includedir) | ||
11 | include_HEADERS = $(GMPXX_HEADERS_OPTION) | ||
12 | nodist_includeexec_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION) | ||
13 | lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION) | ||
diff --git a/meta/recipes-devtools/gmp/gmp_4.2.1.bb b/meta/recipes-devtools/gmp/gmp_4.2.1.bb deleted file mode 100644 index d70dcf2665..0000000000 --- a/meta/recipes-devtools/gmp/gmp_4.2.1.bb +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers" | ||
2 | HOMEPAGE = "http://gmplib.org/" | ||
3 | BUGTRACKER = "http://gmplib.org/mailman/listinfo/gmp-bugs" | ||
4 | # demo is licensed under GPLv2+, which however we don't package at all | ||
5 | LICENSE = "LGPLv2.1+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \ | ||
7 | file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \ | ||
8 | file://gmp-h.in;startline=6;endline=21;md5=5e25ffd16996faba8c1cd27b04b16099" | ||
9 | PR = "r0" | ||
10 | |||
11 | SRC_URI = "ftp://ftp.gnu.org/gnu/gmp/${BP}.tar.bz2 \ | ||
12 | file://disable-stdc.patch" | ||
13 | |||
14 | inherit autotools | ||
diff --git a/meta/recipes-devtools/gmp/gmp_5.0.1.bb b/meta/recipes-devtools/gmp/gmp_5.0.1.bb deleted file mode 100644 index dd908bd7ca..0000000000 --- a/meta/recipes-devtools/gmp/gmp_5.0.1.bb +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | require gmp.inc | ||
2 | |||
3 | PR = "r0" | ||
4 | |||
5 | SRC_URI_append += "file://sh4-asmfix.patch \ | ||
6 | file://use-includedir.patch " | ||
7 | |||
diff --git a/meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch b/meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch new file mode 100644 index 0000000000..9b0081307a --- /dev/null +++ b/meta/recipes-devtools/insserv/files/40_segfault_virtprov.dpatch | |||
@@ -0,0 +1,89 @@ | |||
1 | #! /bin/sh /usr/share/dpatch/dpatch-run | ||
2 | ## 40_segfault_virtprov.dpatch by Petter Reinholdtsen | ||
3 | |||
4 | Avoid segfault when an enabled service provide a virtual system | ||
5 | facility. | ||
6 | |||
7 | @DPATCH@ | ||
8 | --- insserv/insserv.c | ||
9 | +++ insserv/insserv.c 2008-02-01 11:43:45.634618329 +0100 | ||
10 | @@ -166,7 +166,7 @@ typedef struct pwd_struct { | ||
11 | |||
12 | static list_t pwd = { &(pwd), &(pwd) }, * topd = &(pwd); | ||
13 | |||
14 | -static void pushd(const char *const __restrict path); | ||
15 | +static void pushd(const char *const __restrict path) __attribute__((nonnull(1))); | ||
16 | static void pushd(const char *const path) | ||
17 | { | ||
18 | pwd_t * dir; | ||
19 | @@ -305,13 +305,13 @@ out: | ||
20 | return getserv(ptr); | ||
21 | } | ||
22 | |||
23 | -static serv_t * findserv(const char *const __restrict serv) __attribute__((nonnull(1))); | ||
24 | +static serv_t * findserv(const char *const __restrict serv); | ||
25 | static serv_t * findserv(const char *const serv) | ||
26 | { | ||
27 | list_t * ptr; | ||
28 | serv_t * ret = (serv_t*)0; | ||
29 | |||
30 | - if (!serv) | ||
31 | + if (serv == (const char*)0) | ||
32 | goto out; | ||
33 | |||
34 | list_for_each(ptr, serv_start) { | ||
35 | @@ -334,6 +334,9 @@ static void rememberreq(serv_t *serv, ui | ||
36 | list_t * ptr; | ||
37 | uint old = bit; | ||
38 | |||
39 | + if (!tmp) | ||
40 | + error("%s", strerror(errno)); | ||
41 | + | ||
42 | while ((token = strsep(&tmp, delimeter))) { | ||
43 | boolean found = false; | ||
44 | req_t * this; | ||
45 | @@ -399,6 +402,9 @@ static void reversereq(const serv_t * se | ||
46 | char * rev = strdupa(list); | ||
47 | uint old = bit; | ||
48 | |||
49 | + if (!rev) | ||
50 | + error("%s", strerror(errno)); | ||
51 | + | ||
52 | while ((dep = strsep(&rev, delimeter)) && *dep) { | ||
53 | serv_t * tmp; | ||
54 | list_t * ptr; | ||
55 | @@ -437,7 +443,7 @@ static void reversereq(const serv_t * se | ||
56 | /* | ||
57 | * Check required services for name | ||
58 | */ | ||
59 | -static boolean chkrequired(const char *const __restrict name) __attribute__((nonnull(1))); | ||
60 | +static boolean chkrequired(const char *const __restrict name); | ||
61 | static boolean chkrequired(const char *const name) | ||
62 | { | ||
63 | serv_t * serv = findserv(name); | ||
64 | --- insserv/listing.h | ||
65 | +++ insserv/listing.h 2008-02-01 11:40:45.347748072 +0100 | ||
66 | @@ -97,11 +97,11 @@ extern int makeprov(const char *__restri | ||
67 | extern void setorder(const char *__restrict script, const int order, boolean recursive) __attribute__((nonnull(1))); | ||
68 | extern int getorder(const char *__restrict script) __attribute__((nonnull(1))); | ||
69 | extern boolean notincluded(const char *__restrict script, const int runlevel) __attribute__((nonnull(1))); | ||
70 | -extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(1,2))); | ||
71 | -extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1,2))); | ||
72 | +extern boolean foreach(const char **__restrict script, int *__restrict order, const int runlevel) __attribute__((nonnull(2))); | ||
73 | +extern void virtprov(const char *__restrict virt, const char *__restrict real) __attribute__((nonnull(1))); | ||
74 | extern const char * getscript(const char *__restrict prov) __attribute__((nonnull(1))); | ||
75 | extern const char * getprovides(const char *__restrict script) __attribute__((nonnull(1))); | ||
76 | -extern boolean listscripts(const char **__restrict script, const int lvl) __attribute__((nonnull(1))); | ||
77 | +extern boolean listscripts(const char **__restrict script, const int lvl); | ||
78 | extern int maxorder; | ||
79 | extern boolean is_loop_detected(void); | ||
80 | |||
81 | @@ -116,7 +116,7 @@ extern int map_has_runlevels(void); | ||
82 | extern int map_runlevel_to_lvl (const int runlevel); | ||
83 | extern int map_key_to_lvl(const char key); | ||
84 | |||
85 | -static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline,nonnull(1))); | ||
86 | +static inline char * xstrdup(const char *__restrict s) __attribute__((always_inline)); | ||
87 | static inline char * xstrdup(const char * s) | ||
88 | { | ||
89 | char * r; | ||
diff --git a/meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch b/meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch new file mode 100644 index 0000000000..4a15f58312 --- /dev/null +++ b/meta/recipes-devtools/insserv/files/42_loopnochangemsg.dpatch | |||
@@ -0,0 +1,20 @@ | |||
1 | #! /bin/sh /usr/share/dpatch/dpatch-run | ||
2 | ## 40_loopnochangemsg.dpatch by Petter Reinholdtsen | ||
3 | |||
4 | Make it more obvious that introducing a loop will not change the | ||
5 | existing boot sequence. Thanks to Frans Pop for the rationale for | ||
6 | this change. | ||
7 | |||
8 | @DPATCH@ | ||
9 | |||
10 | --- insserv-1.11.0.orig/insserv.c | ||
11 | +++ insserv-1.11.0/insserv.c | ||
12 | @@ -2647,7 +2647,7 @@ | ||
13 | follow_all(); | ||
14 | |||
15 | if (is_loop_detected() && !ignore) | ||
16 | - error("exiting now!\n"); | ||
17 | + error("exiting without changing boot order!\n"); | ||
18 | |||
19 | /* | ||
20 | * Re-order some well known scripts to get | ||
diff --git a/meta/recipes-devtools/insserv/files/crosscompile_fix.patch b/meta/recipes-devtools/insserv/files/crosscompile_fix.patch new file mode 100644 index 0000000000..14d8db468f --- /dev/null +++ b/meta/recipes-devtools/insserv/files/crosscompile_fix.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | Index: insserv-1.11.0/Makefile | ||
2 | =================================================================== | ||
3 | --- insserv-1.11.0.orig/Makefile 2008-08-25 16:00:00.000000000 +0100 | ||
4 | +++ insserv-1.11.0/Makefile 2008-08-25 16:00:25.000000000 +0100 | ||
5 | @@ -18,16 +18,7 @@ | ||
6 | # | ||
7 | # Architecture | ||
8 | # | ||
9 | -ifdef RPM_OPT_FLAGS | ||
10 | - COPTS = -g $(RPM_OPT_FLAGS) | ||
11 | -else | ||
12 | - ARCH = $(shell uname -i) | ||
13 | -ifeq ($(ARCH),i386) | ||
14 | - COPTS = -O2 -mcpu=i586 -mtune=i686 | ||
15 | -else | ||
16 | - COPTS = -O2 | ||
17 | -endif | ||
18 | -endif | ||
19 | +COPTS = -O2 | ||
20 | COPTS += -g | ||
21 | |||
22 | MY_CFLAGS = $(CFLAGS) -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ | ||
diff --git a/meta/recipes-devtools/insserv/files/insserv.conf b/meta/recipes-devtools/insserv/files/insserv.conf new file mode 100644 index 0000000000..4858f85b69 --- /dev/null +++ b/meta/recipes-devtools/insserv/files/insserv.conf | |||
@@ -0,0 +1,41 @@ | |||
1 | # | ||
2 | # All local filesystems are mounted (done during boot phase) | ||
3 | # | ||
4 | $local_fs mountall | ||
5 | |||
6 | # | ||
7 | # Low level networking (ethernet card) | ||
8 | # | ||
9 | $network networking +pcmcia +hotplug | ||
10 | |||
11 | # | ||
12 | # Named is operational | ||
13 | # | ||
14 | $named +named +dnsmasq +lwresd $network | ||
15 | |||
16 | # | ||
17 | # All remote filesystems are mounted (note in some cases /usr may | ||
18 | # be remote. Most applications that care will probably require | ||
19 | # both $local_fs and $remote_fs) | ||
20 | # | ||
21 | $remote_fs $local_fs +mountnfs | ||
22 | |||
23 | # | ||
24 | # System logger is operational | ||
25 | # | ||
26 | $syslog sysklogd | ||
27 | |||
28 | # | ||
29 | # SunRPC portmapper available | ||
30 | # | ||
31 | $portmap portmap | ||
32 | |||
33 | # | ||
34 | # The system time has been set correctly | ||
35 | # | ||
36 | $time hwclock | ||
37 | |||
38 | # | ||
39 | # Services which need to be interactive | ||
40 | # | ||
41 | <interactive> hostname udev | ||
diff --git a/meta/recipes-devtools/insserv/files/make.patch b/meta/recipes-devtools/insserv/files/make.patch new file mode 100644 index 0000000000..bb3b51a8ca --- /dev/null +++ b/meta/recipes-devtools/insserv/files/make.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | === modified file 'Makefile' | ||
2 | --- old/Makefile 2008-06-24 14:49:47 +0000 | ||
3 | +++ new/Makefile 2008-06-24 15:56:15 +0000 | ||
4 | @@ -7,10 +7,10 @@ | ||
5 | INITDIR = /etc/init.d | ||
6 | INSCONF = /etc/insserv.conf | ||
7 | #DESTDIR = /tmp/root | ||
8 | -#DEBUG = -DDEBUG=1 -Wpacked | ||
9 | +DEBUG = -DDEBUG=1 -Wpacked | ||
10 | #LOOPS = -DIGNORE_LOOPS=1 | ||
11 | DEBUG = | ||
12 | -ISSUSE = -DSUSE | ||
13 | +#ISSUSE = -DSUSE | ||
14 | DESTDIR = | ||
15 | VERSION = 1.11.0 | ||
16 | DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]') | ||
17 | @@ -28,7 +28,9 @@ | ||
18 | COPTS = -O2 | ||
19 | endif | ||
20 | endif | ||
21 | - CFLAGS = -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ | ||
22 | +COPTS += -g | ||
23 | + | ||
24 | + MY_CFLAGS = $(CFLAGS) -Wall $(COPTS) $(DEBUG) $(LOOPS) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ | ||
25 | $(ISSUSE) -DINITDIR=\"$(INITDIR)\" -DINSCONF=\"$(INSCONF)\" -pipe | ||
26 | CLOOP = -falign-loops=0 | ||
27 | CC = gcc | ||
28 | @@ -58,13 +60,13 @@ | ||
29 | all: $(TODO) | ||
30 | |||
31 | listing.o: listing.c listing.h .system | ||
32 | - $(CC) $(CFLAGS) $(CLOOP) -c $< | ||
33 | + $(CC) $(MY_CFLAGS) $(CLOOP) -c $< | ||
34 | |||
35 | insserv.o: insserv.c listing.h .system | ||
36 | - $(CC) $(CFLAGS) $(CLOOP) -c $< | ||
37 | + $(CC) $(MY_CFLAGS) $(CLOOP) -c $< | ||
38 | |||
39 | insserv: insserv.o listing.o | ||
40 | - $(CC) $(CFLAGS) -Wl,-O,3,--relax -o $@ $^ | ||
41 | + $(CC) $(MY_CFLAGS) -Wl,-O,3,--relax -o $@ $^ | ||
42 | |||
43 | ifeq ($(ISSUSE),-DSUSE) | ||
44 | insserv.8: insserv.8.in .system | ||
45 | @@ -86,10 +88,10 @@ | ||
46 | -include .depend.listing .depend.insserv | ||
47 | |||
48 | .depend.listing: | ||
49 | - @$(CC) $(CFLAGS) -M listing.c >$@ 2>/dev/null | ||
50 | + @$(CC) $(MY_CFLAGS) -M listing.c >$@ 2>/dev/null | ||
51 | |||
52 | .depend.insserv: | ||
53 | - @$(CC) $(CFLAGS) -M insserv.c >$@ 2>/dev/null | ||
54 | + @$(CC) $(MY_CFLAGS) -M insserv.c >$@ 2>/dev/null | ||
55 | |||
56 | install: $(TODO) | ||
57 | $(MKDIR) $(SBINDIR) | ||
58 | |||
diff --git a/meta/recipes-devtools/insserv/insserv_1.11.0.bb b/meta/recipes-devtools/insserv/insserv_1.11.0.bb new file mode 100644 index 0000000000..a45ccda48f --- /dev/null +++ b/meta/recipes-devtools/insserv/insserv_1.11.0.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | LICENSE = "GPL" | ||
2 | SECTION = "base" | ||
3 | PR = "r1" | ||
4 | |||
5 | SRC_URI = "ftp://ftp.suse.com/pub/projects/init/${BPN}-${PV}.tar.gz \ | ||
6 | file://40_segfault_virtprov.dpatch;patch=1 \ | ||
7 | file://42_loopnochangemsg.dpatch;patch=1 \ | ||
8 | file://make.patch;patch=1 \ | ||
9 | file://crosscompile_fix.patch;patch=1 \ | ||
10 | file://insserv.conf" | ||
11 | |||
12 | do_install () { | ||
13 | oe_runmake 'DESTDIR=${D}' install | ||
14 | install -m0644 ${WORKDIR}/insserv.conf ${D}${sysconfdir}/insserv.conf | ||
15 | } | ||
16 | |||
17 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/intltool/intltool-0.40.6/intltool-nowarn-0.40.0.patch b/meta/recipes-devtools/intltool/intltool-0.40.6/intltool-nowarn-0.40.0.patch new file mode 100644 index 0000000000..61ecba266e --- /dev/null +++ b/meta/recipes-devtools/intltool/intltool-0.40.6/intltool-nowarn-0.40.0.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | Index: intltool-0.40.0/intltool-extract.in | ||
2 | =================================================================== | ||
3 | --- intltool-0.40.0.orig/intltool-extract.in 2008-12-17 11:50:19.000000000 +0000 | ||
4 | +++ intltool-0.40.0/intltool-extract.in 2008-12-17 11:50:31.000000000 +0000 | ||
5 | @@ -1,4 +1,4 @@ | ||
6 | -#!@INTLTOOL_PERL@ -w | ||
7 | +#!@INTLTOOL_PERL@ | ||
8 | # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
9 | |||
10 | # | ||
11 | Index: intltool-0.40.0/intltool-merge.in | ||
12 | =================================================================== | ||
13 | --- intltool-0.40.0.orig/intltool-merge.in 2008-12-17 11:50:19.000000000 +0000 | ||
14 | +++ intltool-0.40.0/intltool-merge.in 2008-12-17 11:50:38.000000000 +0000 | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#!@INTLTOOL_PERL@ -w | ||
17 | +#!@INTLTOOL_PERL@ | ||
18 | # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
19 | |||
20 | # | ||
21 | Index: intltool-0.40.0/intltool-prepare.in | ||
22 | =================================================================== | ||
23 | --- intltool-0.40.0.orig/intltool-prepare.in 2008-12-17 11:50:19.000000000 +0000 | ||
24 | +++ intltool-0.40.0/intltool-prepare.in 2008-12-17 11:50:42.000000000 +0000 | ||
25 | @@ -1,4 +1,4 @@ | ||
26 | -#!@INTLTOOL_PERL@ -w | ||
27 | +#!@INTLTOOL_PERL@ | ||
28 | # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
29 | |||
30 | # Intltool .desktop, .directory Prepare Tool | ||
31 | Index: intltool-0.40.0/intltool-unicodify.in | ||
32 | =================================================================== | ||
33 | --- intltool-0.40.0.orig/intltool-unicodify.in 2008-12-17 11:50:19.000000000 +0000 | ||
34 | +++ intltool-0.40.0/intltool-unicodify.in 2008-12-17 11:50:46.000000000 +0000 | ||
35 | @@ -1,4 +1,4 @@ | ||
36 | -#!@INTLTOOL_PERL@ -w | ||
37 | +#!@INTLTOOL_PERL@ | ||
38 | |||
39 | # | ||
40 | # The i18n Unicode Encoding Utility | ||
41 | Index: intltool-0.40.0/intltool-update.in | ||
42 | =================================================================== | ||
43 | --- intltool-0.40.0.orig/intltool-update.in 2008-12-17 11:50:19.000000000 +0000 | ||
44 | +++ intltool-0.40.0/intltool-update.in 2008-12-17 11:50:49.000000000 +0000 | ||
45 | @@ -1,4 +1,4 @@ | ||
46 | -#!@INTLTOOL_PERL@ -w | ||
47 | +#!@INTLTOOL_PERL@ | ||
48 | # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
49 | |||
50 | # | ||
diff --git a/meta/recipes-devtools/intltool/intltool.inc b/meta/recipes-devtools/intltool/intltool.inc new file mode 100644 index 0000000000..f9bdf93b7b --- /dev/null +++ b/meta/recipes-devtools/intltool/intltool.inc | |||
@@ -0,0 +1,17 @@ | |||
1 | DESCRIPTION = "Utility scripts for internationalizing XML" | ||
2 | PRIORITY = "optional" | ||
3 | SECTION = "devel" | ||
4 | LICENSE = "GPL" | ||
5 | |||
6 | URLV="${@'.'.join(bb.data.getVar('PV',d,1).split('.')[0:2])}" | ||
7 | SRC_URI = "${GNOME_MIRROR}/intltool/${URLV}/intltool-${PV}.tar.bz2" | ||
8 | S = "${WORKDIR}/intltool-${PV}" | ||
9 | |||
10 | DEPENDS = "libxml-parser-perl-native" | ||
11 | #RDEPENDS = "libxml-parser-perl" | ||
12 | RRECOMMENDS = "perl-modules" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
15 | |||
16 | export PERL_virtclass-native = "/usr/bin/env perl" | ||
17 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/intltool/intltool_0.40.6.bb b/meta/recipes-devtools/intltool/intltool_0.40.6.bb new file mode 100644 index 0000000000..1f23a41f89 --- /dev/null +++ b/meta/recipes-devtools/intltool/intltool_0.40.6.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | require intltool.inc | ||
2 | |||
3 | PR = "r0" | ||
4 | |||
5 | SRC_URI_append = " file://intltool-nowarn-0.40.0.patch" | ||
diff --git a/meta/recipes-devtools/mpfr/mpfr.inc b/meta/recipes-devtools/mpfr/mpfr.inc deleted file mode 100644 index dbb859fe3e..0000000000 --- a/meta/recipes-devtools/mpfr/mpfr.inc +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | DESCRIPTION = "A C library for multiple-precision floating-point computations with exact rounding" | ||
2 | HOMEPAGE = "http://www.mpfr.org/" | ||
3 | LICENSE = "LGPLv3+" | ||
4 | SECTION = "devel" | ||
5 | |||
6 | inherit autotools | ||
diff --git a/meta/recipes-devtools/mpfr/mpfr_3.0.0.bb b/meta/recipes-devtools/mpfr/mpfr_3.0.0.bb deleted file mode 100644 index 188a5d95cd..0000000000 --- a/meta/recipes-devtools/mpfr/mpfr_3.0.0.bb +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | require mpfr.inc | ||
2 | |||
3 | DEPENDS = "gmp" | ||
4 | PR = "r0" | ||
5 | |||
6 | SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.bz2" | ||
7 | S = "${WORKDIR}/mpfr-${PV}" | ||
8 | |||
9 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta/recipes-devtools/nasm/nasm_2.07.bb b/meta/recipes-devtools/nasm/nasm_2.07.bb new file mode 100644 index 0000000000..4e482a04d6 --- /dev/null +++ b/meta/recipes-devtools/nasm/nasm_2.07.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | DESCRIPTION = "General-purpose x86 assembler" | ||
2 | SECTION = "devel" | ||
3 | LICENSE = "simplifiedBSD" | ||
4 | LIC_CHKSUM_FILES = "file://LICENSE;md5=d89d124974e487e5d64da6f1cd8acfbb" | ||
5 | COMPATIBLE_HOST = '(x86_64|i.86.*)-(linux|freebsd.*)' | ||
6 | |||
7 | PR = "r0" | ||
8 | |||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/nasm/nasm-${PV}.tar.bz2 " | ||
10 | |||
11 | inherit autotools | ||
12 | |||
13 | do_configure_prepend () { | ||
14 | mv aclocal.m4 acinclude.m4 | ||
15 | } | ||
16 | |||
17 | do_install() { | ||
18 | install -d ${D}${bindir} | ||
19 | install -d ${D}${mandir}/man1 | ||
20 | |||
21 | oe_runmake 'INSTALLROOT=${D}' install | ||
22 | } | ||
23 | |||
24 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf b/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf new file mode 100644 index 0000000000..845f5b33f5 --- /dev/null +++ b/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf | |||
@@ -0,0 +1,15 @@ | |||
1 | # /etc/rsyncd.conf | ||
2 | |||
3 | # Minimal configuration file for rsync daemon | ||
4 | # See rsync(1) and rsyncd.conf(5) man pages for help | ||
5 | |||
6 | # This file is required by rsync --daemon | ||
7 | pid file = /var/run/rsyncd.pid | ||
8 | use chroot = yes | ||
9 | read only = yes | ||
10 | |||
11 | # Simple example for enabling your own local rsync server | ||
12 | #[everything] | ||
13 | # path = / | ||
14 | # comment = Everything except /etc exposed | ||
15 | # exclude = /etc | ||
diff --git a/meta/recipes-devtools/strace/strace_4.5.20.bb b/meta/recipes-devtools/strace/strace_4.5.20.bb new file mode 100644 index 0000000000..cc2ae1a964 --- /dev/null +++ b/meta/recipes-devtools/strace/strace_4.5.20.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | DESCRIPTION = "strace is a system call tracing tool." | ||
2 | HOMEPAGE = "http://sourceforge.net/projects/strace/" | ||
3 | SECTION = "console/utils" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=4535377ede62550fdeaf39f595fd550a" | ||
6 | PR = "r0" | ||
7 | |||
8 | SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.bz2" | ||
9 | inherit autotools | ||
10 | |||
11 | export INCLUDES = "-I. -I./linux" | ||
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch new file mode 100644 index 0000000000..fa9e458714 --- /dev/null +++ b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_tcf-agent.init.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | --- a/Makefile | ||
2 | +++ b/Makefile | ||
3 | @@ -32,7 +32,7 @@ | ||
4 | install -d -m 755 $(INSTALLROOT)$(SBIN) | ||
5 | install -d -m 755 $(INSTALLROOT)$(INIT) | ||
6 | install -c $(BINDIR)/agent -m 755 $(INSTALLROOT)$(SBIN)/tcf-agent | ||
7 | - install -c $(TCF_AGENT_DIR)/main/tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent | ||
8 | + install -c tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent | ||
9 | |||
10 | clean: | ||
11 | rm -rf $(BINDIR) | ||
12 | --- /dev/null | ||
13 | +++ b/tcf-agent.init | ||
14 | @@ -0,0 +1,78 @@ | ||
15 | +#!/bin/sh | ||
16 | +### BEGIN INIT INFO | ||
17 | +# Provides: tcf-agent | ||
18 | +# Default-Start: 3 5 | ||
19 | +# Default-Stop: 0 1 2 6 | ||
20 | +# Short-Description: Target Communication Framework agent | ||
21 | +### END INIT INFO | ||
22 | + | ||
23 | +DAEMON_PATH=/usr/sbin/tcf-agent | ||
24 | +DAEMON_NAME=`basename $DAEMON_PATH` | ||
25 | + | ||
26 | +. /etc/init.d/functions | ||
27 | + | ||
28 | +test -x $DAEMON_PATH || exit 0 | ||
29 | + | ||
30 | +PATH=/sbin:/usr/sbin:/bin:/usr/bin | ||
31 | +export PATH | ||
32 | + | ||
33 | +RETVAL=0 | ||
34 | + | ||
35 | +case "$1" in | ||
36 | + start) | ||
37 | + echo -n "Starting $DAEMON_NAME: " | ||
38 | + $DAEMON_PATH -d -L- -l0 | ||
39 | + RETVAL=$? | ||
40 | + if [ $RETVAL -eq 0 ] ; then | ||
41 | + echo "OK" | ||
42 | + touch /var/lock/subsys/$DAEMON_NAME | ||
43 | + else | ||
44 | + echo "FAIL" | ||
45 | + fi | ||
46 | + ;; | ||
47 | + | ||
48 | + stop) | ||
49 | + echo -n "Stopping $DAEMON_NAME: " | ||
50 | + count=0 | ||
51 | + while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do | ||
52 | + killproc $DAEMON_PATH >& /dev/null | ||
53 | + sleep 1 | ||
54 | + RETVAL=$? | ||
55 | + if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then | ||
56 | + sleep 3 | ||
57 | + fi | ||
58 | + count=`expr $count + 1` | ||
59 | + done | ||
60 | + rm -f /var/lock/subsys/$DAEMON_NAME | ||
61 | + if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then | ||
62 | + echo "FAIL" | ||
63 | + else | ||
64 | + echo "OK" | ||
65 | + fi | ||
66 | + ;; | ||
67 | + | ||
68 | + restart) | ||
69 | + $0 stop | ||
70 | + sleep 1 | ||
71 | + $0 start | ||
72 | + ;; | ||
73 | + | ||
74 | + status) | ||
75 | + if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then | ||
76 | + echo "$DAEMON_NAME is running" | ||
77 | + else | ||
78 | + echo "$DAEMON_NAME is not running" | ||
79 | + fi | ||
80 | + ;; | ||
81 | + | ||
82 | + condrestart) | ||
83 | + [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart | ||
84 | + ;; | ||
85 | + | ||
86 | + *) | ||
87 | + echo "usage: $0 { start | stop | restart | condrestart | status }" | ||
88 | + ;; | ||
89 | +esac | ||
90 | + | ||
91 | +exit $RETVAL | ||
92 | + | ||
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/terminals_agent.patch b/meta/recipes-devtools/tcf-agent/tcf-agent/terminals_agent.patch new file mode 100644 index 0000000000..b88b5e70cd --- /dev/null +++ b/meta/recipes-devtools/tcf-agent/tcf-agent/terminals_agent.patch | |||
@@ -0,0 +1,1025 @@ | |||
1 | Index: org.eclipse.tm.tcf.terminals.agent/terminals.c | ||
2 | =================================================================== | ||
3 | --- org.eclipse.tm.tcf.terminals.agent/terminals.c (revision 0) | ||
4 | +++ org.eclipse.tm.tcf.terminals.agent/terminals.c (revision 0) | ||
5 | @@ -0,0 +1,846 @@ | ||
6 | +/******************************************************************************* | ||
7 | + * Copyright (c) 2008 Wind River Systems, Inc. and others. | ||
8 | + * All rights reserved. This program and the accompanying materials | ||
9 | + * are made available under the terms of the Eclipse Public License v1.0 | ||
10 | + * and Eclipse Distribution License v1.0 which accompany this distribution. | ||
11 | + * The Eclipse Public License is available at | ||
12 | + * http://www.eclipse.org/legal/epl-v10.html | ||
13 | + * and the Eclipse Distribution License is available at | ||
14 | + * http://www.eclipse.org/org/documents/edl-v10.php. | ||
15 | + * | ||
16 | + * Contributors: | ||
17 | + * Wind River Systems - initial API and implementation | ||
18 | + *******************************************************************************/ | ||
19 | + | ||
20 | +/* | ||
21 | + * Sample TCF service implementation. | ||
22 | + */ | ||
23 | + | ||
24 | +#include <config.h> | ||
25 | +#include <stdlib.h> | ||
26 | +#include <stdio.h> | ||
27 | +#include <string.h> | ||
28 | +#include <errno.h> | ||
29 | +#include <fcntl.h> | ||
30 | +#include <signal.h> | ||
31 | +#include <assert.h> | ||
32 | +#include <termios.h> | ||
33 | +#ifndef TIOCGWINSZ | ||
34 | +#include <sys/ioctl.h> | ||
35 | +#endif | ||
36 | +#include <framework/myalloc.h> | ||
37 | +#include <framework/protocol.h> | ||
38 | +#include <framework/trace.h> | ||
39 | +#include <framework/context.h> | ||
40 | +#include <framework/json.h> | ||
41 | +#include <framework/asyncreq.h> | ||
42 | +#include <framework/exceptions.h> | ||
43 | +#include <framework/waitpid.h> | ||
44 | +#include <framework/signames.h> | ||
45 | +#include <services/streamsservice.h> | ||
46 | +#include <terminals.h> | ||
47 | + | ||
48 | +#define TERMINALS_DEBUG 1 | ||
49 | + | ||
50 | +#define TERMINALS_NO_LOGIN 0 | ||
51 | + | ||
52 | +static const char * TERMINALS = "Terminals"; | ||
53 | + | ||
54 | +#if defined(WIN32) | ||
55 | +# include <tlhelp32.h> | ||
56 | +# ifdef _MSC_VER | ||
57 | +# pragma warning(disable:4201) /* nonstandard extension used : nameless struct/union (in winternl.h) */ | ||
58 | +# include <winternl.h> | ||
59 | +# else | ||
60 | +# include <ntdef.h> | ||
61 | +# endif | ||
62 | +# ifndef STATUS_INFO_LENGTH_MISMATCH | ||
63 | +# define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L) | ||
64 | +# endif | ||
65 | +# ifndef SystemHandleInformation | ||
66 | +# define SystemHandleInformation 16 | ||
67 | +# endif | ||
68 | +# error("unsupported WIN32!") | ||
69 | +#elif defined(_WRS_KERNEL) | ||
70 | +# include <symLib.h> | ||
71 | +# include <sysSymTbl.h> | ||
72 | +# include <ioLib.h> | ||
73 | +# include <ptyDrv.h> | ||
74 | +# include <taskHookLib.h> | ||
75 | +# error("unsupported WRS!") | ||
76 | +#else | ||
77 | +# include <sys/stat.h> | ||
78 | +# include <unistd.h> | ||
79 | +# include <dirent.h> | ||
80 | +# if TERMINALS_NO_LOGIN | ||
81 | +# define TERM_LAUNCH_EXEC "/bin/bash" | ||
82 | +# define TERM_LAUNCH_ARGS {TERM_LAUNCH_EXEC, NULL} | ||
83 | +# else | ||
84 | +# define TERM_LAUNCH_EXEC "/bin/login" | ||
85 | +# define TERM_LAUNCH_ARGS {TERM_LAUNCH_EXEC, "-p", NULL} | ||
86 | +# endif | ||
87 | +#endif | ||
88 | + | ||
89 | +#define PIPE_SIZE 0x1000 | ||
90 | +#define TERM_PROP_DEF_SIZE 256 | ||
91 | + | ||
92 | +typedef struct Terminal | ||
93 | +{ | ||
94 | + LINK link; | ||
95 | + int pid; /*pid of the login process of the terminal*/ | ||
96 | + TCFBroadcastGroup * bcg; | ||
97 | + int inp; | ||
98 | + int out; | ||
99 | + int err; | ||
100 | + struct TerminalInput * inp_struct; | ||
101 | + struct TerminalOutput * out_struct; | ||
102 | + struct TerminalOutput * err_struct; | ||
103 | + char inp_id[256]; | ||
104 | + char out_id[256]; | ||
105 | + char err_id[256]; | ||
106 | + | ||
107 | + char pty_type[TERM_PROP_DEF_SIZE]; | ||
108 | + char encoding[TERM_PROP_DEF_SIZE]; | ||
109 | + unsigned long width; | ||
110 | + unsigned long height; | ||
111 | + long exit_code; | ||
112 | + | ||
113 | + Channel *channel; | ||
114 | +} Terminal; | ||
115 | + | ||
116 | +typedef struct TerminalOutput | ||
117 | +{ | ||
118 | + Terminal * prs; | ||
119 | + AsyncReqInfo req; | ||
120 | + int req_posted; | ||
121 | + char buf[PIPE_SIZE]; | ||
122 | + size_t buf_pos; | ||
123 | + int eos; | ||
124 | + VirtualStream * vstream; | ||
125 | +} TerminalOutput; | ||
126 | + | ||
127 | +typedef struct TerminalInput | ||
128 | +{ | ||
129 | + Terminal * prs; | ||
130 | + AsyncReqInfo req; | ||
131 | + int req_posted; | ||
132 | + char buf[PIPE_SIZE]; | ||
133 | + size_t buf_pos; | ||
134 | + size_t buf_len; | ||
135 | + int eos; | ||
136 | + VirtualStream * vstream; | ||
137 | +} TerminalInput; | ||
138 | + | ||
139 | +#define link2term(A) ((Terminal *)((char *)(A) - offsetof(Terminal, link))) | ||
140 | + | ||
141 | +static LINK terms_list; | ||
142 | +#if defined(_WRS_KERNEL) | ||
143 | +static SEM_ID prs_list_lock = NULL; | ||
144 | +#endif | ||
145 | + | ||
146 | +static Terminal * find_terminal(int pid) | ||
147 | +{ | ||
148 | + LINK * qhp = &terms_list; | ||
149 | + LINK * qp = qhp->next; | ||
150 | + | ||
151 | + while (qp != qhp) { | ||
152 | + Terminal * prs = link2term(qp); | ||
153 | + if (prs->pid == pid) | ||
154 | + return prs; | ||
155 | + qp = qp->next; | ||
156 | + } | ||
157 | + return NULL; | ||
158 | +} | ||
159 | + | ||
160 | +static char * tid2id(int tid) | ||
161 | +{ | ||
162 | + static char s[64]; | ||
163 | + char * p = s + sizeof(s); | ||
164 | + unsigned long n = (long) tid; | ||
165 | + *(--p) = 0; | ||
166 | + do { | ||
167 | + *(--p) = (char) (n % 10 + '0'); | ||
168 | + n = n / 10; | ||
169 | + } while (n != 0); | ||
170 | + | ||
171 | + *(--p) = 'T'; | ||
172 | + return p; | ||
173 | +} | ||
174 | + | ||
175 | +static int id2tid(const char * id) | ||
176 | +{ | ||
177 | + int tid = 0; | ||
178 | + if (id == NULL) | ||
179 | + return 0; | ||
180 | + if (id[0] != 'T') | ||
181 | + return 0; | ||
182 | + if (id[1] == 0) | ||
183 | + return 0; | ||
184 | + tid = (unsigned) strtol(id + 1, (char **) &id, 10); | ||
185 | + if (id[0] != 0) | ||
186 | + return 0; | ||
187 | + return tid; | ||
188 | +} | ||
189 | + | ||
190 | +static void write_context(OutputStream * out, int tid) | ||
191 | +{ | ||
192 | + Terminal * prs = find_terminal(tid); | ||
193 | + | ||
194 | + write_stream(out, '{'); | ||
195 | + | ||
196 | + if (prs != NULL) { | ||
197 | + if (*prs->pty_type) { | ||
198 | + json_write_string(out, "PtyType"); | ||
199 | + write_stream(out, ':'); | ||
200 | + json_write_string(out, prs->pty_type); | ||
201 | + write_stream(out, ','); | ||
202 | + } | ||
203 | + | ||
204 | + if (*prs->encoding) { | ||
205 | + json_write_string(out, "Encoding"); | ||
206 | + write_stream(out, ':'); | ||
207 | + json_write_string(out, prs->encoding); | ||
208 | + write_stream(out, ','); | ||
209 | + } | ||
210 | + | ||
211 | + json_write_string(out, "Width"); | ||
212 | + write_stream(out, ':'); | ||
213 | + json_write_ulong(out, prs->width); | ||
214 | + write_stream(out, ','); | ||
215 | + | ||
216 | + json_write_string(out, "Height"); | ||
217 | + write_stream(out, ':'); | ||
218 | + json_write_ulong(out, prs->height); | ||
219 | + write_stream(out, ','); | ||
220 | + | ||
221 | + if (*prs->inp_id) { | ||
222 | + json_write_string(out, "StdInID"); | ||
223 | + write_stream(out, ':'); | ||
224 | + json_write_string(out, prs->inp_id); | ||
225 | + write_stream(out, ','); | ||
226 | + } | ||
227 | + if (*prs->out_id) { | ||
228 | + json_write_string(out, "StdOutID"); | ||
229 | + write_stream(out, ':'); | ||
230 | + json_write_string(out, prs->out_id); | ||
231 | + write_stream(out, ','); | ||
232 | + } | ||
233 | + if (*prs->err_id) { | ||
234 | + json_write_string(out, "StdErrID"); | ||
235 | + write_stream(out, ':'); | ||
236 | + json_write_string(out, prs->err_id); | ||
237 | + write_stream(out, ','); | ||
238 | + } | ||
239 | + } | ||
240 | + | ||
241 | + json_write_string(out, "ID"); | ||
242 | + write_stream(out, ':'); | ||
243 | + json_write_string(out, tid2id(tid)); | ||
244 | + | ||
245 | + write_stream(out, '}'); | ||
246 | +} | ||
247 | + | ||
248 | +static void send_event_terminal_exited(OutputStream * out, Terminal * prs) | ||
249 | +{ | ||
250 | + write_stringz(out, "E"); | ||
251 | + write_stringz(out, TERMINALS); | ||
252 | + write_stringz(out, "exited"); | ||
253 | + | ||
254 | + json_write_string(out, tid2id(prs->pid)); | ||
255 | + write_stream(out, 0); | ||
256 | + | ||
257 | + json_write_ulong(out, prs->exit_code); | ||
258 | + write_stream(out, 0); | ||
259 | + | ||
260 | + write_stream(out, MARKER_EOM); | ||
261 | +} | ||
262 | + | ||
263 | +static void send_event_terminal_win_size_changed(OutputStream * out, | ||
264 | + Terminal * prs) | ||
265 | +{ | ||
266 | + write_stringz(out, "E"); | ||
267 | + write_stringz(out, TERMINALS); | ||
268 | + write_stringz(out, "winSizeChanged"); | ||
269 | + | ||
270 | + json_write_string(out, tid2id(prs->pid)); | ||
271 | + write_stream(out, 0); | ||
272 | + | ||
273 | + json_write_long(out, prs->width); | ||
274 | + write_stream(out, 0); | ||
275 | + | ||
276 | + json_write_long(out, prs->height); | ||
277 | + write_stream(out, 0); | ||
278 | + | ||
279 | + write_stream(out, MARKER_EOM); | ||
280 | +} | ||
281 | + | ||
282 | +static int kill_term(Terminal *term) | ||
283 | +{ | ||
284 | + int err = 0; | ||
285 | + | ||
286 | +#if defined(WIN32) | ||
287 | + HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, term->pid); | ||
288 | + if (h == NULL) | ||
289 | + { | ||
290 | + err = set_win32_errno(GetLastError()); | ||
291 | + } | ||
292 | + else | ||
293 | + { | ||
294 | + if (!TerminateProcess(h, 1)) err = set_win32_errno(GetLastError()); | ||
295 | + if (!CloseHandle(h) && !err) err = set_win32_errno(GetLastError()); | ||
296 | + } | ||
297 | +#else | ||
298 | + if (kill(term->pid, SIGTERM) < 0) | ||
299 | + err = errno; | ||
300 | +#endif | ||
301 | + return err; | ||
302 | +} | ||
303 | + | ||
304 | +static void command_exit(char * token, Channel * c) | ||
305 | +{ | ||
306 | + int err = 0; | ||
307 | + char id[256]; | ||
308 | + unsigned tid; | ||
309 | + Terminal *term = NULL; | ||
310 | + | ||
311 | + json_read_string(&c->inp, id, sizeof(id)); | ||
312 | + if (read_stream(&c->inp) != 0) | ||
313 | + exception(ERR_JSON_SYNTAX); | ||
314 | + if (read_stream(&c->inp) != MARKER_EOM) | ||
315 | + exception(ERR_JSON_SYNTAX); | ||
316 | + | ||
317 | + tid = id2tid(id); | ||
318 | + write_stringz(&c->out, "R"); | ||
319 | + write_stringz(&c->out, token); | ||
320 | + | ||
321 | + if (tid == 0) { | ||
322 | + err = ERR_INV_CONTEXT; | ||
323 | + } else { | ||
324 | + term = find_terminal(tid); | ||
325 | + if (term == NULL) { | ||
326 | + err = ERR_INV_CONTEXT; | ||
327 | + } else { | ||
328 | + err = kill_term(term); | ||
329 | + } | ||
330 | + } | ||
331 | + | ||
332 | + write_errno(&c->out, err); | ||
333 | + write_stream(&c->out, MARKER_EOM); | ||
334 | +} | ||
335 | + | ||
336 | +static void terminal_exited(Terminal * prs) | ||
337 | +{ | ||
338 | + Trap trap; | ||
339 | + | ||
340 | + if (set_trap(&trap)) { | ||
341 | + send_event_terminal_exited(&prs->bcg->out, prs); | ||
342 | + clear_trap(&trap); | ||
343 | + } else { | ||
344 | + trace(LOG_ALWAYS, "Exception sending terminal exited event: %d %s", | ||
345 | + trap.error, errno_to_str(trap.error)); | ||
346 | + } | ||
347 | + | ||
348 | +#if defined(_WRS_KERNEL) | ||
349 | + semTake(prs_list_lock, WAIT_FOREVER); | ||
350 | +#endif | ||
351 | + list_remove(&prs->link); | ||
352 | + close(prs->inp); | ||
353 | + close(prs->out); | ||
354 | + if (prs->out != prs->err) | ||
355 | + close(prs->err); | ||
356 | + if (prs->inp_struct) { | ||
357 | + TerminalInput * inp = prs->inp_struct; | ||
358 | + if (!inp->req_posted) { | ||
359 | + virtual_stream_delete(inp->vstream); | ||
360 | + loc_free(inp); | ||
361 | + } else { | ||
362 | + inp->prs = NULL; | ||
363 | + } | ||
364 | + } | ||
365 | + if (prs->out_struct) | ||
366 | + prs->out_struct->prs = NULL; | ||
367 | + if (prs->err_struct) | ||
368 | + prs->err_struct->prs = NULL; | ||
369 | + loc_free(prs); | ||
370 | +#if defined(_WRS_KERNEL) | ||
371 | + semGive(prs_list_lock); | ||
372 | +#endif | ||
373 | +} | ||
374 | + | ||
375 | +static void terminal_input_streams_callback(VirtualStream * stream, | ||
376 | + int event_code, void * args) | ||
377 | +{ | ||
378 | + TerminalInput * inp = (TerminalInput *) args; | ||
379 | + | ||
380 | + assert(inp->vstream == stream); | ||
381 | + if (!inp->req_posted) { | ||
382 | + if (inp->buf_pos >= inp->buf_len && !inp->eos) { | ||
383 | + inp->buf_pos = inp->buf_len = 0; | ||
384 | + virtual_stream_get_data(stream, inp->buf, sizeof(inp->buf), | ||
385 | + &inp->buf_len, &inp->eos); | ||
386 | + } | ||
387 | + if (inp->buf_pos < inp->buf_len) { | ||
388 | + inp->req.u.fio.bufp = inp->buf + inp->buf_pos; | ||
389 | + inp->req.u.fio.bufsz = inp->buf_len - inp->buf_pos; | ||
390 | + inp->req_posted = 1; | ||
391 | + async_req_post(&inp->req); | ||
392 | + } | ||
393 | + } | ||
394 | +} | ||
395 | + | ||
396 | +static void write_terminal_input_done(void * x) | ||
397 | +{ | ||
398 | + AsyncReqInfo * req = (AsyncReqInfo *) x; | ||
399 | + TerminalInput * inp = (TerminalInput *) req->client_data; | ||
400 | + | ||
401 | + inp->req_posted = 0; | ||
402 | + if (inp->prs == NULL) { | ||
403 | + /* Process has exited */ | ||
404 | + virtual_stream_delete(inp->vstream); | ||
405 | + loc_free(inp); | ||
406 | + } else { | ||
407 | + int wr = inp->req.u.fio.rval; | ||
408 | + | ||
409 | + if (wr < 0) { | ||
410 | + int err = inp->req.error; | ||
411 | + trace(LOG_ALWAYS, "Can't write terminal input stream: %d %s", err, | ||
412 | + errno_to_str(err)); | ||
413 | + inp->buf_pos = inp->buf_len = 0; | ||
414 | + } else { | ||
415 | + inp->buf_pos += wr; | ||
416 | + } | ||
417 | + | ||
418 | + terminal_input_streams_callback(inp->vstream, 0, inp); | ||
419 | + } | ||
420 | +} | ||
421 | + | ||
422 | +static void write_terminal_input(Terminal * prs) | ||
423 | +{ | ||
424 | + TerminalInput * inp = prs->inp_struct = (TerminalInput *) loc_alloc_zero( | ||
425 | + sizeof(TerminalInput)); | ||
426 | + inp->prs = prs; | ||
427 | + inp->req.client_data = inp; | ||
428 | + inp->req.done = write_terminal_input_done; | ||
429 | + inp->req.type = AsyncReqWrite; | ||
430 | + inp->req.u.fio.fd = prs->inp; | ||
431 | + virtual_stream_create(TERMINALS, tid2id(prs->pid), PIPE_SIZE, | ||
432 | + VS_ENABLE_REMOTE_WRITE, terminal_input_streams_callback, inp, | ||
433 | + &inp->vstream); | ||
434 | + virtual_stream_get_id(inp->vstream, prs->inp_id, sizeof(prs->inp_id)); | ||
435 | +} | ||
436 | + | ||
437 | +static void terminal_output_streams_callback(VirtualStream * stream, | ||
438 | + int event_code, void * args) | ||
439 | +{ | ||
440 | + TerminalOutput * out = (TerminalOutput *) args; | ||
441 | + | ||
442 | + assert(out->vstream == stream); | ||
443 | + if (!out->req_posted) { | ||
444 | + int buf_len = out->req.u.fio.rval; | ||
445 | + int err = 0; | ||
446 | + int eos = 0; | ||
447 | + | ||
448 | + if (buf_len < 0) { | ||
449 | + buf_len = 0; | ||
450 | + err = out->req.error; | ||
451 | + } | ||
452 | + if (buf_len == 0) | ||
453 | + eos = 1; | ||
454 | + if (out->prs == NULL) { | ||
455 | + eos = 1; | ||
456 | + err = 0; | ||
457 | + } | ||
458 | + | ||
459 | + assert(buf_len <= (int)sizeof(out->buf)); | ||
460 | + assert(out->buf_pos <= (size_t)buf_len); | ||
461 | + assert(out->req.u.fio.bufp == out->buf); | ||
462 | +#ifdef __linux__ | ||
463 | + if (err == EIO) | ||
464 | + err = 0; | ||
465 | +#endif | ||
466 | + if (err) | ||
467 | + trace(LOG_ALWAYS, "Can't read terminal output stream: %d %s", err, | ||
468 | + errno_to_str(err)); | ||
469 | + | ||
470 | + if (out->buf_pos < (size_t) buf_len || out->eos != eos) { | ||
471 | + size_t done = 0; | ||
472 | + virtual_stream_add_data(stream, out->buf + out->buf_pos, buf_len | ||
473 | + - out->buf_pos, &done, eos); | ||
474 | + out->buf_pos += done; | ||
475 | + if (eos) | ||
476 | + out->eos = 1; | ||
477 | + } | ||
478 | + | ||
479 | + if (out->buf_pos >= (size_t) buf_len) { | ||
480 | + if (!eos) { | ||
481 | + out->req_posted = 1; | ||
482 | + async_req_post(&out->req); | ||
483 | + } else if (virtual_stream_is_empty(stream)) { | ||
484 | + if (out->prs != NULL) { | ||
485 | + if (out == out->prs->out_struct) | ||
486 | + out->prs->out_struct = NULL; | ||
487 | + if (out == out->prs->err_struct) | ||
488 | + out->prs->err_struct = NULL; | ||
489 | + } | ||
490 | + virtual_stream_delete(stream); | ||
491 | + loc_free(out); | ||
492 | + } | ||
493 | + } | ||
494 | + } // end if(!out->req_posted) | ||
495 | +} | ||
496 | + | ||
497 | +static void read_terminal_output_done(void * x) | ||
498 | +{ | ||
499 | + AsyncReqInfo * req = (AsyncReqInfo *) x; | ||
500 | + TerminalOutput * out = (TerminalOutput *) req->client_data; | ||
501 | + | ||
502 | + out->buf_pos = 0; | ||
503 | + out->req_posted = 0; | ||
504 | + terminal_output_streams_callback(out->vstream, 0, out); | ||
505 | +} | ||
506 | + | ||
507 | +static TerminalOutput * read_terminal_output(Terminal * prs, int fd, char * id, | ||
508 | + size_t id_size) | ||
509 | +{ | ||
510 | + TerminalOutput * out = (TerminalOutput *) loc_alloc_zero( | ||
511 | + sizeof(TerminalOutput)); | ||
512 | + out->prs = prs; | ||
513 | + out->req.client_data = out; | ||
514 | + out->req.done = read_terminal_output_done; | ||
515 | + out->req.type = AsyncReqRead; | ||
516 | + out->req.u.fio.bufp = out->buf; | ||
517 | + out->req.u.fio.bufsz = sizeof(out->buf); | ||
518 | + out->req.u.fio.fd = fd; | ||
519 | + virtual_stream_create(TERMINALS, tid2id(prs->pid), PIPE_SIZE, | ||
520 | + VS_ENABLE_REMOTE_READ, terminal_output_streams_callback, out, | ||
521 | + &out->vstream); | ||
522 | + virtual_stream_get_id(out->vstream, id, id_size); | ||
523 | + out->req_posted = 1; | ||
524 | + async_req_post(&out->req); | ||
525 | + return out; | ||
526 | +} | ||
527 | + | ||
528 | +static char **envp_add(char **old_envp, int old_envp_len, char *env) | ||
529 | +{ | ||
530 | + char **new_envp = NULL; | ||
531 | + int i; | ||
532 | + int env_size; | ||
533 | + int old_envp_size; | ||
534 | + | ||
535 | + assert(old_envp || (old_envp==NULL && old_envp_len==0)); | ||
536 | + assert(env); | ||
537 | + assert(*env); | ||
538 | + | ||
539 | + for (i = 0, old_envp_size = 0; i < old_envp_len; i++) { | ||
540 | + old_envp_size += sizeof(char *); //size of env pointer | ||
541 | + old_envp_size += strlen(old_envp[i]) + 1; //size of env string, including trailing '\0' | ||
542 | + } | ||
543 | + assert((old_envp && old_envp[i]==NULL) || (old_envp==NULL)); | ||
544 | + old_envp_size += sizeof(char *);//last null pointer | ||
545 | + | ||
546 | + env_size = strlen(env); //new env string size | ||
547 | + | ||
548 | + new_envp = loc_alloc(old_envp_size + sizeof(char *) + env_size + 1); | ||
549 | + if (new_envp != NULL) { | ||
550 | + new_envp[0] = (char *) new_envp + old_envp_size + sizeof(char *); //setting new env ptr | ||
551 | + strcpy(new_envp[0], env); //copy new env string | ||
552 | + if (old_envp) { | ||
553 | + memcpy(&new_envp[1], old_envp, old_envp_size); //copy old envp | ||
554 | + } else { | ||
555 | + new_envp[1] = NULL; | ||
556 | + } | ||
557 | + } | ||
558 | + return new_envp; | ||
559 | +} | ||
560 | + | ||
561 | +static int start_terminal(Channel * c, char *pty_type, char *encoding, | ||
562 | + char ** envp, int envp_len, char * exe, char ** args, int *pid, | ||
563 | + Terminal ** prs) | ||
564 | +{ | ||
565 | + int err = 0; | ||
566 | + int fd_tty_master = -1; | ||
567 | + char * tty_slave_name = NULL; | ||
568 | + struct winsize size; | ||
569 | + char **newenvp = envp; | ||
570 | + | ||
571 | + memset(&size, 0, sizeof(struct winsize)); | ||
572 | + fd_tty_master = posix_openpt(O_RDWR | O_NOCTTY); | ||
573 | + if (fd_tty_master < 0 || grantpt(fd_tty_master) < 0 || unlockpt( | ||
574 | + fd_tty_master) < 0) | ||
575 | + err = errno; | ||
576 | + if (!err) { | ||
577 | + tty_slave_name = ptsname(fd_tty_master); | ||
578 | + if (tty_slave_name == NULL) | ||
579 | + err = EINVAL; | ||
580 | + } | ||
581 | + | ||
582 | + if (ioctl(fd_tty_master, TIOCGWINSZ, (char *) &size) < 0) | ||
583 | + err = errno; | ||
584 | + | ||
585 | + if (!err && fd_tty_master < 3) { | ||
586 | + int fd0 = fd_tty_master; | ||
587 | + if ((fd_tty_master = dup(fd_tty_master)) < 0 || close(fd0)) | ||
588 | + err = errno; | ||
589 | + } | ||
590 | + | ||
591 | + if (!err) { | ||
592 | + *pid = fork(); | ||
593 | + if (*pid < 0) | ||
594 | + err = errno; | ||
595 | + if (*pid == 0) { | ||
596 | + int fd = -1; | ||
597 | + int fd_tty_slave = -1; | ||
598 | + | ||
599 | + if (*pty_type) { | ||
600 | + char env_term[TERM_PROP_DEF_SIZE]; | ||
601 | + snprintf(env_term, sizeof(env_term), "TERM=%s", pty_type); | ||
602 | + newenvp = envp_add(envp, envp_len, env_term); | ||
603 | + if (newenvp == NULL) { | ||
604 | + err = ENOMEM; | ||
605 | + } else if (envp) { | ||
606 | + loc_free(envp); | ||
607 | + envp = NULL; | ||
608 | + } | ||
609 | + } | ||
610 | + | ||
611 | + setsid(); | ||
612 | + | ||
613 | + if (!err && (fd = sysconf(_SC_OPEN_MAX)) < 0) | ||
614 | + err = errno; | ||
615 | + if (!err && (fd_tty_slave = open(tty_slave_name, O_RDWR)) < 0) | ||
616 | + err = errno; | ||
617 | +#if defined(TIOCSCTTY) | ||
618 | + if (!err && (ioctl(fd_tty_slave, TIOCSCTTY, (char *) 0)) < 0) | ||
619 | + err = errno; | ||
620 | +#endif | ||
621 | + if (!err && dup2(fd_tty_slave, 0) < 0) | ||
622 | + err = errno; | ||
623 | + if (!err && dup2(fd_tty_slave, 1) < 0) | ||
624 | + err = errno; | ||
625 | + if (!err && dup2(fd_tty_slave, 2) < 0) | ||
626 | + err = errno; | ||
627 | + while (!err && fd > 3) | ||
628 | + close(--fd); | ||
629 | + if (!err) { | ||
630 | + execve(exe, args, newenvp); | ||
631 | + err = errno; | ||
632 | + } | ||
633 | + if (newenvp) | ||
634 | + loc_free(newenvp); | ||
635 | + err = 1; | ||
636 | + if (err < 1) | ||
637 | + err = EINVAL; | ||
638 | + else if (err > 0xff) | ||
639 | + err = EINVAL; | ||
640 | + exit(err); | ||
641 | + } | ||
642 | + } | ||
643 | + | ||
644 | + if (!err) { | ||
645 | + *prs = (Terminal *) loc_alloc_zero(sizeof(Terminal)); | ||
646 | + (*prs)->inp = fd_tty_master; | ||
647 | + (*prs)->out = fd_tty_master; | ||
648 | + (*prs)->err = fd_tty_master; | ||
649 | + (*prs)->pid = *pid; | ||
650 | + (*prs)->bcg = c->bcg; | ||
651 | + (*prs)->channel = c; | ||
652 | + if (*pty_type) | ||
653 | + snprintf((*prs)->pty_type, sizeof((*prs)->pty_type), "%s", pty_type); | ||
654 | + if (*encoding) | ||
655 | + snprintf((*prs)->encoding, sizeof((*prs)->encoding), "%s", encoding); | ||
656 | + (*prs)->width = size.ws_row; | ||
657 | + (*prs)->height = size.ws_col; | ||
658 | + list_add_first(&(*prs)->link, &terms_list); | ||
659 | + } | ||
660 | + | ||
661 | + if (!err) | ||
662 | + return 0; | ||
663 | + errno = err; | ||
664 | + return -1; | ||
665 | +} | ||
666 | + | ||
667 | +static void command_get_context(char * token, Channel * c) | ||
668 | +{ | ||
669 | + int err = 0; | ||
670 | + char id[256]; | ||
671 | + int tid; | ||
672 | + Terminal *term; | ||
673 | + | ||
674 | + json_read_string(&c->inp, id, sizeof(id)); | ||
675 | + if (read_stream(&c->inp) != 0) | ||
676 | + exception(ERR_JSON_SYNTAX); | ||
677 | + if (read_stream(&c->inp) != MARKER_EOM) | ||
678 | + exception(ERR_JSON_SYNTAX); | ||
679 | + | ||
680 | + tid = id2tid(id); | ||
681 | + write_stringz(&c->out, "R"); | ||
682 | + write_stringz(&c->out, token); | ||
683 | + | ||
684 | + if (tid == 0) { | ||
685 | + err = ERR_INV_CONTEXT; | ||
686 | + } else { | ||
687 | + term = find_terminal(tid); | ||
688 | + if (term == NULL) { | ||
689 | + err = ERR_INV_CONTEXT; | ||
690 | + } else { | ||
691 | + write_context(&c->out, tid); | ||
692 | + write_stream(&c->out, 0); | ||
693 | + } | ||
694 | + } | ||
695 | + | ||
696 | + write_errno(&c->out, err); | ||
697 | + write_stream(&c->out, MARKER_EOM); | ||
698 | +} | ||
699 | + | ||
700 | +static void command_launch(char * token, Channel * c) | ||
701 | +{ | ||
702 | + int pid = 0; | ||
703 | + int err = 0; | ||
704 | + char encoding[TERM_PROP_DEF_SIZE]; | ||
705 | + char pty_type[TERM_PROP_DEF_SIZE]; | ||
706 | + char *args[] = TERM_LAUNCH_ARGS; | ||
707 | + | ||
708 | + char ** envp = NULL; | ||
709 | + int envp_len = 0; | ||
710 | + | ||
711 | + Terminal * prs = NULL; | ||
712 | + Trap trap; | ||
713 | + | ||
714 | + if (set_trap(&trap)) { | ||
715 | + json_read_string(&c->inp, pty_type, sizeof(pty_type)); | ||
716 | + if (read_stream(&c->inp) != 0) | ||
717 | + exception(ERR_JSON_SYNTAX); | ||
718 | + json_read_string(&c->inp, encoding, sizeof(encoding)); | ||
719 | + if (read_stream(&c->inp) != 0) | ||
720 | + exception(ERR_JSON_SYNTAX); | ||
721 | + envp = json_read_alloc_string_array(&c->inp, &envp_len); | ||
722 | + if (read_stream(&c->inp) != 0) | ||
723 | + exception(ERR_JSON_SYNTAX); | ||
724 | + if (read_stream(&c->inp) != MARKER_EOM) | ||
725 | + exception(ERR_JSON_SYNTAX); | ||
726 | + | ||
727 | + if (err == 0 && start_terminal(c, pty_type, encoding, envp, envp_len, | ||
728 | + TERM_LAUNCH_EXEC, args, &pid, &prs) < 0) | ||
729 | + err = errno; | ||
730 | + if (prs != NULL) { | ||
731 | + write_terminal_input(prs); | ||
732 | + prs->out_struct = read_terminal_output(prs, prs->out, prs->out_id, | ||
733 | + sizeof(prs->out_id)); | ||
734 | + if (prs->out != prs->err) | ||
735 | + prs->err_struct = read_terminal_output(prs, prs->err, | ||
736 | + prs->err_id, sizeof(prs->err_id)); | ||
737 | + } | ||
738 | + if (!err) { | ||
739 | + add_waitpid_process(pid); | ||
740 | + } | ||
741 | + //write result back | ||
742 | + { | ||
743 | + write_stringz(&c->out, "R"); | ||
744 | + write_stringz(&c->out, token); | ||
745 | + write_errno(&c->out, err); | ||
746 | + if (err || pid == 0) { | ||
747 | + write_stringz(&c->out, "null"); | ||
748 | + } else { | ||
749 | + write_context(&c->out, pid); | ||
750 | + write_stream(&c->out, 0); | ||
751 | + } | ||
752 | + write_stream(&c->out, MARKER_EOM); | ||
753 | + } | ||
754 | + clear_trap(&trap); | ||
755 | + } | ||
756 | + | ||
757 | + loc_free(envp); | ||
758 | + | ||
759 | + if (trap.error) | ||
760 | + exception(trap.error); | ||
761 | +} | ||
762 | + | ||
763 | +static void command_set_win_size(char * token, Channel * c) | ||
764 | +{ | ||
765 | + int err = 0; | ||
766 | + struct winsize size; | ||
767 | + char id[256]; | ||
768 | + unsigned tid; | ||
769 | + Terminal *term = NULL; | ||
770 | + | ||
771 | + json_read_string(&c->inp, id, sizeof(id)); | ||
772 | + if (read_stream(&c->inp) != 0) | ||
773 | + exception(ERR_JSON_SYNTAX); | ||
774 | + size.ws_col=json_read_ulong(&c->inp); | ||
775 | + if (read_stream(&c->inp) != 0) | ||
776 | + exception(ERR_JSON_SYNTAX); | ||
777 | + size.ws_row=json_read_ulong(&c->inp); | ||
778 | + if (read_stream(&c->inp) != 0) | ||
779 | + exception(ERR_JSON_SYNTAX); | ||
780 | + if (read_stream(&c->inp) != MARKER_EOM) | ||
781 | + exception(ERR_JSON_SYNTAX); | ||
782 | + | ||
783 | + tid = id2tid(id); | ||
784 | + | ||
785 | + if(tid==0 || (term=find_terminal(tid))==NULL) { | ||
786 | + err=ERR_INV_CONTEXT; | ||
787 | + }else if (term->width != size.ws_col || term->height != size.ws_row) { | ||
788 | + if(ioctl(term->inp,TIOCSWINSZ,&size)<0) { | ||
789 | + err=errno; | ||
790 | + } | ||
791 | + if(!err) { | ||
792 | + term->width=size.ws_col; | ||
793 | + term->height=size.ws_row; | ||
794 | + send_event_terminal_win_size_changed(&term->channel->out,term); | ||
795 | + } | ||
796 | + } | ||
797 | + | ||
798 | + write_stringz(&c->out, "R"); | ||
799 | + write_stringz(&c->out, token); | ||
800 | + write_errno(&c->out, err); | ||
801 | + write_stream(&c->out, MARKER_EOM); | ||
802 | + | ||
803 | +} | ||
804 | + | ||
805 | +static void waitpid_listener(int pid, int exited, int exit_code, int signal, | ||
806 | + int event_code, int syscall, void * args) | ||
807 | +{ | ||
808 | + if (exited) { | ||
809 | + Terminal * prs = find_terminal(pid); | ||
810 | + if (prs) { | ||
811 | + if (signal != 0) | ||
812 | + prs->exit_code = -signal; | ||
813 | + else | ||
814 | + prs->exit_code = exit_code; | ||
815 | + terminal_exited(prs); | ||
816 | + } | ||
817 | + } | ||
818 | +} | ||
819 | + | ||
820 | +static void channel_close_listener(Channel * c) | ||
821 | +{ | ||
822 | + LINK * l = NULL; | ||
823 | + | ||
824 | + for (l = terms_list.next; l != &terms_list;) { | ||
825 | + Terminal * term = link2term(l); | ||
826 | + l = l->next; | ||
827 | + if (term->channel == c) { | ||
828 | + trace(LOG_ALWAYS, "Terminal is left launched: T%d", term->pid); | ||
829 | + kill_term(term); | ||
830 | + } | ||
831 | + } | ||
832 | +} | ||
833 | + | ||
834 | +void ini_terminals_service(Protocol * proto) | ||
835 | +{ | ||
836 | +#if defined(_WRS_KERNEL) | ||
837 | + prs_list_lock = semMCreate(SEM_Q_PRIORITY); | ||
838 | + if (prs_list_lock == NULL) check_error(errno); | ||
839 | + if (taskCreateHookAdd((FUNCPTR)task_create_hook) != OK) check_error(errno); | ||
840 | + if (taskDeleteHookAdd((FUNCPTR)task_delete_hook) != OK) check_error(errno); | ||
841 | +#endif | ||
842 | + list_init(&terms_list); | ||
843 | + | ||
844 | + add_waitpid_listener(waitpid_listener, NULL); | ||
845 | + add_channel_close_listener(channel_close_listener); | ||
846 | + | ||
847 | + add_command_handler(proto, TERMINALS, "getContext", command_get_context); | ||
848 | + add_command_handler(proto, TERMINALS, "launch", command_launch); | ||
849 | + add_command_handler(proto, TERMINALS, "exit", command_exit); | ||
850 | + add_command_handler(proto, TERMINALS, "setWinSize", command_set_win_size); | ||
851 | +} | ||
852 | Index: org.eclipse.tm.tcf.terminals.agent/main/services-ext.h | ||
853 | =================================================================== | ||
854 | --- org.eclipse.tm.tcf.terminals.agent/main/services-ext.h (revision 0) | ||
855 | +++ org.eclipse.tm.tcf.terminals.agent/main/services-ext.h (revision 0) | ||
856 | @@ -0,0 +1,25 @@ | ||
857 | +/******************************************************************************* | ||
858 | + * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others. | ||
859 | + * All rights reserved. This program and the accompanying materials | ||
860 | + * are made available under the terms of the Eclipse Public License v1.0 | ||
861 | + * and Eclipse Distribution License v1.0 which accompany this distribution. | ||
862 | + * The Eclipse Public License is available at | ||
863 | + * http://www.eclipse.org/legal/epl-v10.html | ||
864 | + * and the Eclipse Distribution License is available at | ||
865 | + * http://www.eclipse.org/org/documents/edl-v10.php. | ||
866 | + * | ||
867 | + * Contributors: | ||
868 | + * Wind River Systems - initial API and implementation | ||
869 | + *******************************************************************************/ | ||
870 | + | ||
871 | +/* | ||
872 | + * Services initialization code extension point. | ||
873 | + * If the agent is built with additional user-defined services, | ||
874 | + * a customized version of services-ext.h file can be added to compiler headers search paths. | ||
875 | + */ | ||
876 | + | ||
877 | +#include "terminals.h" | ||
878 | + | ||
879 | +static void ini_ext_services(Protocol * proto, TCFBroadcastGroup * bcg) { | ||
880 | + ini_terminals_service(proto); | ||
881 | +} | ||
882 | Index: org.eclipse.tm.tcf.terminals.agent/terminals.h | ||
883 | =================================================================== | ||
884 | --- org.eclipse.tm.tcf.terminals.agent/terminals.h (revision 0) | ||
885 | +++ org.eclipse.tm.tcf.terminals.agent/terminals.h (revision 0) | ||
886 | @@ -0,0 +1,27 @@ | ||
887 | +/******************************************************************************* | ||
888 | + * Copyright (c) 2008 Wind River Systems, Inc. and others. | ||
889 | + * All rights reserved. This program and the accompanying materials | ||
890 | + * are made available under the terms of the Eclipse Public License v1.0 | ||
891 | + * and Eclipse Distribution License v1.0 which accompany this distribution. | ||
892 | + * The Eclipse Public License is available at | ||
893 | + * http://www.eclipse.org/legal/epl-v10.html | ||
894 | + * and the Eclipse Distribution License is available at | ||
895 | + * http://www.eclipse.org/org/documents/edl-v10.php. | ||
896 | + * | ||
897 | + * Contributors: | ||
898 | + * Wind River Systems - initial API and implementation | ||
899 | + *******************************************************************************/ | ||
900 | + | ||
901 | +/* | ||
902 | + * Sample TCF service header file. | ||
903 | + */ | ||
904 | + | ||
905 | +#ifndef TERMINALS_H_ | ||
906 | +#define TERMINALS_H_ | ||
907 | + | ||
908 | +#include <config.h> | ||
909 | +#include <framework/protocol.h> | ||
910 | + | ||
911 | +extern void ini_terminals_service(Protocol * proto); | ||
912 | + | ||
913 | +#endif /*TERMINALS_H_*/ | ||
914 | Index: org.eclipse.tm.tcf.terminals.agent/config.h | ||
915 | =================================================================== | ||
916 | --- org.eclipse.tm.tcf.terminals.agent/config.h (revision 0) | ||
917 | +++ org.eclipse.tm.tcf.terminals.agent/config.h (revision 0) | ||
918 | @@ -0,0 +1,63 @@ | ||
919 | +/******************************************************************************* | ||
920 | + * Copyright (c) 2008 Wind River Systems, Inc. and others. | ||
921 | + * All rights reserved. This program and the accompanying materials | ||
922 | + * are made available under the terms of the Eclipse Public License v1.0 | ||
923 | + * and Eclipse Distribution License v1.0 which accompany this distribution. | ||
924 | + * The Eclipse Public License is available at | ||
925 | + * http://www.eclipse.org/legal/epl-v10.html | ||
926 | + * and the Eclipse Distribution License is available at | ||
927 | + * http://www.eclipse.org/org/documents/edl-v10.php. | ||
928 | + * | ||
929 | + * Contributors: | ||
930 | + * Wind River Systems - initial API and implementation | ||
931 | + *******************************************************************************/ | ||
932 | + | ||
933 | +/* | ||
934 | + * This file contains "define" statements that control agent configuration. | ||
935 | + * SERVICE_* definitions control which service implementations are included into the agent. | ||
936 | + * | ||
937 | + * This is example agent configuration. It includes only few standard services, | ||
938 | + * and one example service: Day Time. | ||
939 | + */ | ||
940 | + | ||
941 | +#ifndef D_config | ||
942 | +#define D_config | ||
943 | + | ||
944 | +#include <framework/mdep.h> | ||
945 | + | ||
946 | +#if defined(WIN32) || defined(__CYGWIN__) | ||
947 | +# define TARGET_UNIX 0 | ||
948 | +#elif defined(_WRS_KERNEL) | ||
949 | +# define TARGET_UNIX 0 | ||
950 | +#else | ||
951 | +# define TARGET_UNIX 1 | ||
952 | +#endif | ||
953 | + | ||
954 | +#define SERVICE_Locator 1 | ||
955 | +#define SERVICE_Processes 1 | ||
956 | +#define SERVICE_Streams 1 | ||
957 | +#define SERVICE_FileSystem 1 | ||
958 | +#define SERVICE_SysMonitor TARGET_UNIX | ||
959 | + | ||
960 | +#define ENABLE_ZeroCopy 1 | ||
961 | + | ||
962 | +#if !defined(ENABLE_Splice) | ||
963 | +# if ENABLE_ZeroCopy | ||
964 | +# include <fcntl.h> | ||
965 | +# if defined(SPLICE_F_MOVE) | ||
966 | +# define ENABLE_Splice 1 | ||
967 | +# else | ||
968 | +# define ENABLE_Splice 0 | ||
969 | +# endif | ||
970 | +# else | ||
971 | +# define ENABLE_Splice 0 | ||
972 | +# endif | ||
973 | +#endif | ||
974 | + | ||
975 | +#define ENABLE_SSL 0 | ||
976 | + | ||
977 | +#define ENABLE_Trace 1 | ||
978 | +#define ENABLE_Discovery 1 | ||
979 | + | ||
980 | + | ||
981 | +#endif /* D_config */ | ||
982 | Index: org.eclipse.tm.tcf.terminals.agent/Makefile | ||
983 | =================================================================== | ||
984 | --- org.eclipse.tm.tcf.terminals.agent/Makefile (revision 0) | ||
985 | +++ org.eclipse.tm.tcf.terminals.agent/Makefile (revision 0) | ||
986 | @@ -0,0 +1,39 @@ | ||
987 | +TCF_AGENT_DIR=../agent | ||
988 | + | ||
989 | +include $(TCF_AGENT_DIR)/Makefile.inc | ||
990 | + | ||
991 | +override CFLAGS += $(foreach dir,$(INCDIRS),-I$(dir)) $(OPTS) | ||
992 | + | ||
993 | +HFILES := $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.h)) $(HFILES) | ||
994 | +CFILES := $(sort $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c)) $(CFILES)) | ||
995 | + | ||
996 | +#no using SSL | ||
997 | +LIBS = -lpthread -lrt | ||
998 | + | ||
999 | +EXECS = $(BINDIR)/agent$(EXTEXE) | ||
1000 | + | ||
1001 | +all: $(EXECS) | ||
1002 | + | ||
1003 | +$(BINDIR)/libtcf$(EXTLIB) : $(OFILES) | ||
1004 | + $(AR) rcs $@ $^ | ||
1005 | + | ||
1006 | +$(BINDIR)/agent$(EXTEXE): $(BINDIR)/main/main$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB) | ||
1007 | + $(CC) $(CFLAGS) -o $@ $(BINDIR)/main/main$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB) $(LIBS) | ||
1008 | + | ||
1009 | +$(BINDIR)/%$(EXTOBJ): %.c $(HFILES) Makefile | ||
1010 | + @mkdir -p $(dir $@) | ||
1011 | + $(CC) $(CFLAGS) -c -o $@ $< | ||
1012 | + | ||
1013 | +$(BINDIR)/%$(EXTOBJ): $(TCF_AGENT_DIR)/%.c $(HFILES) Makefile | ||
1014 | + @mkdir -p $(dir $@) | ||
1015 | + $(CC) $(CFLAGS) -c -o $@ $< | ||
1016 | + | ||
1017 | +install: all | ||
1018 | + install -d -m 755 $(INSTALLROOT)$(SBIN) | ||
1019 | + install -d -m 755 $(INSTALLROOT)$(INIT) | ||
1020 | + install -c $(BINDIR)/agent -m 755 $(INSTALLROOT)$(SBIN)/tcf-agent | ||
1021 | + install -c $(TCF_AGENT_DIR)/main/tcf-agent.init -m 755 $(INSTALLROOT)$(INIT)/tcf-agent | ||
1022 | + | ||
1023 | +clean: | ||
1024 | + rm -rf $(BINDIR) | ||
1025 | + | ||
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent_svn.bb b/meta/recipes-devtools/tcf-agent/tcf-agent_svn.bb new file mode 100644 index 0000000000..b4c70ec8b8 --- /dev/null +++ b/meta/recipes-devtools/tcf-agent/tcf-agent_svn.bb | |||
@@ -0,0 +1,36 @@ | |||
1 | DESCRIPTION = "Target Communication Framework" | ||
2 | HOMEPAGE = "http://dsdp.eclipse.org/dsdp/tm/" | ||
3 | BUGTRACKER = "https://bugs.eclipse.org/bugs/" | ||
4 | |||
5 | LICENSE = "EPLv1.0 | EDLv1.0" | ||
6 | LIC_FILES_CHKSUM = "file://../epl-v10.html;md5=7aa4215a330a0a4f6a1cbf8da1a0879f \ | ||
7 | file://../agent/edl-v10.html;md5=522a390a83dc186513f0500543ad3679" | ||
8 | |||
9 | PV = "0.3.0+svnr${SRCREV}" | ||
10 | PR = "r0" | ||
11 | |||
12 | SRC_URI = "svn://dev.eclipse.org/svnroot/dsdp/org.eclipse.tm.tcf/;module=tags/0.3.0/;proto=http \ | ||
13 | file://terminals_agent.patch \ | ||
14 | file://fix_tcf-agent.init.patch" | ||
15 | |||
16 | S = "${WORKDIR}/tags/0.3.0/tcf-agent" | ||
17 | |||
18 | inherit update-rc.d | ||
19 | |||
20 | INITSCRIPT_NAME = "tcf-agent" | ||
21 | INITSCRIPT_PARAMS = "start 999 3 5 . stop 20 0 1 2 6 ." | ||
22 | |||
23 | # mangling needed for make | ||
24 | MAKE_ARCH = `echo ${TARGET_ARCH} | sed s,i.86,i686,` | ||
25 | MAKE_OS = `echo ${TARGET_OS} | sed s,linux,GNU/Linux,` | ||
26 | |||
27 | EXTRA_OEMAKE = "MACHINE=${MAKE_ARCH} OPSYS=${MAKE_OS} 'CC=${CC}' 'AR=${AR}'" | ||
28 | |||
29 | do_compile() { | ||
30 | oe_runmake | ||
31 | } | ||
32 | |||
33 | do_install() { | ||
34 | oe_runmake install INSTALLROOT=${D} | ||
35 | } | ||
36 | |||
diff --git a/meta/recipes-devtools/ubootchart/files/sysvinit.patch b/meta/recipes-devtools/ubootchart/files/sysvinit.patch new file mode 100644 index 0000000000..de9fb0b17d --- /dev/null +++ b/meta/recipes-devtools/ubootchart/files/sysvinit.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | Index: ubootchart.conf | ||
2 | =================================================================== | ||
3 | --- ubootchart.conf (revision 9) | ||
4 | +++ ubootchart.conf (working copy) | ||
5 | @@ -1,6 +1,6 @@ | ||
6 | |||
7 | # If you want to chain on and run somthing other than /sbin/init... | ||
8 | -export init_prog=/sbin/init | ||
9 | +export init_prog=/sbin/init.sysvinit | ||
10 | |||
11 | # On startup ubootchart will mount a tmpfs filesystem at this | ||
12 | # location and chdir here. This is only used for the logging of | ||
diff --git a/meta/recipes-devtools/ubootchart/files/ubootchart-stop b/meta/recipes-devtools/ubootchart/files/ubootchart-stop new file mode 100644 index 0000000000..3444069c9a --- /dev/null +++ b/meta/recipes-devtools/ubootchart/files/ubootchart-stop | |||
@@ -0,0 +1,3 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | kill -USR1 $(pidof ubootchartd_bin) | ||
diff --git a/meta/recipes-devtools/ubootchart/files/ubootchart.desktop b/meta/recipes-devtools/ubootchart/files/ubootchart.desktop new file mode 100644 index 0000000000..5552b3bc6f --- /dev/null +++ b/meta/recipes-devtools/ubootchart/files/ubootchart.desktop | |||
@@ -0,0 +1,6 @@ | |||
1 | [Desktop Entry] | ||
2 | Encoding=UTF-8 | ||
3 | Exec=/sbin/ubootchart-stop | ||
4 | Name=Stop Bootchart | ||
5 | Type=Application | ||
6 | Categories=Programming; | ||
diff --git a/meta/recipes-devtools/ubootchart/ubootchart_svn.bb b/meta/recipes-devtools/ubootchart/ubootchart_svn.bb new file mode 100644 index 0000000000..cd292b6943 --- /dev/null +++ b/meta/recipes-devtools/ubootchart/ubootchart_svn.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | DESCRIPTION = "A boot profiling tool" | ||
2 | HOMEPAGE = "http://code.google.com/p/ubootchart/" | ||
3 | LICENSE = "GPLv3" | ||
4 | PV = "0.0+r${SRCREV}" | ||
5 | PR = "r4" | ||
6 | |||
7 | #RRECOMMENDS = "acct" | ||
8 | |||
9 | SRC_URI = "svn://ubootchart.googlecode.com/svn/;proto=http;module=trunk \ | ||
10 | file://sysvinit.patch;patch=1;pnum=0 \ | ||
11 | file://ubootchart-stop \ | ||
12 | file://ubootchart.desktop" | ||
13 | |||
14 | S = "${WORKDIR}/trunk" | ||
15 | |||
16 | inherit update-alternatives | ||
17 | |||
18 | ALTERNATIVE_NAME = "init" | ||
19 | ALTERNATIVE_LINK = "${base_sbindir}/init" | ||
20 | ALTERNATIVE_PATH = "${base_sbindir}/ubootchartd" | ||
21 | ALTERNATIVE_PRIORITY = "70" | ||
22 | |||
23 | do_compile() { | ||
24 | ${CC} ${CFLAGS} ${LDFLAGS} ${LIBS} ${INCLUDES} ${S}/ubootchartd_bin.c -o ubootchartd_bin | ||
25 | } | ||
26 | |||
27 | do_install() { | ||
28 | install -m 0755 -d ${D}/sbin ${D}/etc/ubootchart ${D}/usr/share/applications | ||
29 | install -m 0755 ${S}/ubootchartd_bin ${D}/sbin | ||
30 | install -m 0755 ${S}/ubootchartd ${D}/sbin | ||
31 | install -m 0644 ${S}/ubootchart.conf ${D}/etc/ubootchart | ||
32 | install -m 0755 ${S}/start.sh ${D}/etc/ubootchart | ||
33 | install -m 0755 ${S}/finish.sh ${D}/etc/ubootchart | ||
34 | |||
35 | install -m 0755 ${WORKDIR}/ubootchart-stop ${D}/sbin | ||
36 | install -m 0644 ${WORKDIR}/ubootchart.desktop ${D}/usr/share/applications | ||
37 | } | ||
diff --git a/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch b/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch new file mode 100644 index 0000000000..521f1ba9a0 --- /dev/null +++ b/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch | |||
@@ -0,0 +1,345 @@ | |||
1 | * | ||
2 | * mkyaffs2image hacks by NCB | ||
3 | * | ||
4 | * Changes by Sergey Kubushin flagged KSI | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | /* KSI: | ||
9 | * All this nightmare should be rewritten from ground up. Why save return | ||
10 | * values if nobody checks them? The read/write function returns only one | ||
11 | * error, -1. Positive return value does NOT mean read/write operation has | ||
12 | * been completed successfully. If somebody opens files, he MUST close them | ||
13 | * when they are not longer needed. Only those brave enough can write 64 | ||
14 | * bytes from a yaffs_PackedTags2 structure. The list is too long, there is | ||
15 | * enough bugs here to write a couple of thick books on how NOT to write | ||
16 | * programs... | ||
17 | * | ||
18 | * And BTW, what was one supposed to do with that file that this horror | ||
19 | * occasionally managed to generate? | ||
20 | */ | ||
21 | diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c | ||
22 | --- yaffs2.orig/utils/mkyaffs2image.c 2005-12-12 16:34:58.000000000 -0800 | ||
23 | +++ yaffs2/utils/mkyaffs2image.c 2006-02-10 16:56:13.000000000 -0800 | ||
24 | @@ -31,10 +47,10 @@ | ||
25 | #include <dirent.h> | ||
26 | #include <string.h> | ||
27 | #include <unistd.h> | ||
28 | +#include <mtd/mtd-user.h> | ||
29 | #include "yaffs_ecc.h" | ||
30 | #include "yaffs_guts.h" | ||
31 | |||
32 | -#include "yaffs_tagsvalidity.h" | ||
33 | #include "yaffs_packedtags2.h" | ||
34 | |||
35 | unsigned yaffs_traceMask=0; | ||
36 | @@ -43,9 +59,45 @@ | ||
37 | |||
38 | #define chunkSize 2048 | ||
39 | #define spareSize 64 | ||
40 | +#define PT2_BYTES 25 | ||
41 | |||
42 | const char * mkyaffsimage_c_version = "$Id: mkyaffs2image.c,v 1.4 2007-02-14 01:09:06 wookey Exp $"; | ||
43 | |||
44 | +static int layout_no; | ||
45 | + | ||
46 | +static struct nand_oobinfo oob_layout[] = { | ||
47 | + /* KSI: | ||
48 | + * Dummy "raw" layout - no ECC, all the bytes are free. Does NOT | ||
49 | + * really work, only used for compatibility with CVS YAFFS2 that | ||
50 | + * never ever worked with any stock MTD. | ||
51 | + */ | ||
52 | + { | ||
53 | + .useecc = MTD_NANDECC_AUTOPLACE, | ||
54 | + .eccbytes = 0, | ||
55 | + .eccpos = {}, | ||
56 | + .oobfree = { {0, 64} } | ||
57 | + }, | ||
58 | + /* KSI: | ||
59 | + * Regular MTD AUTOPLACED ECC for large page NAND devices, the | ||
60 | + * only one existing in stock MTD so far. It corresponds to layout# 1 | ||
61 | + * in command line arguments. Any other layouts could be added to | ||
62 | + * the list when they made their way in kernel's MTD. The structure | ||
63 | + * is simply copied from kernel's drivers/mtd/nand/nand_base.c as-is. | ||
64 | + */ | ||
65 | + { | ||
66 | + .useecc = MTD_NANDECC_AUTOPLACE, | ||
67 | + .eccbytes = 24, | ||
68 | + .eccpos = { | ||
69 | + 40, 41, 42, 43, 44, 45, 46, 47, | ||
70 | + 48, 49, 50, 51, 52, 53, 54, 55, | ||
71 | + 56, 57, 58, 59, 60, 61, 62, 63}, | ||
72 | + .oobfree = { {2, 38} } | ||
73 | + }, | ||
74 | + /* End-of-list marker */ | ||
75 | + { | ||
76 | + .useecc = -1, | ||
77 | + } | ||
78 | +}; | ||
79 | |||
80 | typedef struct | ||
81 | { | ||
82 | @@ -59,7 +111,7 @@ | ||
83 | static int n_obj = 0; | ||
84 | static int obj_id = YAFFS_NOBJECT_BUCKETS + 1; | ||
85 | |||
86 | -static int nObjects, nDirectories, nPages; | ||
87 | +static int nObjects = 0, nDirectories = 0, nPages = 0; | ||
88 | |||
89 | static int outFile; | ||
90 | |||
91 | @@ -123,6 +175,11 @@ | ||
92 | return -1; | ||
93 | } | ||
94 | |||
95 | +/* KSI: | ||
96 | + * No big endian for now. This is left for a later time. The existing code | ||
97 | + * is FUBAR. | ||
98 | + */ | ||
99 | +#if 0 | ||
100 | /* This little function converts a little endian tag to a big endian tag. | ||
101 | * NOTE: The tag is not usable after this other than calculating the CRC | ||
102 | * with. | ||
103 | @@ -155,11 +212,56 @@ | ||
104 | tags->asBytes[7] = temp.asBytes[7]; | ||
105 | #endif | ||
106 | } | ||
107 | +#endif | ||
108 | + | ||
109 | +void nandmtd2_pt2buf(unsigned char *buf, yaffs_PackedTags2 *pt) | ||
110 | +{ | ||
111 | + int i, j = 0, k, n; | ||
112 | + unsigned char pt2_byte_buf[PT2_BYTES]; | ||
113 | + | ||
114 | + *((unsigned int *) &pt2_byte_buf[0]) = pt->t.sequenceNumber; | ||
115 | + *((unsigned int *) &pt2_byte_buf[4]) = pt->t.objectId; | ||
116 | + *((unsigned int *) &pt2_byte_buf[8]) = pt->t.chunkId; | ||
117 | + *((unsigned int *) &pt2_byte_buf[12]) = pt->t.byteCount; | ||
118 | + pt2_byte_buf[16] = pt->ecc.colParity; | ||
119 | + pt2_byte_buf[17] = pt->ecc.lineParity & 0xff; | ||
120 | + pt2_byte_buf[18] = (pt->ecc.lineParity >> 8) & 0xff; | ||
121 | + pt2_byte_buf[19] = (pt->ecc.lineParity >> 16) & 0xff; | ||
122 | + pt2_byte_buf[20] = (pt->ecc.lineParity >> 24) & 0xff; | ||
123 | + pt2_byte_buf[21] = pt->ecc.lineParityPrime & 0xff; | ||
124 | + pt2_byte_buf[22] = (pt->ecc.lineParityPrime >> 8) & 0xff; | ||
125 | + pt2_byte_buf[23] = (pt->ecc.lineParityPrime >> 16) & 0xff; | ||
126 | + pt2_byte_buf[24] = (pt->ecc.lineParityPrime >> 24) & 0xff; | ||
127 | + | ||
128 | + k = oob_layout[layout_no].oobfree[j][0]; | ||
129 | + n = oob_layout[layout_no].oobfree[j][1]; | ||
130 | + | ||
131 | + if (n == 0) { | ||
132 | + fprintf(stderr, "No OOB space for tags"); | ||
133 | + exit(-1); | ||
134 | + } | ||
135 | + | ||
136 | + for (i = 0; i < PT2_BYTES; i++) { | ||
137 | + if (n == 0) { | ||
138 | + j++; | ||
139 | + k = oob_layout[layout_no].oobfree[j][0]; | ||
140 | + n = oob_layout[layout_no].oobfree[j][1]; | ||
141 | + if (n == 0) { | ||
142 | + fprintf(stderr, "No OOB space for tags"); | ||
143 | + exit(-1); | ||
144 | + } | ||
145 | + } | ||
146 | + buf[k++] = pt2_byte_buf[i]; | ||
147 | + n--; | ||
148 | + } | ||
149 | +} | ||
150 | |||
151 | static int write_chunk(__u8 *data, __u32 objId, __u32 chunkId, __u32 nBytes) | ||
152 | { | ||
153 | yaffs_ExtendedTags t; | ||
154 | yaffs_PackedTags2 pt; | ||
155 | + unsigned char spare_buf[spareSize]; | ||
156 | + | ||
157 | |||
158 | error = write(outFile,data,chunkSize); | ||
159 | if(error < 0) return error; | ||
160 | @@ -177,18 +279,27 @@ | ||
161 | // added NCB **CHECK** | ||
162 | t.chunkUsed = 1; | ||
163 | |||
164 | +/* KSI: Broken anyway -- e.g. &t is pointer to a wrong type... */ | ||
165 | +#if 0 | ||
166 | if (convert_endian) | ||
167 | { | ||
168 | little_to_big_endian(&t); | ||
169 | } | ||
170 | +#endif | ||
171 | |||
172 | nPages++; | ||
173 | |||
174 | yaffs_PackTags2(&pt,&t); | ||
175 | - | ||
176 | -// return write(outFile,&pt,sizeof(yaffs_PackedTags2)); | ||
177 | - return write(outFile,&pt,spareSize); | ||
178 | - | ||
179 | + | ||
180 | + memset(spare_buf, 0xff, sizeof(spare_buf)); | ||
181 | + | ||
182 | + if (layout_no == 0) { | ||
183 | + memcpy(spare_buf, &pt, sizeof(yaffs_PackedTags2)); | ||
184 | + } else { | ||
185 | + nandmtd2_pt2buf(spare_buf, &pt); | ||
186 | + } | ||
187 | + | ||
188 | + return write(outFile,spare_buf,spareSize); | ||
189 | } | ||
190 | |||
191 | #define SWAP32(x) ((((x) & 0x000000FF) << 24) | \ | ||
192 | @@ -199,6 +310,8 @@ | ||
193 | #define SWAP16(x) ((((x) & 0x00FF) << 8) | \ | ||
194 | (((x) & 0xFF00) >> 8)) | ||
195 | |||
196 | +/* KSI: Removed for now. TBD later when the proper util (from scratch) is written */ | ||
197 | +#if 0 | ||
198 | // This one is easier, since the types are more standard. No funky shifts here. | ||
199 | static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh) | ||
200 | { | ||
201 | @@ -256,6 +369,7 @@ | ||
202 | oh->roomToGrow[11] = SWAP32(oh->roomToGrow[11]); | ||
203 | #endif | ||
204 | } | ||
205 | +#endif | ||
206 | |||
207 | static int write_object_header(int objId, yaffs_ObjectType t, struct stat *s, int parent, const char *name, int equivalentObj, const char * alias) | ||
208 | { | ||
209 | @@ -300,10 +414,13 @@ | ||
210 | strncpy(oh->alias,alias,YAFFS_MAX_ALIAS_LENGTH); | ||
211 | } | ||
212 | |||
213 | +/* KSI: FUBAR. Left for a leter time. */ | ||
214 | +#if 0 | ||
215 | if (convert_endian) | ||
216 | { | ||
217 | object_header_little_to_big_endian(oh); | ||
218 | } | ||
219 | +#endif | ||
220 | |||
221 | return write_chunk(bytes,objId,0,0xffff); | ||
222 | |||
223 | @@ -319,7 +436,7 @@ | ||
224 | nDirectories++; | ||
225 | |||
226 | dir = opendir(path); | ||
227 | - | ||
228 | + | ||
229 | if(dir) | ||
230 | { | ||
231 | while((entry = readdir(dir)) != NULL) | ||
232 | @@ -403,12 +520,12 @@ | ||
233 | error = nBytes; | ||
234 | |||
235 | printf("%d data chunks written\n",chunk); | ||
236 | + close(h); | ||
237 | } | ||
238 | else | ||
239 | { | ||
240 | perror("Error opening file"); | ||
241 | } | ||
242 | - close(h); | ||
243 | |||
244 | } | ||
245 | |||
246 | @@ -448,58 +565,82 @@ | ||
247 | } | ||
248 | } | ||
249 | } | ||
250 | + /* KSI: | ||
251 | + * Who is supposed to close those open directories in this | ||
252 | + * recursive function, lord Byron? Stock "ulimit -n" is 1024 | ||
253 | + * and e.g. stock Fedora /etc directory has more that 1024 | ||
254 | + * directories... | ||
255 | + */ | ||
256 | + closedir(dir); | ||
257 | } | ||
258 | |||
259 | return 0; | ||
260 | |||
261 | } | ||
262 | |||
263 | +void usage(void) | ||
264 | +{ | ||
265 | + printf("usage: mkyaffs2image layout# dir image_file [convert]\n"); | ||
266 | + printf(" layout# NAND OOB layout # (0 - raw, 1 - nand_oob_64)\n"); | ||
267 | + printf(" dir the directory tree to be converted\n"); | ||
268 | + printf(" image_file the output file to hold the image\n"); | ||
269 | + printf(" 'convert' make a big-endian img on a little-endian machine. BROKEN !\n"); | ||
270 | + exit(1); | ||
271 | +} | ||
272 | |||
273 | int main(int argc, char *argv[]) | ||
274 | { | ||
275 | struct stat stats; | ||
276 | + int i; | ||
277 | |||
278 | printf("mkyaffs2image: image building tool for YAFFS2 built "__DATE__"\n"); | ||
279 | |||
280 | - if(argc < 3) | ||
281 | + if ((argc < 4) || (sscanf(argv[1], "%u", &layout_no) != 1)) | ||
282 | { | ||
283 | - printf("usage: mkyaffs2image dir image_file [convert]\n"); | ||
284 | - printf(" dir the directory tree to be converted\n"); | ||
285 | - printf(" image_file the output file to hold the image\n"); | ||
286 | - printf(" 'convert' produce a big-endian image from a little-endian machine\n"); | ||
287 | - exit(1); | ||
288 | + usage(); | ||
289 | } | ||
290 | |||
291 | - if ((argc == 4) && (!strncmp(argv[3], "convert", strlen("convert")))) | ||
292 | - { | ||
293 | - convert_endian = 1; | ||
294 | - } | ||
295 | + i = 0; | ||
296 | + | ||
297 | + while (oob_layout[i].useecc != -1) | ||
298 | + i++; | ||
299 | + | ||
300 | + if (layout_no >= i) | ||
301 | + usage(); | ||
302 | + | ||
303 | + if ((argc == 5) && (!strncmp(argv[4], "convert", strlen("convert")))) | ||
304 | + { | ||
305 | + /* KSI: Broken as of now. TBD. Fail. */ | ||
306 | + usage(); | ||
307 | + convert_endian = 1; | ||
308 | + } | ||
309 | |||
310 | - if(stat(argv[1],&stats) < 0) | ||
311 | + if(stat(argv[2],&stats) < 0) | ||
312 | { | ||
313 | - printf("Could not stat %s\n",argv[1]); | ||
314 | + printf("Could not stat %s\n",argv[2]); | ||
315 | exit(1); | ||
316 | } | ||
317 | |||
318 | if(!S_ISDIR(stats.st_mode)) | ||
319 | { | ||
320 | - printf(" %s is not a directory\n",argv[1]); | ||
321 | + printf(" %s is not a directory\n",argv[2]); | ||
322 | exit(1); | ||
323 | } | ||
324 | |||
325 | - outFile = open(argv[2],O_CREAT | O_TRUNC | O_WRONLY, S_IREAD | S_IWRITE); | ||
326 | + outFile = open(argv[3],O_CREAT | O_TRUNC | O_WRONLY, S_IREAD | S_IWRITE); | ||
327 | |||
328 | |||
329 | if(outFile < 0) | ||
330 | { | ||
331 | - printf("Could not open output file %s\n",argv[2]); | ||
332 | + printf("Could not open output file %s\n",argv[3]); | ||
333 | exit(1); | ||
334 | } | ||
335 | |||
336 | - printf("Processing directory %s into image file %s\n",argv[1],argv[2]); | ||
337 | + printf("Processing directory %s into image file %s\n",argv[2],argv[3]); | ||
338 | error = write_object_header(1, YAFFS_OBJECT_TYPE_DIRECTORY, &stats, 1,"", -1, NULL); | ||
339 | + | ||
340 | if(error) | ||
341 | - error = process_directory(YAFFS_OBJECTID_ROOT,argv[1]); | ||
342 | + error = process_directory(YAFFS_OBJECTID_ROOT,argv[2]); | ||
343 | |||
344 | close(outFile); | ||
345 | |||
diff --git a/meta/recipes-devtools/yaffs2/files/yaffs2-unioob.patch b/meta/recipes-devtools/yaffs2/files/yaffs2-unioob.patch new file mode 100644 index 0000000000..c894528ca1 --- /dev/null +++ b/meta/recipes-devtools/yaffs2/files/yaffs2-unioob.patch | |||
@@ -0,0 +1,216 @@ | |||
1 | diff -urN yaffs2.orig/yaffs_mtdif2.c yaffs2/yaffs_mtdif2.c | ||
2 | --- yaffs2.orig/yaffs_mtdif2.c 2005-12-07 14:00:38.000000000 -0800 | ||
3 | +++ yaffs2/yaffs_mtdif2.c 2006-02-10 17:13:58.000000000 -0800 | ||
4 | @@ -29,6 +29,130 @@ | ||
5 | |||
6 | #include "yaffs_packedtags2.h" | ||
7 | |||
8 | +#define PT2_BYTES 25 | ||
9 | + | ||
10 | +void nandmtd2_pt2buf(yaffs_Device *dev, yaffs_PackedTags2 *pt, int is_raw) | ||
11 | +{ | ||
12 | + struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice); | ||
13 | + int i, j = 0, k, n; | ||
14 | + __u8 pt2_byte_buf[PT2_BYTES]; | ||
15 | + | ||
16 | + /* Pack buffer with 0xff */ | ||
17 | + for (i = 0; i < mtd->oobsize; i++) | ||
18 | + dev->spareBuffer[i] = 0xff; | ||
19 | + | ||
20 | + if (!is_raw) { | ||
21 | + *((unsigned int *) &dev->spareBuffer[0]) = pt->t.sequenceNumber; | ||
22 | + *((unsigned int *) &dev->spareBuffer[4]) = pt->t.objectId; | ||
23 | + *((unsigned int *) &dev->spareBuffer[8]) = pt->t.chunkId; | ||
24 | + *((unsigned int *) &dev->spareBuffer[12]) = pt->t.byteCount; | ||
25 | + dev->spareBuffer[16] = pt->ecc.colParity; | ||
26 | + dev->spareBuffer[17] = pt->ecc.lineParity & 0xff; | ||
27 | + dev->spareBuffer[18] = (pt->ecc.lineParity >> 8) & 0xff; | ||
28 | + dev->spareBuffer[19] = (pt->ecc.lineParity >> 16) & 0xff; | ||
29 | + dev->spareBuffer[20] = (pt->ecc.lineParity >> 24) & 0xff; | ||
30 | + dev->spareBuffer[21] = pt->ecc.lineParityPrime & 0xff; | ||
31 | + dev->spareBuffer[22] = (pt->ecc.lineParityPrime >> 8) & 0xff; | ||
32 | + dev->spareBuffer[23] = (pt->ecc.lineParityPrime >> 16) & 0xff; | ||
33 | + dev->spareBuffer[24] = (pt->ecc.lineParityPrime >> 24) & 0xff; | ||
34 | + } else { | ||
35 | + *((unsigned int *) &pt2_byte_buf[0]) = pt->t.sequenceNumber; | ||
36 | + *((unsigned int *) &pt2_byte_buf[4]) = pt->t.objectId; | ||
37 | + *((unsigned int *) &pt2_byte_buf[8]) = pt->t.chunkId; | ||
38 | + *((unsigned int *) &pt2_byte_buf[12]) = pt->t.byteCount; | ||
39 | + pt2_byte_buf[16] = pt->ecc.colParity; | ||
40 | + pt2_byte_buf[17] = pt->ecc.lineParity & 0xff; | ||
41 | + pt2_byte_buf[18] = (pt->ecc.lineParity >> 8) & 0xff; | ||
42 | + pt2_byte_buf[19] = (pt->ecc.lineParity >> 16) & 0xff; | ||
43 | + pt2_byte_buf[20] = (pt->ecc.lineParity >> 24) & 0xff; | ||
44 | + pt2_byte_buf[21] = pt->ecc.lineParityPrime & 0xff; | ||
45 | + pt2_byte_buf[22] = (pt->ecc.lineParityPrime >> 8) & 0xff; | ||
46 | + pt2_byte_buf[23] = (pt->ecc.lineParityPrime >> 16) & 0xff; | ||
47 | + pt2_byte_buf[24] = (pt->ecc.lineParityPrime >> 24) & 0xff; | ||
48 | + | ||
49 | + k = mtd->oobinfo.oobfree[j][0]; | ||
50 | + n = mtd->oobinfo.oobfree[j][1]; | ||
51 | + | ||
52 | + if (n == 0) { | ||
53 | + T(YAFFS_TRACE_ERROR, (TSTR("No OOB space for tags" TENDSTR))); | ||
54 | + YBUG(); | ||
55 | + } | ||
56 | + | ||
57 | + for (i = 0; i < PT2_BYTES; i++) { | ||
58 | + if (n == 0) { | ||
59 | + j++; | ||
60 | + k = mtd->oobinfo.oobfree[j][0]; | ||
61 | + n = mtd->oobinfo.oobfree[j][1]; | ||
62 | + if (n == 0) { | ||
63 | + T(YAFFS_TRACE_ERROR, (TSTR("No OOB space for tags" TENDSTR))); | ||
64 | + YBUG(); | ||
65 | + } | ||
66 | + } | ||
67 | + dev->spareBuffer[k++] = pt2_byte_buf[i]; | ||
68 | + n--; | ||
69 | + } | ||
70 | + } | ||
71 | +} | ||
72 | + | ||
73 | +void nandmtd2_buf2pt(yaffs_Device *dev, yaffs_PackedTags2 *pt, int is_raw) | ||
74 | +{ | ||
75 | + struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice); | ||
76 | + int i, j = 0, k, n; | ||
77 | + __u8 pt2_byte_buf[PT2_BYTES]; | ||
78 | + | ||
79 | + | ||
80 | + if (!is_raw) { | ||
81 | + pt->t.sequenceNumber = *((unsigned int *) &dev->spareBuffer[0]); | ||
82 | + pt->t.objectId = *((unsigned int *) &dev->spareBuffer[4]); | ||
83 | + pt->t.chunkId = *((unsigned int *) &dev->spareBuffer[8]); | ||
84 | + pt->t.byteCount = *((unsigned int *) &dev->spareBuffer[12]); | ||
85 | + pt->ecc.colParity = dev->spareBuffer[16]; | ||
86 | + pt->ecc.lineParity = (dev->spareBuffer[17] & 0x000000ff) | | ||
87 | + ((dev->spareBuffer[18] << 8) & 0x0000ff00) | | ||
88 | + ((dev->spareBuffer[19] << 16) & 0x00ff0000) | | ||
89 | + ((dev->spareBuffer[20] << 24) & 0xff000000); | ||
90 | + pt->ecc.lineParityPrime = (dev->spareBuffer[21] & 0x000000ff) | | ||
91 | + ((dev->spareBuffer[22] << 8) & 0x0000ff00) | | ||
92 | + ((dev->spareBuffer[23] << 16) & 0x00ff0000) | | ||
93 | + ((dev->spareBuffer[24] << 24) & 0xff000000); | ||
94 | + } else { | ||
95 | + k = mtd->oobinfo.oobfree[j][0]; | ||
96 | + n = mtd->oobinfo.oobfree[j][1]; | ||
97 | + | ||
98 | + if (n == 0) { | ||
99 | + T(YAFFS_TRACE_ERROR, (TSTR("No space in OOB for tags" TENDSTR))); | ||
100 | + YBUG(); | ||
101 | + } | ||
102 | + | ||
103 | + for (i = 0; i < PT2_BYTES; i++) { | ||
104 | + if (n == 0) { | ||
105 | + j++; | ||
106 | + k = mtd->oobinfo.oobfree[j][0]; | ||
107 | + n = mtd->oobinfo.oobfree[j][1]; | ||
108 | + if (n == 0) { | ||
109 | + T(YAFFS_TRACE_ERROR, (TSTR("No space in OOB for tags" TENDSTR))); | ||
110 | + YBUG(); | ||
111 | + } | ||
112 | + } | ||
113 | + pt2_byte_buf[i] = dev->spareBuffer[k++]; | ||
114 | + n--; | ||
115 | + } | ||
116 | + pt->t.sequenceNumber = *((unsigned int *) &pt2_byte_buf[0]); | ||
117 | + pt->t.objectId = *((unsigned int *) &pt2_byte_buf[4]); | ||
118 | + pt->t.chunkId = *((unsigned int *) &pt2_byte_buf[8]); | ||
119 | + pt->t.byteCount = *((unsigned int *) &pt2_byte_buf[12]); | ||
120 | + pt->ecc.colParity = pt2_byte_buf[16]; | ||
121 | + pt->ecc.lineParity = (pt2_byte_buf[17] & 0x000000ff) | | ||
122 | + ((pt2_byte_buf[18] << 8) & 0x0000ff00) | | ||
123 | + ((pt2_byte_buf[19] << 16) & 0x00ff0000) | | ||
124 | + ((pt2_byte_buf[20] << 24) & 0xff000000); | ||
125 | + pt->ecc.lineParityPrime = (pt2_byte_buf[21] & 0x000000ff) | | ||
126 | + ((pt2_byte_buf[22] << 8) & 0x0000ff00) | | ||
127 | + ((pt2_byte_buf[23] << 16) & 0x00ff0000) | | ||
128 | + ((pt2_byte_buf[24] << 24) & 0xff000000); | ||
129 | + } | ||
130 | +} | ||
131 | + | ||
132 | int nandmtd2_WriteChunkWithTagsToNAND(yaffs_Device * dev, int chunkInNAND, | ||
133 | const __u8 * data, | ||
134 | const yaffs_ExtendedTags * tags) | ||
135 | @@ -51,24 +175,22 @@ | ||
136 | } | ||
137 | |||
138 | if (data && tags) { | ||
139 | - if (dev->useNANDECC) | ||
140 | - retval = | ||
141 | - mtd->write_ecc(mtd, addr, dev->nBytesPerChunk, | ||
142 | - &dummy, data, (__u8 *) & pt, NULL); | ||
143 | - else | ||
144 | + nandmtd2_pt2buf(dev, &pt, 0); | ||
145 | retval = | ||
146 | mtd->write_ecc(mtd, addr, dev->nBytesPerChunk, | ||
147 | - &dummy, data, (__u8 *) & pt, NULL); | ||
148 | + &dummy, data, dev->spareBuffer, | ||
149 | + NULL); | ||
150 | } else { | ||
151 | if (data) | ||
152 | retval = | ||
153 | mtd->write(mtd, addr, dev->nBytesPerChunk, &dummy, | ||
154 | data); | ||
155 | - if (tags) | ||
156 | + if (tags) { | ||
157 | + nandmtd2_pt2buf(dev, &pt, 1); | ||
158 | retval = | ||
159 | mtd->write_oob(mtd, addr, mtd->oobsize, &dummy, | ||
160 | - (__u8 *) & pt); | ||
161 | - | ||
162 | + dev->spareBuffer); | ||
163 | + } | ||
164 | } | ||
165 | |||
166 | if (retval == 0) | ||
167 | @@ -94,30 +216,24 @@ | ||
168 | TENDSTR), chunkInNAND, data, tags)); | ||
169 | |||
170 | if (data && tags) { | ||
171 | - if (dev->useNANDECC) { | ||
172 | retval = | ||
173 | mtd->read_ecc(mtd, addr, dev->nBytesPerChunk, | ||
174 | &dummy, data, dev->spareBuffer, | ||
175 | NULL); | ||
176 | - } else { | ||
177 | - retval = | ||
178 | - mtd->read_ecc(mtd, addr, dev->nBytesPerChunk, | ||
179 | - &dummy, data, dev->spareBuffer, | ||
180 | - NULL); | ||
181 | - } | ||
182 | + nandmtd2_buf2pt(dev, &pt, 0); | ||
183 | } else { | ||
184 | if (data) | ||
185 | retval = | ||
186 | mtd->read(mtd, addr, dev->nBytesPerChunk, &dummy, | ||
187 | data); | ||
188 | - if (tags) | ||
189 | + if (tags) { | ||
190 | retval = | ||
191 | mtd->read_oob(mtd, addr, mtd->oobsize, &dummy, | ||
192 | dev->spareBuffer); | ||
193 | + nandmtd2_buf2pt(dev, &pt, 1); | ||
194 | + } | ||
195 | } | ||
196 | |||
197 | - memcpy(&pt, dev->spareBuffer, sizeof(pt)); | ||
198 | - | ||
199 | if (tags) | ||
200 | yaffs_UnpackTags2(tags, &pt); | ||
201 | |||
202 | @@ -178,10 +294,11 @@ | ||
203 | *sequenceNumber = 0; | ||
204 | *state = YAFFS_BLOCK_STATE_EMPTY; | ||
205 | } | ||
206 | + | ||
207 | + T(YAFFS_TRACE_MTD, | ||
208 | + (TSTR("block is OK seq %d state %d" TENDSTR), *sequenceNumber, | ||
209 | + *state)); | ||
210 | } | ||
211 | - T(YAFFS_TRACE_MTD, | ||
212 | - (TSTR("block is bad seq %d state %d" TENDSTR), *sequenceNumber, | ||
213 | - *state)); | ||
214 | |||
215 | if (retval == 0) | ||
216 | return YAFFS_OK; | ||
diff --git a/meta/recipes-devtools/yaffs2/yaffs2-utils.inc b/meta/recipes-devtools/yaffs2/yaffs2-utils.inc new file mode 100644 index 0000000000..b25cc3b590 --- /dev/null +++ b/meta/recipes-devtools/yaffs2/yaffs2-utils.inc | |||
@@ -0,0 +1,27 @@ | |||
1 | DESCRIPTION = "Tools for managing 'yaffs2' file systems." | ||
2 | SECTION = "base" | ||
3 | HOMEPAGE = "http://www.yaffs.net" | ||
4 | LICENSE = "GPLv2" | ||
5 | PV = "0.0.0+cvs${SRCDATE}" | ||
6 | PR = "r0" | ||
7 | DEPENDS = "mtd-utils" | ||
8 | |||
9 | SRC_URI = "cvs://anonymous@cvs.aleph1.co.uk/home/aleph1/cvs;module=yaffs2 \ | ||
10 | file://mkyaffs2image.patch;patch=1" | ||
11 | S = "${WORKDIR}/yaffs2" | ||
12 | |||
13 | CFLAGS += "-I.. -DCONFIG_YAFFS_UTIL" | ||
14 | CFLAGS_append_virtclass-native = " -I.. -DCONFIG_YAFFS_UTIL" | ||
15 | |||
16 | do_compile() { | ||
17 | cd utils && oe_runmake | ||
18 | } | ||
19 | |||
20 | do_install() { | ||
21 | install -d ${D}${sbindir}/ | ||
22 | for i in mkyaffsimage mkyaffs2image; do | ||
23 | install -m 0755 utils/$i ${D}${sbindir}/ | ||
24 | done | ||
25 | } | ||
26 | |||
27 | BBCLASSEXTEND = "native" | ||
diff --git a/meta/recipes-devtools/yaffs2/yaffs2-utils_cvs.bb b/meta/recipes-devtools/yaffs2/yaffs2-utils_cvs.bb new file mode 100644 index 0000000000..6171fe55bd --- /dev/null +++ b/meta/recipes-devtools/yaffs2/yaffs2-utils_cvs.bb | |||
@@ -0,0 +1,3 @@ | |||
1 | require yaffs2-utils.inc | ||
2 | PR = "r1" | ||
3 | |||