]> git.proxmox.com Git - grub2.git/blame - genemuinit.sh
2010-07-31 Robert Millan <rmh@gnu.org>
[grub2.git] / genemuinit.sh
CommitLineData
909301af
VS
1#! /bin/sh
2#
3# Copyright (C) 2002,2005,2007 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
285505d3 14nm="$1"
909301af
VS
15shift
16
17cat <<EOF
18/* This file is automatically generated by geninit.sh. DO NOT EDIT! */
19/*
20 * GRUB -- GRand Unified Bootloader
21 * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc.
22 *
23 * GRUB is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
27 *
28 * GRUB is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
35 */
36
37#include "grub_emu_init.h"
38
39EOF
40
41cat <<EOF
42void
43grub_init_all (void)
44{
45EOF
46
47read mods
48for line in $mods; do
285505d3
VS
49 if ${nm} --defined-only -P -p ${line} | grep grub_mod_init > /dev/null; then
50 echo "grub_${line}_init ();" | sed 's,\.mod,,g;'
51 fi
909301af
VS
52done
53
54cat <<EOF
55}
56EOF
57
58cat <<EOF
59void
60grub_fini_all (void)
61{
62EOF
63
64for line in $mods; do
285505d3
VS
65 if ${nm} --defined-only -P -p ${line} | grep grub_mod_fini > /dev/null; then
66 echo "grub_${line}_fini ();" | sed 's,\.mod,,g;'
67 fi
909301af
VS
68done
69
70cat <<EOF
71}
72EOF