summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/module-init-tools
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
committerRichard Purdie <richard@openedhand.com>2005-08-31 10:45:47 +0000
commit4b46c1f6e891b1ddd5968536440b888661fade3e (patch)
treee0ba2c1f56f61b868bf746da5c4feabb25b800b2 /openembedded/packages/module-init-tools
downloadpoky-4b46c1f6e891b1ddd5968536440b888661fade3e.tar.gz
Initial population
git-svn-id: https://svn.o-hand.com/repos/poky@1 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/module-init-tools')
-rw-r--r--openembedded/packages/module-init-tools/files/depmod-byteswap.patch288
-rw-r--r--openembedded/packages/module-init-tools/files/ignore_arch_directory25
-rw-r--r--openembedded/packages/module-init-tools/files/manpagesopt39
-rw-r--r--openembedded/packages/module-init-tools/files/modutils_extension55
-rw-r--r--openembedded/packages/module-init-tools/files/no_man_rebuild12
-rw-r--r--openembedded/packages/module-init-tools/files/soc.patch97
-rw-r--r--openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/ignore_arch_directory24
-rw-r--r--openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/manpagesopt39
-rw-r--r--openembedded/packages/module-init-tools/module-init-tools-cross_3.1.bb24
-rw-r--r--openembedded/packages/module-init-tools/module-init-tools_3.1.bb60
-rw-r--r--openembedded/packages/module-init-tools/module-init-tools_3.2-pre7.bb59
11 files changed, 722 insertions, 0 deletions
diff --git a/openembedded/packages/module-init-tools/files/depmod-byteswap.patch b/openembedded/packages/module-init-tools/files/depmod-byteswap.patch
new file mode 100644
index 0000000000..1b46708b30
--- /dev/null
+++ b/openembedded/packages/module-init-tools/files/depmod-byteswap.patch
@@ -0,0 +1,288 @@
1diff -u module-init-tools-3.1/orig/depmod.c module-init-tools-3.1/depmod.c
2--- module-init-tools-3.1/orig/depmod.c 2005-04-07 18:50:25.829635704 -0700
3+++ module-init-tools-3.1/depmod.c 2005-04-07 19:46:43.842099752 -0700
4@@ -17,6 +17,7 @@
5 #include <dirent.h>
6 #include <sys/utsname.h>
7 #include <sys/mman.h>
8+#include <endian.h>
9
10 #include "zlibsupport.h"
11 #include "depmod.h"
12@@ -303,16 +304,38 @@
13 goto fail;
14 }
15
16- switch (((char *)new->data)[EI_CLASS]) {
17- case ELFCLASS32:
18+ switch (((char *)new->data)[EI_CLASS] + (((char *)new->data)[EI_DATA] << 8)) {
19+ case ELFCLASS32 + (ELFDATA2LSB << 8): /* 32 bit little endian */
20+#if __BYTE_ORDER == __LITTLE_ENDIAN
21 new->ops = &mod_ops32;
22+#else
23+ new->ops = &mod_ops32swap;
24+#endif
25+ break;
26+ case ELFCLASS32 + (ELFDATA2MSB << 8): /* 32 bit big endian */
27+#if __BYTE_ORDER == __LITTLE_ENDIAN
28+ new->ops = &mod_ops32swap;
29+#else
30+ new->ops = &mod_ops32;
31+#endif
32 break;
33- case ELFCLASS64:
34+ case ELFCLASS64 + (ELFDATA2LSB << 8): /* 64 bit little endian */
35+#if __BYTE_ORDER == __LITTLE_ENDIAN
36 new->ops = &mod_ops64;
37+#else
38+ new->ops = &mod_ops64swap;
39+#endif
40+ break;
41+ case ELFCLASS64 + (ELFDATA2MSB << 8): /* 64 bit big endian */
42+#if __BYTE_ORDER == __LITTLE_ENDIAN
43+ new->ops = &mod_ops64swap;
44+#else
45+ new->ops = &mod_ops64;
46+#endif
47 break;
48 default:
49- warn("Module %s has elf unknown identifier %i\n",
50- new->pathname, ((char *)new->data)[EI_CLASS]);
51+ warn("Module %s has elf unknown identifier %i,%i\n",
52+ new->pathname, ((char *)new->data)[EI_CLASS], ((char *)new->data)[EI_DATA]);
53 goto fail;
54 }
55 return new;
56diff -u module-init-tools-3.1/orig/moduleops.c module-init-tools-3.1/moduleops.c
57--- module-init-tools-3.1/orig/moduleops.c 2005-04-07 18:50:25.829635704 -0700
58+++ module-init-tools-3.1/moduleops.c 2005-04-07 19:52:11.166338904 -0700
59@@ -9,15 +9,64 @@
60 #include "moduleops.h"
61 #include "tables.h"
62
63+/* This deals with both mis-aligned reads and endianness issues,
64+ * it may seem crude however the compiler knows 'size' at compile
65+ * time (because it comes from sizeof) therefore generates fairly
66+ * optimal code.
67+ */
68+static inline void read_native(const void *src, void *dest, unsigned int size)
69+{
70+ unsigned int i;
71+ for (i = 0; i < size; i++)
72+ ((unsigned char*)dest)[i] = ((unsigned char*)src)[i];
73+}
74+
75+#define NATIVE(x)\
76+({\
77+ typeof(x) __x;\
78+ read_native(&(x), &__x, sizeof __x);\
79+ __x;\
80+})
81+
82+static inline void read_swapped(const void *src, void *dest, unsigned int size)
83+{
84+ unsigned int i;
85+ for (i = 0; i < size; i++)
86+ ((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1];
87+}
88+
89+#define SWAPPED(x)\
90+({\
91+ typeof(x) __x;\
92+ read_swapped(&(x), &__x, sizeof __x);\
93+ __x;\
94+})
95+
96+#define PERBITCOUNT(x) x##32
97 #define PERBIT(x) x##32
98 #define ElfPERBIT(x) Elf32_##x
99 #define ELFPERBIT(x) ELF32_##x
100+#define READ(x) NATIVE(x)
101+#include "moduleops_core.c"
102+#undef PERBIT
103+#undef READ
104+#define PERBIT(x) x##32swap
105+#define READ(x) SWAPPED(x)
106 #include "moduleops_core.c"
107
108+#undef PERBITCOUNT
109 #undef PERBIT
110 #undef ElfPERBIT
111 #undef ELFPERBIT
112+#undef READ
113+#define PERBITCOUNT(x) x##64
114 #define PERBIT(x) x##64
115 #define ElfPERBIT(x) Elf64_##x
116 #define ELFPERBIT(x) ELF64_##x
117+#define READ(x) NATIVE(x)
118+#include "moduleops_core.c"
119+#undef PERBIT
120+#undef READ
121+#define PERBIT(x) x##64swap
122+#define READ(x) SWAPPED(x)
123 #include "moduleops_core.c"
124diff -u module-init-tools-3.1/orig/moduleops.h module-init-tools-3.1/moduleops.h
125--- module-init-tools-3.1/orig/moduleops.h 2005-04-07 18:50:25.829635704 -0700
126+++ module-init-tools-3.1/moduleops.h 2005-04-07 19:36:26.184997904 -0700
127@@ -24,5 +24,6 @@
128 };
129
130 extern struct module_ops mod_ops32, mod_ops64;
131+extern struct module_ops mod_ops32swap, mod_ops64swap;
132
133 #endif /* MODINITTOOLS_MODULEOPS_H */
134diff -u module-init-tools-3.1/orig/moduleops_core.c module-init-tools-3.1/moduleops_core.c
135--- module-init-tools-3.1/orig/moduleops_core.c 2005-04-07 18:50:25.829635704 -0700
136+++ module-init-tools-3.1/moduleops_core.c 2005-04-07 19:56:18.794693672 -0700
137@@ -8,14 +8,14 @@
138 char *secnames;
139
140 /* Grab section headers and strings so we can tell who is who */
141- sechdrs = (void *)hdr + hdr->e_shoff;
142- secnames = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
143+ sechdrs = (void *)hdr + READ(hdr->e_shoff);
144+ secnames = (void *)hdr + READ(sechdrs[READ(hdr->e_shstrndx)].sh_offset);
145
146 /* Find the section they want */
147- for (i = 1; i < hdr->e_shnum; i++) {
148- if (strcmp(secnames+sechdrs[i].sh_name, secname) == 0) {
149- *size = sechdrs[i].sh_size;
150- return (void *)hdr + sechdrs[i].sh_offset;
151+ for (i = 1; i < READ(hdr->e_shnum); i++) {
152+ if (strcmp(secnames+READ(sechdrs[i].sh_name), secname) == 0) {
153+ *size = READ(sechdrs[i].sh_size);
154+ return (void *)hdr + READ(sechdrs[i].sh_offset);
155 }
156 }
157 *size = 0;
158@@ -24,7 +24,7 @@
159
160 static void PERBIT(load_symbols)(struct module *module)
161 {
162- struct PERBIT(kernel_symbol) *ksyms;
163+ struct PERBITCOUNT(kernel_symbol) *ksyms;
164 char *ksymstrings;
165 unsigned long i, size;
166
167@@ -58,10 +58,10 @@
168
169 /* Old-style. */
170 ksyms = PERBIT(load_section)(module->data, "__ksymtab", &size);
171- for (i = 0; i < size / sizeof(struct PERBIT(kernel_symbol)); i++)
172+ for (i = 0; i < size / sizeof(struct PERBITCOUNT(kernel_symbol)); i++)
173 add_symbol(ksyms[i].name, module);
174 ksyms = PERBIT(load_section)(module->data, "__gpl_ksymtab", &size);
175- for (i = 0; i < size / sizeof(struct PERBIT(kernel_symbol)); i++)
176+ for (i = 0; i < size / sizeof(struct PERBITCOUNT(kernel_symbol)); i++)
177 add_symbol(ksyms[i].name, module);
178 }
179
180@@ -100,16 +100,16 @@
181
182 hdr = module->data;
183 handle_register_symbols = 0;
184- if (hdr->e_machine == EM_SPARC ||
185- hdr->e_machine == EM_SPARCV9)
186+ if (READ(hdr->e_machine) == EM_SPARC ||
187+ READ(hdr->e_machine) == EM_SPARCV9)
188 handle_register_symbols = 1;
189
190 module->num_deps = 0;
191 module->deps = NULL;
192 for (i = 1; i < size / sizeof(syms[0]); i++) {
193- if (syms[i].st_shndx == SHN_UNDEF) {
194+ if (READ(syms[i].st_shndx) == SHN_UNDEF) {
195 /* Look for symbol */
196- const char *name = strings + syms[i].st_name;
197+ const char *name = strings + READ(syms[i].st_name);
198 struct module *owner;
199 int weak;
200
201@@ -118,11 +118,11 @@
202 variables, to avoid anyone else misusing
203 them. */
204 if (handle_register_symbols
205- && (ELFPERBIT(ST_TYPE)(syms[i].st_info)
206+ && (ELFPERBIT(ST_TYPE)(READ(syms[i].st_info))
207 == STT_REGISTER))
208 continue;
209
210- weak = ELFPERBIT(ST_BIND)(syms[i].st_info) == STB_WEAK;
211+ weak = ELFPERBIT(ST_BIND)(READ(syms[i].st_info)) == STB_WEAK;
212 owner = find_symbol(name, module->pathname, weak);
213 if (owner) {
214 if (verbose)
215@@ -143,7 +143,7 @@
216 ElfPERBIT(Sym) *syms;
217 ElfPERBIT(Shdr) *sechdrs;
218
219- sechdrs = (void *)hdr + hdr->e_shoff;
220+ sechdrs = (void *)hdr + READ(hdr->e_shoff);
221 strings = PERBIT(load_section)(hdr, ".strtab", &size);
222 syms = PERBIT(load_section)(hdr, ".symtab", &size);
223
224@@ -152,14 +152,14 @@
225 return NULL;
226
227 for (i = 0; i < size / sizeof(syms[0]); i++) {
228- if (strcmp(strings + syms[i].st_name, name) == 0) {
229+ if (strcmp(strings + READ(syms[i].st_name), name) == 0) {
230 /* In BSS? Happens for empty device tables on
231 * recent GCC versions. */
232- if (sechdrs[syms[i].st_shndx].sh_type == SHT_NOBITS)
233+ if (READ(sechdrs[READ(syms[i].st_shndx)].sh_type) == SHT_NOBITS)
234 return NULL;
235 return (void *)hdr
236- + sechdrs[syms[i].st_shndx].sh_offset
237- + syms[i].st_value;
238+ + READ(sechdrs[READ(syms[i].st_shndx)].sh_offset)
239+ + READ(syms[i].st_value);
240 }
241 }
242 return NULL;
243@@ -168,36 +168,36 @@
244 /* FIXME: Check size, unless we end up using aliases anyway --RR */
245 static void PERBIT(fetch_tables)(struct module *module)
246 {
247- module->pci_size = PERBIT(PCI_DEVICE_SIZE);
248+ module->pci_size = PERBITCOUNT(PCI_DEVICE_SIZE);
249 module->pci_table = PERBIT(deref_sym)(module->data,
250 "__mod_pci_device_table");
251
252- module->usb_size = PERBIT(USB_DEVICE_SIZE);
253+ module->usb_size = PERBITCOUNT(USB_DEVICE_SIZE);
254 module->usb_table = PERBIT(deref_sym)(module->data,
255 "__mod_usb_device_table");
256
257- module->ccw_size = PERBIT(CCW_DEVICE_SIZE);
258+ module->ccw_size = PERBITCOUNT(CCW_DEVICE_SIZE);
259 module->ccw_table = PERBIT(deref_sym)(module->data,
260 "__mod_ccw_device_table");
261
262- module->ieee1394_size = PERBIT(IEEE1394_DEVICE_SIZE);
263+ module->ieee1394_size = PERBITCOUNT(IEEE1394_DEVICE_SIZE);
264 module->ieee1394_table = PERBIT(deref_sym)(module->data,
265 "__mod_ieee1394_device_table");
266
267- module->pnp_size = PERBIT(PNP_DEVICE_SIZE);
268+ module->pnp_size = PERBITCOUNT(PNP_DEVICE_SIZE);
269 module->pnp_table = PERBIT(deref_sym)(module->data,
270 "__mod_pnp_device_table");
271
272- module->pnp_card_size = PERBIT(PNP_CARD_DEVICE_SIZE);
273+ module->pnp_card_size = PERBITCOUNT(PNP_CARD_DEVICE_SIZE);
274 module->pnp_card_table = PERBIT(deref_sym)(module->data,
275 "__mod_pnp_card_device_table");
276- module->pnp_card_offset = PERBIT(PNP_CARD_DEVICE_OFFSET);
277+ module->pnp_card_offset = PERBITCOUNT(PNP_CARD_DEVICE_OFFSET);
278
279- module->input_size = PERBIT(INPUT_DEVICE_SIZE);
280+ module->input_size = PERBITCOUNT(INPUT_DEVICE_SIZE);
281 module->input_table = PERBIT(deref_sym)(module->data,
282 "__mod_input_device_table");
283
284- module->soc_size = PERBIT(SOC_DEVICE_SIZE);
285+ module->soc_size = PERBITCOUNT(SOC_DEVICE_SIZE);
286 module->soc_table = PERBIT(deref_sym)(module->data,
287 "__mod_soc_device_table");
288
diff --git a/openembedded/packages/module-init-tools/files/ignore_arch_directory b/openembedded/packages/module-init-tools/files/ignore_arch_directory
new file mode 100644
index 0000000000..2c71043221
--- /dev/null
+++ b/openembedded/packages/module-init-tools/files/ignore_arch_directory
@@ -0,0 +1,25 @@
1diff -ruN module-init-tools-3.1-pre6.orig/modprobe.8 module-init-tools-3.1-pre6/modprobe.8
2--- module-init-tools-3.1-pre6.orig/modprobe.8 2004-10-06 02:44:43.000000000 +0200
3+++ module-init-tools-3.1-pre6/modprobe.8 2004-10-09 01:39:01.000000000 +0200
4@@ -30,6 +30,7 @@
5 the modules and other files, except for the optional
6 \fI/etc/modprobe.conf\fR configuration file
7 (see \fBmodprobe.conf\fR(5)).
8+All files in the \fI/etc/modprobe.d/arch/\fR directory are ignored.
9 .PP
10 Note that this version of \fBmodprobe\fR does not
11 do anything to the module itself: the work of resolving symbols
12diff -ruN module-init-tools-3.1-pre6.orig/modprobe.c module-init-tools-3.1-pre6/modprobe.c
13--- module-init-tools-3.1-pre6.orig/modprobe.c 2004-10-09 01:40:18.000000000 +0200
14+++ module-init-tools-3.1-pre6/modprobe.c 2004-10-09 01:40:11.000000000 +0200
15@@ -1082,6 +1082,10 @@
16 {
17 DIR *dir;
18
19+ /* ignore everything in this directory */
20+ if (streq(filename, "/etc/modprobe.d/arch"))
21+ return 1;
22+
23 /* If it's a directory, recurse. */
24 dir = opendir(filename);
25 if (dir) {
diff --git a/openembedded/packages/module-init-tools/files/manpagesopt b/openembedded/packages/module-init-tools/files/manpagesopt
new file mode 100644
index 0000000000..2e9d228d58
--- /dev/null
+++ b/openembedded/packages/module-init-tools/files/manpagesopt
@@ -0,0 +1,39 @@
1Index: module-init-tools-3.1/configure.in
2===================================================================
3--- module-init-tools-3.1.orig/configure.in 2004-11-12 00:05:25.000000000 -0500
4+++ module-init-tools-3.1/configure.in 2005-01-20 02:23:16.409792288 -0500
5@@ -41,5 +41,14 @@
6 fi])
7 AC_SUBST(MODULE_DIR)
8
9-AC_OUTPUT([Makefile])
10+AC_ARG_ENABLE(manpages,
11+[ --disable-manpages Disable man page generation.],
12+[if test x"$enableval" != x"no"; then
13+ enable_manpages=yes
14+else
15+ enable_manpages=no
16+fi],
17+[enable_manpages=yes])
18+AM_CONDITIONAL([MANPAGES], test x"$enable_manpages" = x"yes")
19
20+AC_OUTPUT([Makefile])
21Index: module-init-tools-3.1/Makefile.am
22===================================================================
23--- module-init-tools-3.1.orig/Makefile.am 2004-07-12 02:11:46.000000000 -0400
24+++ module-init-tools-3.1/Makefile.am 2005-01-20 02:24:32.155277224 -0500
25@@ -21,11 +21,12 @@
26 MAN5 = modprobe.conf.5 modules.dep.5
27 MAN8 = depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8
28 SGML = $(addprefix doc/, $(MAN5:%.5=%.sgml) $(MAN8:%.8=%.sgml))
29-man_MANS = $(MAN5) $(MAN8)
30 mandir = $(shell if [ `echo $(prefix)/ | tr -s /` = / ]; then echo /usr/share/man; else echo $(prefix)/man; fi)
31
32+if MANPAGES
33+man_MANS = $(MAN5) $(MAN8)
34+endif
35
36-EXTRA_DIST = generate-modprobe.conf modprobe.devfs FAQ stress_modules.sh install-with-care $(SGML) $(man_MANS)
37
38 sbin_PROGRAMS = insmod modprobe rmmod depmod modinfo insmod.static
39 bin_PROGRAMS = lsmod
diff --git a/openembedded/packages/module-init-tools/files/modutils_extension b/openembedded/packages/module-init-tools/files/modutils_extension
new file mode 100644
index 0000000000..fd84ca2550
--- /dev/null
+++ b/openembedded/packages/module-init-tools/files/modutils_extension
@@ -0,0 +1,55 @@
1--- module-init-tools-3.0-pre10.orig/depmod.c
2+++ module-init-tools-3.0-pre10/depmod.c
3@@ -217,13 +217,13 @@
4 {
5 char *sep;
6 char pathname[strlen(argv[0])+1];
7- char oldname[strlen("depmod") + strlen(argv[0]) + sizeof(".old")];
8+ char oldname[strlen("depmod") + strlen(argv[0]) + sizeof(".24")];
9
10 memset(pathname, 0, strlen(argv[0])+1);
11 sep = strrchr(argv[0], '/');
12 if (sep)
13 memcpy(pathname, argv[0], sep - argv[0]+1);
14- sprintf(oldname, "%s%s.old", pathname, "depmod");
15+ sprintf(oldname, "%s%s.24", pathname, "depmod");
16
17 /* Recursion detection: we need an env var since we can't
18 change argv[0] (as older modutils uses it to determine
19--- module-init-tools-3.0-pre10.orig/backwards_compat.c
20+++ module-init-tools-3.0-pre10/backwards_compat.c
21@@ -21,13 +21,13 @@
22 pid_t pid;
23 char ascii_pid[32];
24 char pathname[strlen(argv[0])+1];
25- char oldname[strlen(progname) + strlen(argv[0]) + sizeof(".old")];
26+ char oldname[strlen(progname) + strlen(argv[0]) + sizeof(".24")];
27
28 memset(pathname, 0, strlen(argv[0])+1);
29 sep = strrchr(argv[0], '/');
30 if (sep)
31 memcpy(pathname, argv[0], sep - argv[0]+1);
32- sprintf(oldname, "%s%s.old", pathname, progname);
33+ sprintf(oldname, "%s%s.24", pathname, progname);
34
35 /* Recursion detection: we need an env var since we can't
36 change argv[0] (as older modutils uses it to determine
37--- module-init-tools-3.0-pre10.orig/generate-modprobe.conf
38+++ module-init-tools-3.0-pre10/generate-modprobe.conf
39@@ -26,12 +26,12 @@
40 cp $TESTING_MODPROBE_CONF $MODPROBECONF
41 elif [ "$STDIN" = "1" ]; then
42 cat > $MODPROBECONF
43-elif [ -x /sbin/modprobe.old ]; then
44+elif [ -x /sbin/modprobe.24 ]; then
45 # In sbin.
46- /sbin/modprobe.old -c > $MODPROBECONF
47-elif modprobe.old -c >/dev/null 2>&1; then
48+ /sbin/modprobe.24 -c > $MODPROBECONF
49+elif modprobe.24 -c >/dev/null 2>&1; then
50 # Somewhere in path.
51- modprobe.old -c > $MODPROBECONF
52+ modprobe.24 -c > $MODPROBECONF
53 elif /sbin/modprobe -V 2>/dev/null | grep -q 'modprobe version'; then
54 # Running /sbin/modprobe gives old version.
55 /sbin/modprobe -c > $MODPROBECONF
diff --git a/openembedded/packages/module-init-tools/files/no_man_rebuild b/openembedded/packages/module-init-tools/files/no_man_rebuild
new file mode 100644
index 0000000000..d38866aece
--- /dev/null
+++ b/openembedded/packages/module-init-tools/files/no_man_rebuild
@@ -0,0 +1,12 @@
1diff -ruN module-init-tools-3.1.orig/Makefile.in module-init-tools-3.1/Makefile.in
2--- module-init-tools-3.1.orig/Makefile.in 2004-11-15 01:59:48.000000000 +0100
3+++ module-init-tools-3.1/Makefile.in 2004-11-21 02:18:58.000000000 +0100
4@@ -613,7 +613,7 @@
5 check-am: all-am
6 $(MAKE) $(AM_MAKEFLAGS) check-TESTS
7 check: check-am
8-all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS)
9+all-am: Makefile $(PROGRAMS) $(SCRIPTS) #$(MANS)
10
11 installdirs:
12 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(man5dir) $(DESTDIR)$(man8dir)
diff --git a/openembedded/packages/module-init-tools/files/soc.patch b/openembedded/packages/module-init-tools/files/soc.patch
new file mode 100644
index 0000000000..ee5f11042f
--- /dev/null
+++ b/openembedded/packages/module-init-tools/files/soc.patch
@@ -0,0 +1,97 @@
1--- tables.c~ 2003-12-24 05:23:38.000000000 +0000
2+++ tables.c 2005-04-02 13:12:24.370140112 +0100
3@@ -18,6 +18,34 @@
4 }
5
6 /* We set driver_data to zero */
7+static void output_soc_entry(struct soc_device_id *soc, char *name, FILE *out)
8+{
9+ fprintf(out,
10+ "%-20s 0x%08x 0x0\n",
11+ name,
12+ soc->id);
13+}
14+
15+void output_soc_table(struct module *modules, FILE *out)
16+{
17+ struct module *i;
18+
19+ fprintf(out, "# soc module id driver_data\n");
20+
21+ for (i = modules; i; i = i->next) {
22+ struct soc_device_id *e;
23+ char shortname[strlen(i->pathname) + 1];
24+
25+ if (!i->soc_table)
26+ continue;
27+
28+ make_shortname(shortname, i->pathname);
29+ for (e = i->soc_table; e->id; e = (void *)e + i->soc_size)
30+ output_soc_entry(e, shortname, out);
31+ }
32+}
33+
34+/* We set driver_data to zero */
35 static void output_pci_entry(struct pci_device_id *pci, char *name, FILE *out)
36 {
37 fprintf(out,
38--- tables.h~ 2003-12-24 05:18:54.000000000 +0000
39+++ tables.h 2005-04-02 13:05:15.269373344 +0100
40@@ -116,6 +116,15 @@
41 #define INPUT_DEVICE_SIZE32 (4 + 4 * 2 + 4 + 16 * 4 + 4 + 2 * 4 + 4 + 4 + 4 + 4 * 4 + 4)
42 #define INPUT_DEVICE_SIZE64 (8 + 4 * 2 + 8 + 8 * 8 + 8 + 8 + 8 + 8 + 8 + 2 * 8 + 8)
43
44+#include <stdint.h>
45+
46+typedef struct soc_device_id {
47+ uint32_t id;
48+} soc_device_id;
49+
50+#define SOC_DEVICE_SIZE32 (4 + 4)
51+#define SOC_DEVICE_SIZE64 (4 + 8)
52+
53 /* Functions provided by tables.c */
54 struct module;
55 void output_usb_table(struct module *modules, FILE *out);
56@@ -124,5 +133,6 @@
57 void output_ccw_table(struct module *modules, FILE *out);
58 void output_isapnp_table(struct module *modules, FILE *out);
59 void output_input_table(struct module *modules, FILE *out);
60+void output_soc_table(struct module *modules, FILE *out);
61
62 #endif /* MODINITTOOLS_TABLES_H */
63--- moduleops_core.c~ 2004-08-12 06:08:35.000000000 +0100
64+++ moduleops_core.c 2005-04-02 13:04:13.367783816 +0100
65@@ -196,6 +196,11 @@
66 module->input_size = PERBIT(INPUT_DEVICE_SIZE);
67 module->input_table = PERBIT(deref_sym)(module->data,
68 "__mod_input_device_table");
69+
70+ module->soc_size = PERBIT(SOC_DEVICE_SIZE);
71+ module->soc_table = PERBIT(deref_sym)(module->data,
72+ "__mod_soc_device_table");
73+
74 }
75
76 struct module_ops PERBIT(mod_ops) = {
77--- depmod.h~ 2003-12-24 02:10:57.000000000 +0000
78+++ depmod.h 2005-04-02 13:03:19.006048056 +0100
79@@ -47,6 +47,8 @@
80 void *pnp_card_table;
81 unsigned int input_size;
82 void *input_table;
83+ unsigned int soc_size;
84+ void *soc_table;
85
86 /* File contents and length. */
87 void *data;
88--- depmod.c~ 2005-02-14 04:50:51.744716656 +0000
89+++ depmod.c 2005-04-02 13:03:37.051304760 +0100
90@@ -683,6 +683,7 @@
91 { "modules.ieee1394map", output_ieee1394_table },
92 { "modules.isapnpmap", output_isapnp_table },
93 { "modules.inputmap", output_input_table },
94+ { "modules.socmap", output_soc_table },
95 { "modules.alias", output_aliases },
96 { "modules.symbols", output_symbols },
97 };
diff --git a/openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/ignore_arch_directory b/openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/ignore_arch_directory
new file mode 100644
index 0000000000..185ea7a3a5
--- /dev/null
+++ b/openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/ignore_arch_directory
@@ -0,0 +1,24 @@
1diff -ruN module-init-tools-3.1-pre6.orig/modprobe.8 module-init-tools-3.1-pre6/modprobe.8
2--- module-init-tools-3.2-pre7/modprobe.8.orig 2005-07-05 13:52:32.000000000 +0200
3+++ module-init-tools-3.2-pre7/modprobe.8 2005-07-05 13:52:42.000000000 +0200
4@@ -31,6 +31,7 @@
5 \fI/etc/modprobe.conf\fR configuration file and
6 \fI/etc/modprobe.d\fR directory
7 (see \fBmodprobe.conf\fR(5)).
8+All files in the \fI/etc/modprobe.d/arch/\fR directory are ignored.
9 .PP
10 Note that this version of \fBmodprobe\fR does not
11 do anything to the module itself: the work of resolving symbols
12--- module-init-tools-3.2-pre7/modprobe.c.orig 2005-07-05 13:50:00.000000000 +0200
13+++ module-init-tools-3.2-pre7/modprobe.c 2005-07-05 13:50:15.000000000 +0200
14@@ -1158,6 +1158,10 @@
15 DIR *dir;
16 int ret = 0;
17
18+ /* ignore everything in this directory */
19+ if (streq(filename, "/etc/modprobe.d/arch"))
20+ return 1;
21+
22 /* Reiser4 has file/directory duality: treat it as both. */
23 dir = opendir(filename);
24 if (dir) {
diff --git a/openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/manpagesopt b/openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/manpagesopt
new file mode 100644
index 0000000000..ee1454c6ef
--- /dev/null
+++ b/openembedded/packages/module-init-tools/module-init-tools-3.2-pre7/manpagesopt
@@ -0,0 +1,39 @@
1Index: module-init-tools-3.1/configure.in
2===================================================================
3--- module-init-tools-3.1.orig/configure.in 2004-11-12 00:05:25.000000000 -0500
4+++ module-init-tools-3.1/configure.in 2005-01-20 02:23:16.409792288 -0500
5@@ -41,5 +41,14 @@
6 fi])
7 AC_SUBST(MODULE_DIR)
8
9-AC_OUTPUT([Makefile])
10+AC_ARG_ENABLE(manpages,
11+[ --disable-manpages Disable man page generation.],
12+[if test x"$enableval" != x"no"; then
13+ enable_manpages=yes
14+else
15+ enable_manpages=no
16+fi],
17+[enable_manpages=yes])
18+AM_CONDITIONAL([MANPAGES], test x"$enable_manpages" = x"yes")
19
20+AC_OUTPUT([Makefile])
21--- module-init-tools-3.2-pre7/Makefile.am.orig 2005-07-05 13:55:06.000000000 +0200
22+++ module-init-tools-3.2-pre7/Makefile.am 2005-07-05 13:55:31.000000000 +0200
23@@ -21,13 +21,14 @@
24 MAN5 = modprobe.conf.5 modules.dep.5
25 MAN8 = depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8
26 SGML = $(addprefix doc/, $(MAN5:%.5=%.sgml) $(MAN8:%.8=%.sgml))
27-man_MANS = $(MAN5) $(MAN8)
28 # If they haven't overridden mandir, fix it (never /man!)
29 mandir =$(shell if [ @mandir@ = $(prefix)/man ]; then if [ $(prefix) = / ]; then echo /usr/share/man; else echo $(prefix)/share/man; fi; else echo @mandir@; fi)
30
31 TESTSUITE := $(shell find tests -type f ! -name '*~')
32
33-EXTRA_DIST = generate-modprobe.conf modprobe.devfs FAQ CODING stress_modules.sh install-with-care $(SGML) $(man_MANS) $(TESTSUITE)
34+if MANPAGES
35+man_MANS = $(MAN5) $(MAN8)
36+endif
37
38 sbin_PROGRAMS = insmod modprobe rmmod depmod modinfo insmod.static
39 bin_PROGRAMS = lsmod
diff --git a/openembedded/packages/module-init-tools/module-init-tools-cross_3.1.bb b/openembedded/packages/module-init-tools/module-init-tools-cross_3.1.bb
new file mode 100644
index 0000000000..56fec56072
--- /dev/null
+++ b/openembedded/packages/module-init-tools/module-init-tools-cross_3.1.bb
@@ -0,0 +1,24 @@
1LICENSE = "GPL"
2include module-init-tools_${PV}.bb
3inherit cross
4DEFAULT_PREFERENCE = "0"
5PROVIDES += "virtual/${TARGET_PREFIX}depmod virtual/${TARGET_PREFIX}depmod-2.6"
6
7PR="r3"
8
9# When cross compiling depmod as shipped cannot handle endian
10# differences between host and target, this fixes the problem.
11# It also solves any possible issues with alignment (only likely
12# if cross compiling for a low alignment target - e.g. x86, on
13# a high alignment host - e.g. SPARC).
14SRC_URI += " file://depmod-byteswap.patch;patch=1 "
15
16EXTRA_OECONF_append = " --program-prefix=${TARGET_PREFIX}"
17
18do_stage () {
19 oe_runmake install
20}
21
22do_install () {
23 :
24}
diff --git a/openembedded/packages/module-init-tools/module-init-tools_3.1.bb b/openembedded/packages/module-init-tools/module-init-tools_3.1.bb
new file mode 100644
index 0000000000..62523f513a
--- /dev/null
+++ b/openembedded/packages/module-init-tools/module-init-tools_3.1.bb
@@ -0,0 +1,60 @@
1LICENSE = "GPL"
2SECTION = "base"
3DESCRIPTION = "This package contains a set of programs for loading, inserting, and \
4removing kernel modules for Linux (versions 2.5.48 and above). It serves \
5the same function that the modutils package serves for Linux 2.4."
6PR = "r2"
7
8PACKAGES =+ "module-init-tools-insmod-static module-init-tools-depmod"
9RDEPENDS_${PN} += "module-init-tools-depmod"
10
11FILES_module-init-tools-depmod = "${sbindir}/depmod.26"
12FILES_module-init-tools-insmod-static = "${sbindir}/insmod.static"
13
14SRC_URI = "ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-${PV}.tar.bz2 \
15 file://ignore_arch_directory;patch=1 \
16 file://modutils_extension;patch=1 \
17 file://no_man_rebuild;patch=1 \
18 file://manpagesopt;patch=1 \
19 file://soc.patch;patch=1;pnum=0"
20S = "${WORKDIR}/module-init-tools-${PV}"
21
22EXTRA_OECONF = "--disable-manpages"
23
24bindir = "/bin"
25sbindir = "/sbin"
26
27inherit autotools
28
29do_install() {
30 autotools_do_install
31 for f in bin/lsmod sbin/insmod sbin/rmmod sbin/modprobe sbin/modinfo sbin/depmod; do
32 mv ${D}/$f ${D}/$f.26
33 done
34}
35
36pkg_postinst_module-init-tools() {
37#!/bin/sh
38for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/depmod sbin/modinfo bin/lsmod; do
39bn=`basename $f`
40 update-alternatives --install /$f $bn /$f.26 20
41done
42}
43
44pkg_prerm_module-init-tools() {
45#!/bin/sh
46for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/depmod sbin/modinfo bin/lsmod; do
47bn=`basename $f`
48 update-alternatives --remove $bn /$f.26
49done
50}
51
52pkg_postinst_module-init-tools-depmod() {
53#!/bin/sh
54update-alternatives --install /sbin/depmod depmod /sbin/depmod.26 20
55}
56
57pkg_prerm_module-init-tools() {
58#!/bin/sh
59update-alternatives --remove depmod /sbin/depmod.26
60}
diff --git a/openembedded/packages/module-init-tools/module-init-tools_3.2-pre7.bb b/openembedded/packages/module-init-tools/module-init-tools_3.2-pre7.bb
new file mode 100644
index 0000000000..41aea223fe
--- /dev/null
+++ b/openembedded/packages/module-init-tools/module-init-tools_3.2-pre7.bb
@@ -0,0 +1,59 @@
1DESCRIPTION = "This package contains a set of programs for loading, inserting, and \
2removing kernel modules for Linux (versions 2.5.48 and above). It serves \
3the same function that the modutils package serves for Linux 2.4."
4LICENSE = "GPL"
5SECTION = "base"
6PR = "r0"
7
8PACKAGES =+ "module-init-tools-insmod-static module-init-tools-depmod"
9RDEPENDS_${PN} += "module-init-tools-depmod"
10
11FILES_module-init-tools-depmod = "${sbindir}/depmod.26"
12FILES_module-init-tools-insmod-static = "${sbindir}/insmod.static"
13
14SRC_URI = "ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-${PV}.tar.bz2 \
15 file://ignore_arch_directory;patch=1 \
16 file://modutils_extension;patch=1 \
17 file://no_man_rebuild;patch=1 \
18 file://manpagesopt;patch=1 "
19S = "${WORKDIR}/module-init-tools-${PV}"
20
21EXTRA_OECONF = "--disable-manpages"
22
23bindir = "/bin"
24sbindir = "/sbin"
25
26inherit autotools
27
28do_install() {
29 autotools_do_install
30 for f in bin/lsmod sbin/insmod sbin/rmmod sbin/modprobe sbin/modinfo sbin/depmod; do
31 mv ${D}/$f ${D}/$f.26
32 done
33}
34
35pkg_postinst_module-init-tools() {
36#!/bin/sh
37for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/depmod sbin/modinfo bin/lsmod; do
38bn=`basename $f`
39 update-alternatives --install /$f $bn /$f.26 20
40done
41}
42
43pkg_prerm_module-init-tools() {
44#!/bin/sh
45for f in sbin/insmod sbin/modprobe sbin/rmmod sbin/depmod sbin/modinfo bin/lsmod; do
46bn=`basename $f`
47 update-alternatives --remove $bn /$f.26
48done
49}
50
51pkg_postinst_module-init-tools-depmod() {
52#!/bin/sh
53update-alternatives --install /sbin/depmod depmod /sbin/depmod.26 20
54}
55
56pkg_prerm_module-init-tools() {
57#!/bin/sh
58update-alternatives --remove depmod /sbin/depmod.26
59}