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: Marco Gerards
Subject: Re: Generating init and fini functions
Date: Wed, 09 Nov 2005 10:38:32 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Tomáš Ebenlendr <address@hidden> writes:

>> +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...

You are right, I will go over all files to have a look at the
copyright date before committing.

>> + *
> ...
>> +  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.

It contains all C files with a GRUB_MOD_INIT call.  When generating
the C files for the initializations, I filter out the relevant
statements.

>> +  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...

What I did is making the assumption that whenever GRUB_MOD_INIT
occurs, a GRUB_MOD_FINI is in the same file with the same name.  In
that case this is an easier and faster solution.

> I do not proofread the modules ...

When you read one, you read them all I guess.

> (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...)

True.  It's not an issue at the moment because no modules depends on
the initialization of another module.  So I don't think it is a
problem now.  This code is for utils like grub-emu that just have to
do the initialization.  So the most important thing here is that this
is not about real modules, but just about the initialization of the
modules.

Please tell me if you think there is a real problem.

--
Marco





reply via email to

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