grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating init and fini functions


From: Tomáš Ebenlendr
Subject: Re: Generating init and fini functions
Date: Wed, 9 Nov 2005 08:42:22 +0100 (CET)
User-agent: SquirrelMail/1.4.4

There are few bugs...


> Index: geninit.sh
...
> +cat <<EOF
> +/* This file is automatically generated by gensymlist.sh. DO NOT EDIT! */
> +/*
> + *  GRUB  --  GRand Unified Bootloader
> + *  Copyright (C) 2002  Free Software Foundation, Inc.

Copyright of autogenerated file... I think 2005 should be there also...

> + *
...
> +  cat grub_modules_init.lst

This file (grub_modules_init.lst) is used to determine order of modules?
I don't understand following lines, I only know, this may be (or may be
not and should be), how dependecies between modules are solved.

> +  for i in $*; do
> +    echo $i':'
> +  done
> +) | sort -r | uniq -d -W1 -t':' | sed -n '/GRUB_MOD_INIT
> *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_init
> ();/;p;}'
> +
...
> +  cat grub_modules_init.lst
> +  for i in $*; do
> +    echo $i':'
> +  done
> +) | sort -r | uniq -d -W1 -t':' | sed -n '/GRUB_MOD_INIT
> *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/  grub_\1_fini

I think GRUB_MOD_FINI should be here...

> ();/;p;}'
...
> Index: geninitheader.sh
...
> + *  Copyright (C) 2002  Free Software Foundation, Inc.

Copyright again...

> + *
...
> +cat grub_modules_init.lst | grep -v '^#' | sed -n '/GRUB_MOD_INIT
> *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/void
> grub_\1_init (void);/;p;}'
> +cat grub_modules_init.lst | grep -v '^#' | sed -n '/GRUB_MOD_INIT
> *([a-zA-Z0-9_]*)/{s/.*GRUB_MOD_INIT *(\([a-zA-Z0-9_]*\)).*/void
> grub_\1_fini (void);/;p;}'

GRUB_MOD_FINI again...

I do not proofread the modules ...
(the .rmk file seems to be good)

When loading modules dynamicaly dependecies between symbols orders them
such that the required module is loaded and INITIALIZED first. I think,
here it is not the case. I know that such dependency handling will be
complicated (unless we compile grub also and use the file moddep.lst or
how it is called...)

-- 
                                            Tomas 'Ebi' Ebenlendr
                                            http://get.to/ebik





reply via email to

[Prev in Thread] Current Thread [Next in Thread]