Hi,

   From a series of previous discussions it was deemed better
to re-write the Transfer module in Python. There are several
reasons to do this. The biggest being ease of implementation
and maintenance. This module needs to do a bunch of work that
is more appropriate for a shell script which at the same time
doing stuff better handled by a high-level language. Python
lends itself well to either task. It needs some ugly, voluminous
C code to do these things (copy repository.db, create a few
directories etc.) in the present Transfer module. In addition
Transfer module is also being extended to handle setting up and
installing packages in the proto directory for Distribution
Constructor. That is also easier done via Python.

I have re-written the module in Python. The original C interfaces
to the Transfer module remain unchanged. However the these
interfaces are now wrappers that load up an embedded Python
interpreter. An argument list is built up based on the nvlist
entries passed in and the python module is invoked. The C wrapper
extends the embedded interpreter by providing a couple of callbacks
that the python code can invoke. The memory overhead of loading an
embedded python interpreter is approximately 3MB. There is no
performance degradation as Transfer module spends most of it's
time in cpio.

The webrev is at:
http://cr.opensolaris.org/~moinakg/tm_python/

This code replaces the functionality provided by the existing
Transfer module in C. I have successfully installed a DP2 image
using this module and got a working installed setup.

Comments/suggestions please.

Regards,
Moinak.


Reply via email to