Eliminate blacklist of modules w/o init

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-02-07 03:58:14 +01:00
parent ebe841ad55
commit 285505d3fc
3 changed files with 17 additions and 9 deletions

View file

@ -84,11 +84,11 @@ endif
grub_emu_init.h: genemuinitheader.sh
rm -f $@; echo $(pkglib_MODULES) |sh $(srcdir)/genemuinitheader.sh > $@
rm -f $@; echo $(pkglib_MODULES) | sh $(srcdir)/genemuinitheader.sh $(NM) > $@
DISTCLEANFILES += grub_emu_init.h
grub_emu_init.c: genemuinit.sh
rm -f $@; echo $(pkglib_MODULES) |sed 's,elf.mod,,;s,extcmd.mod,,;s,gzio.mod,,;s,fshelp.mod,,;s,bufio.mod,,;s,setjmp.mod,,;s,crypto.mod,,;s,pbkdf2.mod,,;s,trig.mod,,;s,bitmap_scale.mod,,;s,charset.mod,,;'|sh $(srcdir)/genemuinit.sh > $@
grub_emu_init.c: genemuinit.sh $(pkglib_MODULES)
rm -f $@; echo $(pkglib_MODULES) | sh $(srcdir)/genemuinit.sh $(NM) > $@
DISTCLEANFILES += grub_emu_init.c
include $(srcdir)/conf/common.mk

View file

@ -11,7 +11,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
lst="$1"
nm="$1"
shift
cat <<EOF
@ -46,7 +46,9 @@ EOF
read mods
for line in $mods; do
echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
fi
done
cat <<EOF
@ -60,7 +62,9 @@ grub_fini_all (void)
EOF
for line in $mods; do
echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
fi
done
cat <<EOF

View file

@ -11,7 +11,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
lst="$1"
nm="$1"
shift
cat <<EOF
@ -43,6 +43,10 @@ EOF
read mods
for line in $mods; do
echo "void grub_${line}_init (void);" | sed 's,\.mod,,g;'
echo "void grub_${line}_fini (void);" | sed 's,\.mod,,g;'
if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
echo "void grub_${line}_init (void);" | sed 's,\.mod,,g;'
fi
if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
echo "void grub_${line}_fini (void);" | sed 's,\.mod,,g;'
fi
done