~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to geninit.sh

Tags: upstream-1.99~20101122
ImportĀ upstreamĀ versionĀ 1.99~20101122

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12
12
# PARTICULAR PURPOSE.
13
13
 
14
 
lst="$1"
15
 
shift
16
 
 
17
 
header=`echo "${lst}" | sed -e "s/\.lst$/.h/g"`
18
 
 
19
14
cat <<EOF
20
15
/* This file is automatically generated by geninit.sh. DO NOT EDIT! */
21
16
/*
36
31
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
37
32
 */
38
33
 
39
 
#include <$header>
 
34
#include <grub/emu/misc.h>
40
35
 
41
36
EOF
42
37
 
 
38
for mod in "$@"; do
 
39
    echo "extern void grub_${mod}_init (void);"
 
40
    echo "extern void grub_${mod}_fini (void);"
 
41
done
 
42
 
43
43
cat <<EOF
44
44
void
45
45
grub_init_all (void)
46
46
{
47
47
EOF
48
48
 
49
 
while read line; do
50
 
  file=`echo $line | cut -f1 -d:`
51
 
  if echo $@ | grep $file >/dev/null; then
52
 
    echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_init ();/'
53
 
  fi
54
 
done < ${lst}
 
49
for mod in "$@"; do
 
50
    echo "grub_${mod}_init ();"
 
51
done
55
52
 
56
53
cat <<EOF
57
54
}
63
60
{
64
61
EOF
65
62
 
66
 
while read line; do
67
 
  file=`echo $line | cut -f1 -d:`
68
 
  if echo $@ | grep $file >/dev/null; then
69
 
    echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_fini ();/'
70
 
  fi
71
 
done < ${lst}
 
63
for mod in "$@"; do
 
64
    echo "grub_${mod}_fini ();"
 
65
done
72
66
 
73
67
cat <<EOF
74
68
}