Creating install CD with custom ports - how to massage INDEX file?

Ulrich Spoerlein uspoerlein at gmail.com
Fri Oct 26 14:17:09 PDT 2007


On Sun, 14.10.2007 at 09:38:14 -1000, Clifton Royston wrote:
>   I've been building my own install CDs for a planned multi-server
> upgrade to 6.2Rp8 and ran into one last stumbling block this week.  I
> understand the process a lot better now than I did a few years back
> when I was doing it for 4.8, but I'm still having trouble pieceing
> together how I get my own package set onto the CD in a usable form.
> 
>   I built the release with NO_PORTS=yes, because I'm building the ports
> from my own CVS tree, which is a tightly pared down subset of the
> /usr/ports CVS, plus locally written software in ports format.  I've
> ensured that the tree is closed under the dependency operation (to use
> some math jargon) - essentially that means that my ports subset includes
> all the dependencies of every port I'm including and all of *its*
> run/build dependencies in the tree, even if not being built.  That
> allows the dependency graph to be calculated and the INDEX-6 file to be
> built properly.
> 
>   However, copying the INDEX-6 file and my private packages hierarchy
> into the CD build area doesn't work; I can read them off the CD
> post-install but sysinstall doesn't see them.  It's not a disaster
> because I can always put the CD back in after booting and install them
> then, but it would would be nice to get them all zapped in with the
> initial install.

I'm doing something similar. I work with a complete ports tree and then build a
subset of interesting packages (plus required packages). The problem with
sysinstall is, that it requires the number of the CD, where the package
resides. Since I make sure, that my ISO never exceeds one volume I decided to
drop the volume number from the sysinstall INDEX altogether

Here's the Makefile targets creating the packages and ISO

packages:
        # prepare lots of stuff
        # ...
.for pkg in ${PACKAGES}
        chroot ${TLR} /create_packages.sh ${pkg}
.endfor
## Build a stripped down INDEX file, usually done by /usr/ports/Tools/scripts/release/scrubindex.pl, yet it would
## require manual handling. We assume all dependant packages are there (we just built them after all), so we simply
## take all lines where we have a package for it.
## First we grab the name of the indexfile (can be INDEX, INDEX-5, INDEX-6, etc.), then we loop over all entries of
## of the global index and test -f if the package was built, if so, we print the line.
        (INDEX=`sh -c "chroot ${TLR} /usr/bin/make -f /usr/ports/Makefile -V INDEXFILE"`; \
        awk -F"|" '{if (system("test -f ${TLR}/usr/ports/packages/All/" $$1 ".tbz") == 0) print $$0}' \
                ${TLR}/usr/ports/$$INDEX > ${TFR}/packages/INDEX)
        cd ${TFR} && find -d packages | cpio --quiet -dumpl ${TRR}/R/cdrom/disc1

iso:
# Remove CD_VOLUME from the cdrom.inf, we only ship 'disc 0'
        echo "CD_VERSION = ${RELEASE}" > ${TRR}/R/cdrom/disc1/cdrom.inf
        mkisofs -r -J -V '${RELEASE}' -publisher 'Distribution made for 1822direkt' -o ${TFR}.iso \
                -b boot/cdboot -no-emul-boot ${TRR}/R/cdrom/disc1
        md5 ${TFR}.iso > ${TFR}.iso.md5

hth,
Ulrich Spoerlein
-- 
It is better to remain silent and be thought a fool,
than to speak, and remove all doubt.


More information about the freebsd-hackers mailing list