Hi Ethan.

After talking with you, I looked at how I could refactor AI as minimally 
as possible to that I can make room for Driver Update.  I wanted to keep 
the look of the current modular structure, and came up with the following.

1) ddu_call.py: (new) This is AI's python module that calls into the DDU 
library module proper.  We talked about making this general, but most of 
the code in the module deals with reading the AI manifest, so I think it 
is best to dedicate this module to AI.  (The text-installer can write 
its own analogous module, which will be mostly different anyway, when 
the time comes.

2) auto_ddu_lib.c : (new) AI-specific C library that calls into the 
ddu_call.py module.  Having this module will remove ddu calls from any 
module which deals with parsing (auto_parse_manifest.c and 
auto_parse.c).  It will have two routines:
   - ai_get_and_add_du_pkgs(): reads the AI manifest and installs into 
the given environent.  (It will be passed the booted environment as an 
arg.)  Saves the package list.
   - ai_add_du_pkgs(): installs into the given environment.  Uses 
package list created by ai_get_and_add_du_pkgs().  (It will be passed 
the target as an arg.)

3) auto_parse_manifest.c splits the existing ai_create_manifestserv() 
into two functions:
- a new ai_create_manifestserv() which just instantiates the manifest 
tree but doesn't check it.  (We can't check it until we've done 
driver_update, and we need the manifest to do driver_update.)
- ai_setup_manifestserv() which does validation and setup of the socket 
server.
NOTE: As part of this work, I split ManifestServ out so that 
instantiating a ManifestServ object no longer does validation. 
ai_create_manifestserv() still instantiates as before, but now 
ai_setup_manifestserv() invokes the ManifestServ object's validation code.

4) auto_parse.c/ai_validate_and_setup_manifest() will be refactored into 
ai_create_manifest() and ai_setup_manifest().  These will simply call 
into auto_parse_manifest.c/ai_create_manifestserv() and 
ai_setup_manifestserv().  These are kept to preserve the calling 
structure between auto_parse.c and auto_parse_manifest.c

5) auto_install/main() will make the following calls, in order:
        ai_create_manifest()
        ai_get_and_add_du_pkgs()
        ai_setup_manifest()
        dump_ai_manifest_errors()

6) auto_install/auto_perform_install: will call
        ai_add_du_pkgs()
after spinning waiting for om_perform_install() to finish.

Comments welcome.

    Thanks,
    Jack

P.S.  Not sure what I would need to do extra, if anything, to enable 
testing of AI with driver update (in terms of how AI's commandline 
options which deal with testing are implemented).  Please advise.

Reply via email to