All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Gerards <metgerards@student.han.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Generating init and fini functions
Date: Wed, 09 Nov 2005 10:38:32 +0100	[thread overview]
Message-ID: <87ek5qw487.fsf@student.han.nl> (raw)
In-Reply-To: <1097.62.240.162.34.1131522142.squirrel@drak.ucw.cz> (Tomáš Ebenlendr's message of "Wed, 9 Nov 2005 08:42:22 +0100 (CET)")

Tomáš Ebenlendr <ebik@drak.ucw.cz> 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	other threads:[~2005-11-09  9:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-08 23:18 Generating init and fini functions Marco Gerards
2005-11-09  6:02 ` Hollis Blanchard
2005-11-09 11:10   ` Marco Gerards
2005-11-09  7:42 ` Tomáš Ebenlendr
2005-11-09  9:38   ` Marco Gerards [this message]
2005-11-09 18:55 ` Timothy Baldwin
2005-11-09 19:17   ` Marco Gerards
2005-11-13 15:49 ` Marco Gerards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ek5qw487.fsf@student.han.nl \
    --to=metgerards@student.han.nl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.