grub-devel
[Top][All Lists]
Advanced

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

idea: use symbol database to keep track of module dependence


From: Bean
Subject: idea: use symbol database to keep track of module dependence
Date: Mon, 20 Apr 2009 14:00:01 +0800

Hi,

Currently, the module dependence is determined in the build process
and inserted into the module file, there is several disadvantage about
this approach:

1, The build system is quite complicated, here are the steps required
to build module hello.mod.

a. Compile all pre modules (pre-*.o)
b. Extract defined and undefined symbols of pre-*.o and placed them in
def-*.lst and und-*.lst.
c. From pre-*.lst and und-*.lst, generate module dependence file moddep.lst.
d. From moddep.lst, get the module depended by hello, and generate mod-hello.c
e. Compile mod-hello.c to mod-hello.o.
f. link pre-hello.o and mod-hello.o together to form hello.mod

2, No increment building.
>From the above build process, we can see that even to build a single
module, we need to compile all other modules, increment building is
impossible.

3. Can't implement external modules.
All source code must remain in the main tree, external modules can't
be implemented, as the build process requires that all modules be
built at the same time in order to generate moddep.lst.

I suggest using a separate tool to manage the symbol database and
module dependence, now the build process can be simplified as:

a. Building pre-hello.o, generated mod-hello.c which contains only the
module name, and linked as hello.mod
b. Use tool grub-symdb to update the symbol database, and modified
hello.mod to include module dependence information, it could also
change other module file depended on hello.mod. It then generate
moddep.lst to be used by grub-mkimage. For example, the command may
look like this:

grub-symdb -d . add hello.mod

The symbol database file modsym.lst is basically the catenation of
def-*.lst and und-*.lst, we include it in the target system for
external module support. For example, to install external modules:

Copy mod file to system grub directory
Use grub-symdb to add the new modules to the symbol database and
update module dependence.

To remove them:
Use grub-symdb to remove the modules from symbol database and update
module dependence.
Remove the mod files.

-- 
Bean




reply via email to

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