DragonFly BSD

How To sync FreeBSD ports

This documentation is not intended for anyone other than the person(s) responsible for generating dports from the freebsd tree using the DragonFly BSD project's ironman server. All of these commands are done as root.

Update the world / kernel of ironman

Ideally the host machine and the jail's world should match. In reality, if changes are close, the jail's world can be newer but it's best that they always match.

# cd /usr/src
# make -j12 buildworld > /tmp/bw.log
# make -j12 kernel > /tmp/kernel.log
# make installworld > /tmp/iw.log
# make upgrade
# reboot 

Update the jail's world

# cd /root/adm/exec-dports-builder
# make update-world

Note that after a new release of DragonFly, a new world has to be create rather than updated. This will appear in documentation later.

Find out what's the current ports checkout version

You can run:

# date -r `cat /usr/local/portsnap/tag | cut -f 2 -d '|'`
Thu Apr 25 05:33:17 PDT 2019

Bring in latest freebsd ports

# make update-ports

Purge the previous dports tree

# make merge-purge

This can take several minutes.

Merge the framework

# make merge-mk

It is very common that one or more of the patches will not apply. If that happens:

1. su automaton
2. cd ~/DeltaPorts/special/Mk/diffs
3. Regenerate the diff patch or patches as necessary
4. exit
5. make merge-purge
6. make merge-mk

Repeat cycle until every diff patch applies. When it's clear, issue this comand

# make sync-mk

Merge everything

# make merge-purge
# make merge

This takes several minutes. During the merge, you will almost certainly see ports fail to sync due to that port utilizing a "diff" against the freebsd which has changed since the last sync. Take note of all failed ports. If you lost that information, you can execute "make reject-list" command to see which ports failed to merge. You can see the reject files at /usr/xports/[category]/[portname] for more information.

Each port has to be fixed before continuing. The general process for doing this is:

# su automaton
# cd ~/Deltaports/ports/[category]/[portname]
  (assuming that the Makefile diff failed to apply in this example):
# cp /usr/ports/[category]/[portname]/Makefile .
# dupe Makefile
# modify Makefile accordingly (see diffs/Makefile.diff)
# genpatch Makefile > diffs/Makefile.diff
# exit
# ./sync [category]/[portname]
  (if the sync command has no output, then the fix was good)

Finish merge

# make rsync-tree

Prune old ports

Remove dports where the freebsd ports have been removed.

# make prune-confirm

Reclaim hard disk space

# make dist-clean

This removes all distfiles that are no longer needed. It takes a few minutes, but it can reclaim gigabytes of space. You can usually go a few months without running this command (so it's optional; skip it if you're in a hurry to get started).

Kick off full build

# make synth-full-run

This command takes 3-4 days to execute.