# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-lst="$1"
-shift
-
-header=`echo "${lst}" | sed -e "s/\.lst$/.h/g"`
-
cat <<EOF
/* This file is automatically generated by geninit.sh. DO NOT EDIT! */
/*
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <$header>
+#include <grub/emu/misc.h>
EOF
+for mod in "$@"; do
+ echo "extern void grub_${mod}_init (void);"
+ echo "extern void grub_${mod}_fini (void);"
+done
+
cat <<EOF
void
grub_init_all (void)
{
EOF
-while read line; do
- file=`echo $line | cut -f1 -d:`
- if echo $@ | grep $file >/dev/null; then
- echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/ grub_\1_init (0);/'
- fi
-done < ${lst}
+for mod in "$@"; do
+ echo "grub_${mod}_init ();"
+done
cat <<EOF
}
{
EOF
-while read line; do
- file=`echo $line | cut -f1 -d:`
- if echo $@ | grep $file >/dev/null; then
- echo $line | sed -e 's/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/ grub_\1_fini ();/'
- fi
-done < ${lst}
+for mod in "$@"; do
+ echo "grub_${mod}_fini ();"
+done
cat <<EOF
}