]> git.proxmox.com Git - grub2.git/blob - grub-core/gensyminfo.sh.in
Support some annoying BSD and Minix subpartitions.
[grub2.git] / grub-core / gensyminfo.sh.in
1 #! /bin/sh -e
2 #
3 # Copyright (C) 2010 Free Software Foundation, Inc.
4 #
5 # This gensymlist.sh is free software; the author
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 #
15 # Example:
16 #
17 # gensyms.sh normal.module
18 #
19
20 module=$1
21 modname=`echo $module | sed -e 's@\.module.*$@@'`
22
23 # Print all symbols defined by module
24 if test x@TARGET_APPLE_CC@ = x1; then
25 @NM@ -g -P -p $module | \
26 grep -E '^[a-zA-Z0-9_]* [TDS]' | \
27 sed "s@^\([^ ]*\).*@defined $modname \1@g"
28 else
29 @NM@ -g --defined-only -P -p $module | \
30 sed "s@^\([^ ]*\).*@defined $modname \1@g"
31 fi
32
33 # Print all undefined symbols used by module
34 @NM@ -u -P -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g"