Categories: Ports
An easy way to reduce disk access and prolonging the life of the disk, by using faster ram for compilation time.
Note you need a decent amount of ram that is dynamically used so this figure won't be used when you are not building a package.
Recommended but not required. Add a pkgmk user and fakeroot to prt-get.conf as on FakerootPorts then return to this page.
If you are using a pkgmk user for building find your user ID for pkgmk
$ id pkgmk
Edit /etc/fstab and add this line. Setting your preferred size size=... in M for megabytes or G for gigabytes and user ID of the previous command uid=...
pkgmk /usr/ports/work tmpfs size=1G,uid=XX,defaults 0 0
Mount the tmpfs, (saves rebooting).
# mount -t tmpfs -o size=1G,uid=XX,defaults /usr/ports/work
Edit /etc/pkgmk.conf and set where you put your ram file system from your /etc/fstab file.
PKGMK_WORK_DIR="/usr/ports/work/$name"
Edit /etc/pkgmk.conf and remove -pipe from all your *FLAGS=.
CFLAGS='-O2 -march=i686 -fomit-frame-pointer' CXXFLAGS='-O2 -march=i686 -fomit-frame-pointer'
Inspired by treach for giving me the idea and cptn for suggesting I write wiki pages.