From a0bf9fc93013292c3e4c378d1d1bfedeca310b58 Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Sun, 29 Aug 2010 10:38:46 +0530 Subject: [PATCH 1/6] remove per module lst files for creating fs.lst, command.lst, etc. --- conf/Makefile.common | 8 +--- gentpl.py | 33 +------------ grub-core/Makefile.am | 91 ++++++++++++++++++++++++------------ grub-core/gencmdlist.sh | 22 --------- grub-core/genfslist.sh | 26 ----------- grub-core/genhandlerlist.sh | 19 -------- grub-core/genpartmaplist.sh | 26 ----------- grub-core/genparttoollist.sh | 19 -------- grub-core/genterminallist.sh | 20 -------- grub-core/genvideolist.sh | 26 ----------- 10 files changed, 63 insertions(+), 227 deletions(-) delete mode 100644 grub-core/gencmdlist.sh delete mode 100644 grub-core/genfslist.sh delete mode 100644 grub-core/genhandlerlist.sh delete mode 100644 grub-core/genpartmaplist.sh delete mode 100644 grub-core/genparttoollist.sh delete mode 100644 grub-core/genterminallist.sh delete mode 100644 grub-core/genvideolist.sh diff --git a/conf/Makefile.common b/conf/Makefile.common index eb70f7f77..528fa418f 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -85,18 +85,12 @@ CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime # Define these variables to calm down automake -FS_FILES = +PP_FILES = DEF_FILES = UND_FILES = IMG_FILES = MOD_FILES = -VIDEO_FILES = MODULE_FILES = -HANDLER_FILES = -PARTMAP_FILES = -COMMAND_FILES = -PARTTOOL_FILES = -TERMINAL_FILES = KERNEL_HEADER_FILES = man_MANS = diff --git a/gentpl.py b/gentpl.py index 17bda02c6..783a425fa 100644 --- a/gentpl.py +++ b/gentpl.py @@ -290,17 +290,7 @@ def module(platform): r += gvar_add("platform_DATA", "[+ name +].mod") r += gvar_add("CLEANFILES", "def-[+ name +].lst und-[+ name +].lst mod-[+ name +].c mod-[+ name +].o [+ name +].mod") - r += gvar_add("COMMAND_FILES", "command-[+ name +].lst") - r += gvar_add("FS_FILES", "fs-[+ name +].lst") - r += gvar_add("VIDEO_FILES", "video-[+ name +].lst") - r += gvar_add("PARTMAP_FILES", "partmap-[+ name +].lst") - r += gvar_add("HANDLER_FILES", "handler-[+ name +].lst") - r += gvar_add("PARTTOOL_FILES", "parttool-[+ name +].lst") - r += gvar_add("TERMINAL_FILES", "terminal-[+ name +].lst") - r += gvar_add("CLEANFILES", "command-[+ name +].lst fs-[+ name +].lst") - r += gvar_add("CLEANFILES", "handler-[+ name +].lst terminal-[+ name +].lst") - r += gvar_add("CLEANFILES", "video-[+ name +].lst partmap-[+ name +].lst parttool-[+ name +].lst") - + r += gvar_add("PP_FILES", "[+ name +].pp") r += gvar_add("CLEANFILES", "[+ name +].pp") r += """ [+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES) @@ -332,27 +322,6 @@ mod-[+ name +].o: mod-[+ name +].c if test ! -z '$(TARGET_OBJ2ELF)'; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@; \ fi - -command-[+ name +].lst: [+ name +].pp $(srcdir)/gencmdlist.sh - cat $< | sh $(srcdir)/gencmdlist.sh [+ name +] > $@ || (rm -f $@; exit 1) - -fs-[+ name +].lst: [+ name +].pp $(srcdir)/genfslist.sh - cat $< | sh $(srcdir)/genfslist.sh [+ name +] > $@ || (rm -f $@; exit 1) - -video-[+ name +].lst: [+ name +].pp $(srcdir)/genvideolist.sh - cat $< | sh $(srcdir)/genvideolist.sh [+ name +] > $@ || (rm -f $@; exit 1) - -partmap-[+ name +].lst: [+ name +].pp $(srcdir)/genpartmaplist.sh - cat $< | sh $(srcdir)/genpartmaplist.sh [+ name +] > $@ || (rm -f $@; exit 1) - -parttool-[+ name +].lst: [+ name +].pp $(srcdir)/genparttoollist.sh - cat $< | sh $(srcdir)/genparttoollist.sh [+ name +] > $@ || (rm -f $@; exit 1) - -handler-[+ name +].lst: [+ name +].pp $(srcdir)/genhandlerlist.sh - cat $< | sh $(srcdir)/genhandlerlist.sh [+ name +] > $@ || (rm -f $@; exit 1) - -terminal-[+ name +].lst: [+ name +].pp $(srcdir)/genterminallist.sh - cat $< | sh $(srcdir)/genterminallist.sh [+ name +] > $@ || (rm -f $@; exit 1) """ return r diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 773803544..33f5db46e 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -256,56 +256,87 @@ grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES) CLEANFILES += grub_emu_init.c endif -# .lst files -platform_DATA += moddep.lst -platform_DATA += fs.lst -platform_DATA += command.lst -platform_DATA += partmap.lst -platform_DATA += handler.lst -platform_DATA += terminal.lst -platform_DATA += parttool.lst -platform_DATA += video.lst -platform_DATA += crypto.lst -CLEANFILES += moddep.lst -CLEANFILES += handler.lst -CLEANFILES += terminal.lst -CLEANFILES += parttool.lst -CLEANFILES += video.lst -CLEANFILES += crypto.lst +# List files -fs.lst: $(FS_FILES) - cat $^ /dev/null | sort | uniq > $@ +fs.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + if grep -v "^#" $$pp | grep '^ *grub_fs_register' >/dev/null 2>&1; then \ + echo $$b; \ + fi; \ + done) | sort -u > $@ +platform_DATA += fs.lst CLEANFILES += fs.lst -command.lst: $(COMMAND_FILES) - cat $^ /dev/null | sort | uniq > $@ +command.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + grep -v "^#" $$pp | sed -n \ + -e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" \ + -e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ + -e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}"; \ + done) | sort -u > $@ +platform_DATA += command.lst CLEANFILES += command.lst -partmap.lst: $(PARTMAP_FILES) - cat $^ /dev/null | sort | uniq > $@ +partmap.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + if grep -v "^#" $$pp | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then \ + echo $$b; \ + fi; \ + done) | sort -u > $@ +platform_DATA += partmap.lst CLEANFILES += partmap.lst -handler.lst: $(HANDLER_FILES) - cat $^ /dev/null | sort | uniq > $@ +handler.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + grep -v "^#" $$pp | sed -n \ + -e "/grub_parser_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/parser.\1: $$b/;p;}"; \ + done) | sort -u > $@ +platform_DATA += handler.lst CLEANFILES += handler.lst -terminal.lst: $(TERMINAL_FILES) - cat $^ /dev/null | sort | uniq > $@ +terminal.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + grep -v "^#" $$pp | sed -n \ + -e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \ + -e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}"; \ + done) | sort -u > $@ +platform_DATA += terminal.lst CLEANFILES += terminal.lst -parttool.lst: $(PARTTOOL_FILES) - cat $^ /dev/null | sort | uniq > $@ +parttool.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + grep -v "^#" $$pp | sed -n \ + -e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}"; \ + done) | sort -u > $@ +platform_DATA += parttool.lst CLEANFILES += parttool.lst -video.lst: $(VIDEO_FILES) - cat $^ /dev/null | sort | uniq > $@ +video.lst: $(PP_FILES) + (for pp in $^; do \ + b=`basename $$pp .pp`; \ + if grep -v "^#" $$pp | grep '^ *grub_video_register' >/dev/null 2>&1; then \ + echo $$b; \ + fi; \ + done) | sort -u > $@ +platform_DATA += video.lst CLEANFILES += video.lst # but, crypto.lst is simply copied crypto.lst: $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst cp $^ $@ +platform_DATA += crypto.lst CLEANFILES += crypto.lst +# .lst files +platform_DATA += moddep.lst +CLEANFILES += moddep.lst + # generate global module dependencies list moddep.lst: kernel_syms.lst genmoddep.awk $(DEF_FILES) $(UND_FILES) cat $(DEF_FILES) kernel_syms.lst /dev/null \ diff --git a/grub-core/gencmdlist.sh b/grub-core/gencmdlist.sh deleted file mode 100644 index ed5965f07..000000000 --- a/grub-core/gencmdlist.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2005,2009 Free Software Foundation, Inc. -# -# This gensymlist.sh is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect command names. - -module=$1 - -grep -v "^#" | sed -n \ - -e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \ - -e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" \ - -e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" - diff --git a/grub-core/genfslist.sh b/grub-core/genfslist.sh deleted file mode 100644 index 6fa7e927d..000000000 --- a/grub-core/genfslist.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2005,2008 Free Software Foundation, Inc. -# -# This gensymlist.sh is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect fs names. - -module=$1 - -# Ignore kernel.mod. -if test $module = kernel; then - exit -fi - -# For now, this emits only a module name, if the module registers a filesystem. -if grep -v "^#" | grep '^ *grub_fs_register' >/dev/null 2>&1; then - echo $module -fi diff --git a/grub-core/genhandlerlist.sh b/grub-core/genhandlerlist.sh deleted file mode 100644 index e4cb0d9de..000000000 --- a/grub-core/genhandlerlist.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2009 Free Software Foundation, Inc. -# -# This script is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect command names. - -module=$1 - -grep -v "^#" | sed -n \ - -e "/grub_parser_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/parser.\1: $module/;p;}" diff --git a/grub-core/genpartmaplist.sh b/grub-core/genpartmaplist.sh deleted file mode 100644 index fceb0f869..000000000 --- a/grub-core/genpartmaplist.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2005, 2008 Free Software Foundation, Inc. -# -# This script is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect partmap names. - -module=$1 - -# Ignore kernel.mod. -if test $module = kernel; then - exit -fi - -# For now, this emits only a module name, if the module registers a partition map. -if grep -v "^#" | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then - echo $module -fi diff --git a/grub-core/genparttoollist.sh b/grub-core/genparttoollist.sh deleted file mode 100644 index 48a0efe55..000000000 --- a/grub-core/genparttoollist.sh +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2009 Free Software Foundation, Inc. -# -# This gensymlist.sh is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect parttool names. - -module=$1 - -grep -v "^#" | sed -n \ - -e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" diff --git a/grub-core/genterminallist.sh b/grub-core/genterminallist.sh deleted file mode 100644 index 60f5b9105..000000000 --- a/grub-core/genterminallist.sh +++ /dev/null @@ -1,20 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2009,2010 Free Software Foundation, Inc. -# -# This script is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect command names. - -module=$1 - -grep -v "^#" | sed -n \ - -e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $module/;p;}" \ - -e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $module/;p;}" \ diff --git a/grub-core/genvideolist.sh b/grub-core/genvideolist.sh deleted file mode 100644 index b208fa25c..000000000 --- a/grub-core/genvideolist.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2005,2008,2009 Free Software Foundation, Inc. -# -# This script is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Read source code from stdin and detect partmap names. - -module=$1 - -# Ignore video.mod. -if test $module = video; then - exit -fi - -# For now, this emits only a module name, if the module registers a partition map. -if grep -v "^#" | grep '^ *grub_video_register' >/dev/null 2>&1; then - echo $module -fi From 0d4552faca45fa403448fdb671a47adbaeb53d4d Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Sun, 29 Aug 2010 11:17:30 +0530 Subject: [PATCH 2/6] remove def-* and und-* list files --- conf/Makefile.common | 2 -- gentpl.py | 17 ++--------------- grub-core/Makefile.am | 21 ++++++++++++--------- grub-core/Makefile.core.def | 5 +++++ grub-core/genmoddep.awk | 34 +++++++++++++++++++--------------- grub-core/gensyminfo.sh.in | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 72 insertions(+), 41 deletions(-) create mode 100644 grub-core/gensyminfo.sh.in diff --git a/conf/Makefile.common b/conf/Makefile.common index 528fa418f..1cf5a4b72 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -86,8 +86,6 @@ CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime # Define these variables to calm down automake PP_FILES = -DEF_FILES = -UND_FILES = IMG_FILES = MOD_FILES = MODULE_FILES = diff --git a/gentpl.py b/gentpl.py index 783a425fa..b153452cd 100644 --- a/gentpl.py +++ b/gentpl.py @@ -284,8 +284,6 @@ def module(platform): r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") - r += gvar_add("DEF_FILES", "def-[+ name +].lst") - r += gvar_add("UND_FILES", "und-[+ name +].lst") r += gvar_add("MOD_FILES", "[+ name +].mod") r += gvar_add("platform_DATA", "[+ name +].mod") r += gvar_add("CLEANFILES", "def-[+ name +].lst und-[+ name +].lst mod-[+ name +].c mod-[+ name +].o [+ name +].mod") @@ -296,16 +294,6 @@ def module(platform): [+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES) $(TARGET_CPP) -DGRUB_LST_GENERATOR $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@ || (rm -f $@; exit 1) -def-[+ name +].lst: [+ name +].module$(EXEEXT) - if test x$(USE_APPLE_CC_FIXES) = xyes; then \ - $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@; \ - else \ - $(NM) -g --defined-only -P -p $< | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@; \ - fi - -und-[+ name +].lst: [+ name +].module$(EXEEXT) - $(NM) -u -P -p $< | sed "s/^\\([^ ]*\\).*/\\1 [+ name +]/" >> $@ - mod-[+ name +].c: [+ name +].module$(EXEEXT) moddep.lst genmodsrc.sh sh $(srcdir)/genmodsrc.sh [+ name +] moddep.lst > $@ || (rm -f $@; exit 1) @@ -448,9 +436,8 @@ def script(platform): r += "[+ IF mansection +]" + manpage() + "[+ ENDIF +]" r += "[+ ENDIF +]" - r += rule("[+ name +]", "$(top_builddir)/config.status " + platform_sources(platform), """ -$(top_builddir)/config.status --file=-:""" + platform_sources(platform) + """ \ - | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@ + r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """ +$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@ chmod a+x [+ name +] """) diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 33f5db46e..2f23f03b0 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -235,8 +235,8 @@ kernel_syms.lst: $(KERNEL_HEADER_FILES) $(top_builddir)/config.h $(TARGET_CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) $(CPPFLAGS) $(CFLAGS) -DGRUB_SYMBOL_GENERATOR=1 $^ >kernel_syms.input if grep "^#define HAVE_ASM_USCORE" $(top_builddir)/config.h; then u="_"; else u=""; fi; \ cat kernel_syms.input | grep -v '^#' | sed -n \ - -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \ - -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$$u"'\1 kernel/;p;}' \ + -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/defined '"$$u"'kernel \1/;p;}' \ + -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/defined '"$$u"' kernel \1/;p;}' \ | sort -u >$@ rm -f kernel_syms.input CLEANFILES += kernel_syms.lst @@ -333,15 +333,18 @@ crypto.lst: $(srcdir)/lib/libgcrypt-grub/cipher/crypto.lst platform_DATA += crypto.lst CLEANFILES += crypto.lst -# .lst files -platform_DATA += moddep.lst -CLEANFILES += moddep.lst +syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES) + cat kernel_syms.lst > $@.new + for m in $(MODULE_FILES); do \ + sh $< $$m >> $@.new || exit 1; \ + done + mv $@.new $@ # generate global module dependencies list -moddep.lst: kernel_syms.lst genmoddep.awk $(DEF_FILES) $(UND_FILES) - cat $(DEF_FILES) kernel_syms.lst /dev/null \ - | $(AWK) -f $(srcdir)/genmoddep.awk $(UND_FILES) > $@ \ - || (rm -f $@; exit 1) +moddep.lst: syminfo.lst genmoddep.awk + cat $< | sort | awk -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1) +platform_DATA += moddep.lst +CLEANFILES += moddep.lst if COND_i386_pc if COND_ENABLE_EFIEMU diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 0257bbac4..5587f0f40 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1403,3 +1403,8 @@ module = { name = datehook; common = hook/datehook.c; }; + +script = { + name = gensyminfo.sh; + common = gensyminfo.sh.in; +}; diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk index 74487eabf..dfc924666 100644 --- a/grub-core/genmoddep.awk +++ b/grub-core/genmoddep.awk @@ -11,23 +11,27 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Read defined symbols from stdin. +# Read symbols' info from stdin. BEGIN { + error = 0 + lineno = 0; while (getline <"/dev/stdin") { - symtab[$1] = $2 - } -} - -# The rest is undefined symbols. -{ - module = $2 - - if ($1 in symtab) { - modtab[module] = modtab[module] " " symtab[$1]; - } - else if ($1 != "__gnu_local_gp") { - printf "%s in %s is not defined\n", $1, module >"/dev/stderr"; - error++; + lineno++; + if ($1 == "defined") + symtab[$3] = $2; + else if ($1 == "undefined") { + if ($3 in symtab) + modtab[$2] = modtab[$2] " " symtab[$3]; + else if ($3 != "__gnu_local_gp") { + printf "%s in %s is not defined\n", $3, $2 >"/dev/stderr"; + error++; + } + } + else { + printf "error: %u: unrecognized input format\n", lineno; + error++; + break; + } } } diff --git a/grub-core/gensyminfo.sh.in b/grub-core/gensyminfo.sh.in new file mode 100644 index 000000000..4f5184913 --- /dev/null +++ b/grub-core/gensyminfo.sh.in @@ -0,0 +1,34 @@ +#! /bin/sh -e +# +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# This gensymlist.sh is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# Example: +# +# gensyms.sh normal.module +# + +module=$1 +modname=`echo $module | sed -e 's@\.module.*$@@'` + +# Print all symbols defined by module +if test x@TARGET_APPLE_CC@ = x1; then + @NM@ -g -P -p $module | \ + grep -E '^[a-zA-Z0-9_]* [TDS]' | \ + sed "s@^\([^ ]*\).*@defined $modname \1@g" +else + @NM@ -g --defined-only -P -p $module | \ + sed "s@^\([^ ]*\).*@defined $modname \1@g" +fi + +# Print all undefined symbols used by module +@NM@ -u -P -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g" From ea943e89a387bbd0fdccc0cfdcb966e2254d97d2 Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Sun, 29 Aug 2010 12:35:52 +0530 Subject: [PATCH 3/6] distcheck fixes --- conf/Makefile.extra-dist | 11 ++--------- grub-core/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 3acef7af7..8fe5eed8b 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -15,19 +15,12 @@ EXTRA_DIST += grub-core/Makefile.gcry.def EXTRA_DIST += grub-core/genmoddep.awk EXTRA_DIST += grub-core/genmodsrc.sh -EXTRA_DIST += grub-core/genfslist.sh -EXTRA_DIST += grub-core/gencmdlist.sh +EXTRA_DIST += grub-core/gensyminfo.sh.in EXTRA_DIST += grub-core/gensymlist.sh EXTRA_DIST += grub-core/genemuinit.sh -EXTRA_DIST += grub-core/genvideolist.sh -EXTRA_DIST += grub-core/genhandlerlist.sh -EXTRA_DIST += grub-core/genpartmaplist.sh -EXTRA_DIST += grub-core/genterminallist.sh -EXTRA_DIST += grub-core/genparttoollist.sh EXTRA_DIST += grub-core/genemuinitheader.sh EXTRA_DIST += $(shell find $(top_srcdir)/include -name '*.h') +EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib -name '*.h') EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/gnulib -name '*.h') EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/efiemu -name '*.h') -EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib/posix_wrap -name '*.h') -EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib/libgcrypt_wrap -name '*.h') diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 2f23f03b0..d8b7dbc0f 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -344,7 +344,7 @@ syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES) moddep.lst: syminfo.lst genmoddep.awk cat $< | sort | awk -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1) platform_DATA += moddep.lst -CLEANFILES += moddep.lst +CLEANFILES += config.log syminfo.lst moddep.lst if COND_i386_pc if COND_ENABLE_EFIEMU From 6b5f780f0590e3ce22444360ce68ae8c1ff7f0f0 Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Sun, 29 Aug 2010 16:43:07 +0530 Subject: [PATCH 4/6] use objcopy instead of creating mod-*.c and mod-*.o --- gentpl.py | 20 ---------- grub-core/Makefile.am | 5 +++ grub-core/Makefile.core.def | 5 +++ grub-core/genmod.sh.in | 73 +++++++++++++++++++++++++++++++++++++ grub-core/genmoddep.awk | 5 ++- 5 files changed, 86 insertions(+), 22 deletions(-) create mode 100644 grub-core/genmod.sh.in diff --git a/gentpl.py b/gentpl.py index b153452cd..81b44316b 100644 --- a/gentpl.py +++ b/gentpl.py @@ -285,31 +285,11 @@ def module(platform): r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("MOD_FILES", "[+ name +].mod") - r += gvar_add("platform_DATA", "[+ name +].mod") - r += gvar_add("CLEANFILES", "def-[+ name +].lst und-[+ name +].lst mod-[+ name +].c mod-[+ name +].o [+ name +].mod") - r += gvar_add("PP_FILES", "[+ name +].pp") r += gvar_add("CLEANFILES", "[+ name +].pp") r += """ [+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES) $(TARGET_CPP) -DGRUB_LST_GENERATOR $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@ || (rm -f $@; exit 1) - -mod-[+ name +].c: [+ name +].module$(EXEEXT) moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh [+ name +] moddep.lst > $@ || (rm -f $@; exit 1) - -mod-[+ name +].o: mod-[+ name +].c - $(TARGET_CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $(""" + cname() + """_CFLAGS) $(CFLAGS) -c -o $@ $< - -[+ name +].mod: [+ name +].module$(EXEEXT) mod-[+ name +].o - if test x$(USE_APPLE_CC_FIXES) = xyes; then \ - $(CCLD) $(""" + cname() + """_LDFLAGS) $(LDFLAGS) -o $@.bin $^; \ - $(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@; \ - rm -f $@.bin; \ - else \ - $(CCLD) -o $@ $(""" + cname() + """_LDFLAGS) $(LDFLAGS) $^; \ - if test ! -z '$(TARGET_OBJ2ELF)'; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@; \ - fi """ return r diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index d8b7dbc0f..c277cd47e 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -346,6 +346,11 @@ moddep.lst: syminfo.lst genmoddep.awk platform_DATA += moddep.lst CLEANFILES += config.log syminfo.lst moddep.lst +$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) + sh $^ $@ +platform_DATA += $(MOD_FILES) +CLEANFILES += $(MOD_FILES) + if COND_i386_pc if COND_ENABLE_EFIEMU efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 5587f0f40..c852c344f 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1408,3 +1408,8 @@ script = { name = gensyminfo.sh; common = gensyminfo.sh.in; }; + +script = { + name = genmod.sh; + common = genmod.sh.in; +}; diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in new file mode 100644 index 000000000..a267ca5d7 --- /dev/null +++ b/grub-core/genmod.sh.in @@ -0,0 +1,73 @@ +#! /bin/sh -e +# +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# This gensymlist.sh is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# +# Example: +# +# genmod.sh moddep.lst normal.module echo.module +# + +moddep=$1 +infile=$2 +outfile=$3 + +tmpfile=${outfile}.tmp +modname=`echo $infile | sed -e 's@\.module.*$@@'` + +if ! grep ^$modname: $moddep >/dev/null; then + echo "warning: moddep.lst has no dependencies for $modname" >&2 + exit 0 +fi + +deps=`grep ^$modname: $moddep | sed s@^.*:@@` + +# remove old files if any +rm -f $tmpfile $outfile + +# stripout .modname and .moddeps sections from input module +objcopy -R .modname -R .moddeps $infile $tmpfile + +# Attach .modname and .moddeps sections +t1=`mktemp` +printf "$modname\0" >$t1 + +t2=`mktemp` +for dep in $deps; do printf "$dep\0" >> $t2; done + +if test -n "$deps"; then + objcopy --add-section .modname=$t1 --add-section .moddeps=$t2 $tmpfile +else + objcopy --add-section .modname=$t1 $tmpfile +fi +rm -f $t1 $t2 + +if test x@TARGET_APPLE_CC@ != x1; then + if ! test -z "@TARGET_OBJ2ELF@"; then + ./@TARGET_OBJ2ELF@ $tmpfile || exit 1 + fi + if test x@platform@ != xemu; then + @STRIP@ --strip-unneeded \ + -K grub_mod_init -K grub_mod_fini \ + -K _grub_mod_init -K _grub_mod_fini \ + -R .note -R .comment $tmpfile || exit 1 + fi +else +# XXX Test these Apple CC fixes + cp $tmpfile $tmpfile.bin + @OBJCONV@ -f@TARGET_MODULE_FORMAT@ \ + -nr:_grub_mod_init:grub_mod_init \ + -nr:_grub_mod_fini:grub_mod_fini \ + -wd1106 -ew2030 -ew2050 -nu -nd $tmpfile.bin $tmpfile || exit 1 + rm -f $name.bin +fi +mv $tmpfile $outfile diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk index dfc924666..e412d4370 100644 --- a/grub-core/genmoddep.awk +++ b/grub-core/genmoddep.awk @@ -17,9 +17,10 @@ BEGIN { lineno = 0; while (getline <"/dev/stdin") { lineno++; - if ($1 == "defined") + if ($1 == "defined") { symtab[$3] = $2; - else if ($1 == "undefined") { + modtab[$2] = "" modtab[$2] + } else if ($1 == "undefined") { if ($3 in symtab) modtab[$2] = modtab[$2] " " symtab[$3]; else if ($3 != "__gnu_local_gp") { From 466b9c35677a6768e98efbd2021534c625f3d0ab Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Sun, 29 Aug 2010 16:58:43 +0530 Subject: [PATCH 5/6] distcheck fixes --- conf/Makefile.extra-dist | 2 +- grub-core/genmodsrc.sh | 47 ---------------------------------------- 2 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 grub-core/genmodsrc.sh diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 8fe5eed8b..9acaadbcc 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -14,7 +14,7 @@ EXTRA_DIST += grub-core/Makefile.core.def EXTRA_DIST += grub-core/Makefile.gcry.def EXTRA_DIST += grub-core/genmoddep.awk -EXTRA_DIST += grub-core/genmodsrc.sh +EXTRA_DIST += grub-core/genmod.sh.in EXTRA_DIST += grub-core/gensyminfo.sh.in EXTRA_DIST += grub-core/gensymlist.sh EXTRA_DIST += grub-core/genemuinit.sh diff --git a/grub-core/genmodsrc.sh b/grub-core/genmodsrc.sh deleted file mode 100644 index 2d420550a..000000000 --- a/grub-core/genmodsrc.sh +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2002,2007 Free Software Foundation, Inc. -# -# This genmodsrc.sh is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -set -e - -mod_name="$1" -deps="$2" - -cat <. - */ - -#include - -EOF - -echo "GRUB_MOD_NAME(${mod_name});" - -for mod in `grep "^${mod_name}:" ${deps} | sed 's/^[^:]*://'`; do - echo "GRUB_MOD_DEP(${mod});" -done From 6568636e31cd0c8237dbdceeedefd0739388556e Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Sun, 29 Aug 2010 21:22:41 +0530 Subject: [PATCH 6/6] use preprocessing-marker technique for creating list files --- conf/Makefile.common | 16 +++++++++++- gentpl.py | 9 ++++--- grub-core/Makefile.am | 57 ++++++++++++++++++------------------------- 3 files changed, 44 insertions(+), 38 deletions(-) diff --git a/conf/Makefile.common b/conf/Makefile.common index 1cf5a4b72..f13cbdc54 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -83,12 +83,26 @@ CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime +# List file macros for recognizing /interesting/ modules +CPPFLAGS_FS_LIST = -Dgrub_fs_register=FS_LIST_MARKER +CPPFLAGS_VIDEO_LIST= -Dgrub_video_register=VIDEO_LIST_MARKER +CPPFLAGS_PARTMAP_LIST = -Dgrub_partition_map_register=PARTMAP_LIST_MARKER +CPPFLAGS_PARTTOOL_LIST = -Dgrub_parttool_register=PARTTOOL_LIST_MARKER +CPPFLAGS_TERMINAL_LIST = '-Dgrub_term_register_input(...)=INPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_TERMINAL_LIST += '-Dgrub_term_register_output(...)=OUTPUT_TERMINAL_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_COMMAND_LIST = '-Dgrub_register_command(...)=COMMAND_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_COMMAND_LIST += '-Dgrub_register_extcmd(...)=EXTCOMMAND_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_COMMAND_LIST += '-Dgrub_register_command_p1(...)=P1COMMAND_LIST_MARKER(__VA_ARGS__)' +CPPFLAGS_MARKER = $(CPPFLAGS_FS_LIST) $(CPPFLAGS_VIDEO_LIST) \ + $(CPPFLAGS_PARTTOOL_LIST) $(CPPFLAGS_PARTMAP_LIST) \ + $(CPPFLAGS_TERMINAL_LIST) $(CPPFLAGS_COMMAND_LIST) + # Define these variables to calm down automake -PP_FILES = IMG_FILES = MOD_FILES = MODULE_FILES = +MARKER_FILES = KERNEL_HEADER_FILES = man_MANS = diff --git a/gentpl.py b/gentpl.py index 81b44316b..f520ebf99 100644 --- a/gentpl.py +++ b/gentpl.py @@ -285,11 +285,12 @@ def module(platform): r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)") r += gvar_add("MOD_FILES", "[+ name +].mod") - r += gvar_add("PP_FILES", "[+ name +].pp") - r += gvar_add("CLEANFILES", "[+ name +].pp") + r += gvar_add("MARKER_FILES", "[+ name +].marker") + r += gvar_add("CLEANFILES", "[+ name +].marker") r += """ -[+ name +].pp: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES) - $(TARGET_CPP) -DGRUB_LST_GENERATOR $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@ || (rm -f $@; exit 1) +[+ name +].marker: $(""" + cname() + """_SOURCES) $(nodist_""" + cname() + """_SOURCES) + $(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname() + """_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1) + grep 'MARKER' $@.new > $@; rm -f $@.new """ return r diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index c277cd47e..3ee526ff8 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -258,69 +258,60 @@ endif # List files -fs.lst: $(PP_FILES) +fs.lst: $(MARKER_FILES) (for pp in $^; do \ - b=`basename $$pp .pp`; \ - if grep -v "^#" $$pp | grep '^ *grub_fs_register' >/dev/null 2>&1; then \ + b=`basename $$pp .marker`; \ + if grep 'FS_LIST_MARKER' $$pp >/dev/null 2>&1; then \ echo $$b; \ fi; \ done) | sort -u > $@ platform_DATA += fs.lst CLEANFILES += fs.lst -command.lst: $(PP_FILES) +command.lst: $(MARKER_FILES) (for pp in $^; do \ - b=`basename $$pp .pp`; \ - grep -v "^#" $$pp | sed -n \ - -e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" \ - -e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ - -e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}"; \ + b=`basename $$pp .marker`; \ + sed -n \ + -e "/COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" \ + -e "/EXTCOMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" \ + -e "/P1COMMAND_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $$b/;p;}" $$pp; \ done) | sort -u > $@ platform_DATA += command.lst CLEANFILES += command.lst -partmap.lst: $(PP_FILES) +partmap.lst: $(MARKER_FILES) (for pp in $^; do \ - b=`basename $$pp .pp`; \ - if grep -v "^#" $$pp | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then \ + b=`basename $$pp .marker`; \ + if grep 'PARTMAP_LIST_MARKER' $$pp >/dev/null 2>&1; then \ echo $$b; \ fi; \ done) | sort -u > $@ platform_DATA += partmap.lst CLEANFILES += partmap.lst -handler.lst: $(PP_FILES) +terminal.lst: $(MARKER_FILES) (for pp in $^; do \ - b=`basename $$pp .pp`; \ - grep -v "^#" $$pp | sed -n \ - -e "/grub_parser_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/parser.\1: $$b/;p;}"; \ - done) | sort -u > $@ -platform_DATA += handler.lst -CLEANFILES += handler.lst - -terminal.lst: $(PP_FILES) - (for pp in $^; do \ - b=`basename $$pp .pp`; \ - grep -v "^#" $$pp | sed -n \ - -e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \ - -e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}"; \ + b=`basename $$pp .marker`; \ + sed -n \ + -e "/INPUT_TERMINAL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $$b/;p;}" \ + -e "/OUTPUT_TERMINAL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $$b/;p;}" $$pp; \ done) | sort -u > $@ platform_DATA += terminal.lst CLEANFILES += terminal.lst -parttool.lst: $(PP_FILES) +parttool.lst: $(MARKER_FILES) (for pp in $^; do \ - b=`basename $$pp .pp`; \ - grep -v "^#" $$pp | sed -n \ - -e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}"; \ + b=`basename $$pp .marker`; \ + sed -n \ + -e "/PARTTOOL_LIST_MARKER *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $$b/;p;}" $$pp; \ done) | sort -u > $@ platform_DATA += parttool.lst CLEANFILES += parttool.lst -video.lst: $(PP_FILES) +video.lst: $(MARKER_FILES) (for pp in $^; do \ - b=`basename $$pp .pp`; \ - if grep -v "^#" $$pp | grep '^ *grub_video_register' >/dev/null 2>&1; then \ + b=`basename $$pp .marker`; \ + if grep 'VIDEO_LIST_MARKER' $$pp >/dev/null 2>&1; then \ echo $$b; \ fi; \ done) | sort -u > $@