ICA support

Dan Nicholson dbn.lists at gmail.com
Sat Apr 8 12:29:00 PDT 2006


On 4/8/06, M.Canales.es <manuel at linuxfromscratch.org> wrote:
>
> Now, what we need is the actual do_ica_prep and do_ica_work scripts, but I
> don't know yet how to code it.
>
> Dan, could you help us with that?

Surely.  Could you download a copy of my scripts?  It'll be a lot
easier for me to explain what I've done if you can see the code. 
(Please don't make fun of my amateurish hacks)

http://www.linuxfromscratch.org/~dnicholson/dbn-build-20060408.tar.gz

So, real quickly, this is how it works.  Variables are defined in
build.conf.  The scripts are either in lfs or alpha depending on which
recipe you choose.  The driver of this whole operation is
dbn-build.sh, but all of the packages get their own scripts.

Anyway, dbn-build.sh screens out a couple of scripts in do_chroot if
RUN_ICA=Y and/or BUILD_ITERATIONS>=1.  It then runs them according to
the order provided in the scripts.list file.  This file is in either
lfs or alpha.  When the iteration is done, it does the ICA and/or
farce prep.

What happens in those is defined in the function file functions/ica. 
In the case of RUN_ICA=Y, do_ica_prep is run.  This copies the
filesystem to a temporary location (function do_ica_files) and then
does the stripping/removing/etc.  If RUN_FARCE=Y, do_farce_prep is
called.  Since Ken's farce script does the stripping and diffing at
once, this function basically wraps do_ica_files and copies the
filesystem.

Some magic happens (move stamp and log files so they aren't blown
away), ITER is incremented, and the loop runs again until ITER >
BUILD_ITERATIONS.  When this condition happens, the function do_chroot
is complete.  At this point, control returns to the main part of the
script.  This is all the way at the bottom of dbn-build.sh.

If it's desired do_ica and/or do_farce are run.  These functions are
defined in dbn-build.sh because they keep track of the ITERs.  It just
counts up N until N = BUILD_ITERATIONS.  It calls do_ica_work on
iter$N and iter$((N+1)).

do_ica_work is defined in functions/ica.  This takes two file systems
(iter1 and iter2 in the first case) and does the diffing and some
logging of results.  do_ica_files, do_ica_prep and do_ica_work are all
taken from Greg's gsbuild scripts.

do_farce_work is similar in how it's called.  However, Ken's tool does
all the work for you.  This might be easier to start with since you
don't have to worry about the implementation of the ICA stripping and
diffing.  The only catch with farce (look in do_farce_prep) is that
you can't name the filelist that it creates, so it's hard to refer
back to it in a script.

Another thing about farce is that I'm using an older, slightly patched
version that has behavior closer to Greg's ICA functions.  I've been
meaning to get the newer farce Ken has updated, but the one I have
does what I want, so I'm not in a hurry.  The patched one I'm using is
internal to my scripts in extras/farce.  Ken's newest version (002)
can be found here:

http://www.linuxfromscratch.org/~ken/farce-002.tar.bz2

If he's listening, maybe he can enlighten us as to what's new in that version.

That should get you started.  Feel free to ask any questions.  I'll
take a look at what's in jhalfs, but it might not happen today.

Good luck.

--
Dan



More information about the alfs-discuss mailing list