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 Mon, May 11, 2009 at 10:39:01AM +1200, Lloyd Parkes wrote:
> Hi all,
> I want to be able to build filesystems from syspkgs/pkgsrc format
> packages and there are a few things that need to be ironed out before
> this can happen.
>
> I want to add an unprivileged mode to pkg_add that will probably be
> enabled automatically if you aren't running it as root. In this mode it
> will not try and set any file permissions.
>
> I also want to eliminate all @exec PLIST commands from syspkgs. syspkgs
> only uses them for creating file system objects that the PLIST can't
> otherwise describe (probably). This really isn't the right way to do it,
> and in general it won't work for me. I think I can eliminate them all by
> back-porting/pulling-up the implementation of the @pkgdir PLIST command.
>
> I can then write an AWK program to convert a package's PLIST into an
> mtree specification for makefs.
Lloyd,
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:
base-.*-lkm
base-adosfs-root
base-amd-bin
base-amd-shlib
base-atf-.*
...
etc-bind-.*
etc-bootserver-.*
etc-games-.*
etc-iscsi-.*
...
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 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).
Code for what I describe is at
<http://svn.matangie.dreamhosters.com/cuwin/cuw/trunk/src/boot-image/filter-syspkg/trim>.
Dave
[1] distrib/sets/listpkgs lists the syspkgs in a set.
[2] distrib/sets/syspkgdeps computes a naive set of package dependencies.
[3] distrib/sets/makeplist produces a PLIST for each syspkg.
--
David Young OJC Technologies
dyoung%ojctech.com@localhost Urbana, IL * (217) 278-3933
Home |
Main Index |
Thread Index |
Old Index