How To Create Official Synth Repo
How to Create an Official Synth Repo
System Environment
Make sure /usr/dports is updated and that it contains no cruft (git pull; git status). Remove any cruft.
Make sure your 'synth' is up-to-date 'pkg upgrade synth'. If you already updated your system you may have to build synth from scratch, from /usr/dports/ports-mgmt/synth.
Make sure /etc/make.conf is clean.
Update /usr/src to the current master, make sure there is no cruft in it
Do a full buildworld, buildkernel, installkernel and installworld
Reboot
After the reboot, before proceeding, run 'uname -a' and make sure you are now on the desired release or development kernel.
Synth Environment
/usr/local/etc/synth/ contains the synth configuation. It should contain a synth.ini file (you may have to rename the template), and you will have to create or edit a LiveSystem-make.conf file.
System requirements are hefty. Just linking chromium alone eats at least 30GB, for example. Concurrent c++ compiles can eat up to 2GB per process. We recommend at least 100GB of SSD based swap space and 300GB of free space on the filesystem.
synth.ini should contain this. Plus modify the builders and jobs to suit your system. With 128G of ram, 30/30 or 40/25 works well. If you have 32G of ram, maybe 8/8 or less.
; Take care when hand editing! [Global Configuration] profile_selected= LiveSystem [LiveSystem] Operating_system= DragonFly Directory_packages= /build/synth/live_packages Directory_repository= /build/synth/live_packages/All Directory_portsdir= /build/synth/dports Directory_options= /build/synth/options Directory_distfiles= /usr/distfiles Directory_buildbase= /build/synth/build Directory_logs= /build/synth/logs Directory_ccache= disabled Directory_system= / Number_of_builders= 30 Max_jobs_per_builder= 30 Tmpfs_workdir= true Tmpfs_localbase= true Display_with_ncurses= true leverage_prebuilt= false
- LiveSystem-make.conf should contain one line to restrict licensing to only what is allowed to be built as a binary package:
LICENSES_ACCEPTED= NONE
Make sure there is no other cruft in /usr/local/etc/synth/
In the example above, the synth working dirs are in "/build/synth". Make sure the base directories exist. Clean out any cruft for a fresh build from-scratch:
rm -rf /build/synth/live_packages/* rm -rf /build/synth/logs mkdir /build/synth/logs
- Run synth everything. I recommend doing this in a 'screen' session in case you lose your ssh session (assuming you are ssh'd into the build machine).
(optionally start a screen session) synth everything
A full synth build takes over 24 hours to run on a 48-core box, around 12 hours to run on a 64-core box. On a 4-core/8-thread box it will take at least 3 days. There will be times when swap space is heavily used. If you have not run synth before, monitor your memory and swap loads to make sure you have configured the jobs properly. If you are overloading the system, you may have to ^C the synth run, reduce the jobs, and start it again. It will pick up where it left off.
When synth finishes, let it rebuild the database. You then have a working binary repo.
It is usually a good idea to run synth several times to pick up any stuff it couldn't build the first time. Each of these incremental runs may take a few hours, depending on what it tries to build.
Uploading to Avalon
Check available disk space in /archive. Binary packages eat around 50GB but we want there to be plenty of free space, so at least 200GB should be free.
Make sure /synth/build/live_packages/ on the synth box (or wherever your synth packages have been built to) contains everything expected. It should have digests.txz, meta.txz, and packagesite.txz at the top level, and it should have an "All" and a "Latest" subdirectory. The "All/" subdir should have all the packages, and the "Latest/" subdir should have the pkg.txz file.
Avalon stores its binary dports in "/archive/dports/". To seed a new master release, create a directory "dragonfly:BLAH:x86:64" in "/archive/dports" where BLAH is the next even release number. So if master reports 5.5, the dports release will be "dragonfly:5.6:x86:64". Create the directory if necessary and cd into it.
Create a "LATEST" sub-directory under this directory. Then cpdup the packages:
cpdup /synth/build/live_packages/ avalon.dragonflybsd.org:/archive/dports/dragonfly:BLAH:x86:64/LATEST/
- When doing repeated cpdups, such as from a script, or after double-checking that you have all the paths correct, perhaps consider using the cpdup -i0 option to stop it from asking you when it wants to delete files.