tech-toolchain archive

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

Re: Making syspkgs and makefs play nice together




On 15/05/2009, at 12:09 PM, David Young wrote:
Just in case it will save you some trouble, let me tell you how I filter
uninteresting syspkgs from the metalog that 'build.sh distribution'
creates before I pass that metalog to makefs.  I have used only host
tools (i.e., not pkg_add) and avoided hacking on some thorny C code.

First I come up with regular expressions that match the syspkgs that
I want to omit from the installation sets (base, etc, ...) that
interest me:

Hmm, I used shell wildcards, but I wasn't thrilled with it. I used the shell to expand the wildcards, and I wanted to minimise the chances of blowing out command line length limits, so I had to play a few games with cd. Regexps work at least as well, and mean I could implement it with a tool that wasn't going to blow up on a long list.

My first cut at this had a list of packages to include and then a list of packages to exclude from the former list. This let me say things like include base-* and etc-*, but exclude base-kernel-modules.

To find the precise syspkgs to omit, I use those regular expressions to
filter the list of packages in each installation set[1], first.  Then
I expand that list by adding to it all of the syspkgs that depend on
a package[2] that is already in the list: in this way, if etc-atf-etc
depends on the omitted package base-atf-bin, then etc-atf-etc will be
omitted, too.

I implemented the dependency checking for inclusion, but didn't realise it would be a good idea for exclusion as well.

I pass the PLIST of each syspkg[3] on my omissions list through a simple awk script that turns the PLIST to a list of files. I take those files
out of the metalog that 'build.sh distribution' writes to $DESTDIR/; I
feed the remainder of the metalog to makefs(8).

I interrogate the package files directly. I have updated pax to output mtree format listings on request, analogous to it's ability to accept mtree listings as input. Easiest piece of C code I've ever written. As my scripts stand right now, I can build filesystem images directly from the syspkgs in $RELEASEDIR without reading anything out of $DESTDIR (that it doesn't write there first). And it's fast. I was expecting to make the machine grind a bit as worked it's way through base-*, but it finished so quickly I had to double check the size of the output image.

I mentioned earlier that I'm a bit ambivalent about the shell wildcards and how I've implemented them. That isn't true for this bit. It's one of those solutions that just seems to all fit together. It's not perfect yet, but it's simple and well behaved.

Cheers,
Lloyd


Home | Main Index | Thread Index | Old Index