aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-07-25 10:40:14 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-07-25 10:40:14 -0400
commitff877ea80efa2015b6263766f78ee42c2a1b32f9 (patch)
tree85205005c611ab774702148558321c6fb92f1ccd /scripts
parent30821fee4f0cb3e6d241d9f7ddc37742212e3eb7 (diff)
parentd37e6bf68fc1eb34a4ad21d9ae8890ed37ea80e7 (diff)
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.fwinst66
-rw-r--r--scripts/Makefile.lib3
-rw-r--r--scripts/Makefile.modpost1
-rw-r--r--scripts/mod/file2alias.c36
-rw-r--r--scripts/mod/modpost.c3
5 files changed, 99 insertions, 10 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
new file mode 100644
index 000000000000..c972c0f54ce0
--- /dev/null
+++ b/scripts/Makefile.fwinst
@@ -0,0 +1,66 @@
1# ==========================================================================
2# Installing firmware
3#
4# We don't include the .config, so all firmware files are in $(fw-shipped-)
5# rather than in $(fw-shipped-y) or $(fw-shipped-n).
6# ==========================================================================
7
8INSTALL := install
9src := $(obj)
10
11# For modules_install installing firmware, we want to see .config
12# But for firmware_install, we don't care, but don't want to require it.
13-include $(objtree)/.config
14
15include scripts/Kbuild.include
16include $(srctree)/$(obj)/Makefile
17
18include scripts/Makefile.host
19
20mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-m))
21
22# If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the
23# firmware for in-kernel drivers too.
24ifndef CONFIG_FIRMWARE_IN_KERNEL
25mod-fw += $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-y))
26endif
27
28installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
29installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
30
31# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
32PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
33$(INSTALL_FW_PATH)/$$(%): install-all-dirs
34 @true
35install-all-dirs: $(installed-fw-dirs)
36 @true
37
38quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
39 cmd_install = $(INSTALL) -m0644 $< $@
40
41$(installed-fw-dirs):
42 $(call cmd,mkdir)
43
44$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
45 $(call cmd,install)
46
47PHONY += __fw_install __fw_modinst FORCE
48
49.PHONY: $(PHONY)
50
51__fw_install: $(installed-fw)
52__fw_modinst: $(mod-fw)
53
54FORCE:
55
56# Read all saved command lines and dependencies for the $(targets) we
57# may be building using $(if_changed{,_dep}). As an optimization, we
58# don't need to read them if the target does not exist; we will rebuild
59# anyway in that case.
60
61targets := $(wildcard $(sort $(targets)))
62cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
63
64ifneq ($(cmd_files),)
65 include $(cmd_files)
66endif
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8e440233c27d..ea48b82a3707 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -96,7 +96,8 @@ basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
96modname_flags = $(if $(filter 1,$(words $(modname))),\ 96modname_flags = $(if $(filter 1,$(words $(modname))),\
97 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))") 97 -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
98 98
99_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o) 99orig_c_flags = $(KBUILD_CFLAGS) $(ccflags-y) $(CFLAGS_$(basetarget).o)
100_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
100_a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o) 101_a_flags = $(KBUILD_AFLAGS) $(asflags-y) $(AFLAGS_$(basetarget).o)
101_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) 102_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
102 103
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 17092d6c7db3..9ee9783aea57 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -101,6 +101,7 @@ quiet_cmd_kernel-mod = MODPOST $@
101 cmd_kernel-mod = $(modpost) $@ 101 cmd_kernel-mod = $(modpost) $@
102 102
103vmlinux.o: FORCE 103vmlinux.o: FORCE
104 @rm -fr $(kernelmarkersfile)
104 $(call cmd,kernel-mod) 105 $(call cmd,kernel-mod)
105 106
106# Declare generated files as targets for modpost 107# Declare generated files as targets for modpost
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index cea4a790e1e9..1fcaf3284a6a 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -304,6 +304,14 @@ static int do_ap_entry(const char *filename,
304 return 1; 304 return 1;
305} 305}
306 306
307/* looks like: "css:tN" */
308static int do_css_entry(const char *filename,
309 struct css_device_id *id, char *alias)
310{
311 sprintf(alias, "css:t%01X", id->type);
312 return 1;
313}
314
307/* Looks like: "serio:tyNprNidNexN" */ 315/* Looks like: "serio:tyNprNidNexN" */
308static int do_serio_entry(const char *filename, 316static int do_serio_entry(const char *filename,
309 struct serio_device_id *id, char *alias) 317 struct serio_device_id *id, char *alias)
@@ -332,11 +340,18 @@ static int do_acpi_entry(const char *filename,
332} 340}
333 341
334/* looks like: "pnp:dD" */ 342/* looks like: "pnp:dD" */
335static int do_pnp_entry(const char *filename, 343static void do_pnp_device_entry(void *symval, unsigned long size,
336 struct pnp_device_id *id, char *alias) 344 struct module *mod)
337{ 345{
338 sprintf(alias, "pnp:d%s*", id->id); 346 const unsigned long id_size = sizeof(struct pnp_device_id);
339 return 1; 347 const struct pnp_device_id *id = symval;
348
349 device_id_check(mod->name, "pnp", size, id_size, symval);
350
351 buf_printf(&mod->dev_table_buf,
352 "MODULE_ALIAS(\"pnp:d%s*\");\n", id->id);
353 buf_printf(&mod->dev_table_buf,
354 "MODULE_ALIAS(\"acpi*:%s:*\");\n", id->id);
340} 355}
341 356
342/* looks like: "pnp:dD" for every device of the card */ 357/* looks like: "pnp:dD" for every device of the card */
@@ -380,9 +395,12 @@ static void do_pnp_card_entries(void *symval, unsigned long size,
380 } 395 }
381 396
382 /* add an individual alias for every device entry */ 397 /* add an individual alias for every device entry */
383 if (!dup) 398 if (!dup) {
384 buf_printf(&mod->dev_table_buf, 399 buf_printf(&mod->dev_table_buf,
385 "MODULE_ALIAS(\"pnp:d%s*\");\n", id); 400 "MODULE_ALIAS(\"pnp:d%s*\");\n", id);
401 buf_printf(&mod->dev_table_buf,
402 "MODULE_ALIAS(\"acpi*:%s:*\");\n", id);
403 }
386 } 404 }
387 } 405 }
388} 406}
@@ -680,6 +698,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
680 do_table(symval, sym->st_size, 698 do_table(symval, sym->st_size,
681 sizeof(struct ap_device_id), "ap", 699 sizeof(struct ap_device_id), "ap",
682 do_ap_entry, mod); 700 do_ap_entry, mod);
701 else if (sym_is(symname, "__mod_css_device_table"))
702 do_table(symval, sym->st_size,
703 sizeof(struct css_device_id), "css",
704 do_css_entry, mod);
683 else if (sym_is(symname, "__mod_serio_device_table")) 705 else if (sym_is(symname, "__mod_serio_device_table"))
684 do_table(symval, sym->st_size, 706 do_table(symval, sym->st_size,
685 sizeof(struct serio_device_id), "serio", 707 sizeof(struct serio_device_id), "serio",
@@ -689,9 +711,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
689 sizeof(struct acpi_device_id), "acpi", 711 sizeof(struct acpi_device_id), "acpi",
690 do_acpi_entry, mod); 712 do_acpi_entry, mod);
691 else if (sym_is(symname, "__mod_pnp_device_table")) 713 else if (sym_is(symname, "__mod_pnp_device_table"))
692 do_table(symval, sym->st_size, 714 do_pnp_device_entry(symval, sym->st_size, mod);
693 sizeof(struct pnp_device_id), "pnp",
694 do_pnp_entry, mod);
695 else if (sym_is(symname, "__mod_pnp_card_device_table")) 715 else if (sym_is(symname, "__mod_pnp_card_device_table"))
696 do_pnp_card_entries(symval, sym->st_size, mod); 716 do_pnp_card_entries(symval, sym->st_size, mod);
697 else if (sym_is(symname, "__mod_pcmcia_device_table")) 717 else if (sym_is(symname, "__mod_pcmcia_device_table"))
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index a07f91aac920..8f038e6d5f98 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1992,7 +1992,8 @@ static void read_markers(const char *fname)
1992 mod->skip = 1; 1992 mod->skip = 1;
1993 } 1993 }
1994 1994
1995 add_marker(mod, marker, fmt); 1995 if (!mod->skip)
1996 add_marker(mod, marker, fmt);
1996 } 1997 }
1997 return; 1998 return;
1998fail: 1999fail: