Assorted FreeBSD stuff.
This assumes you are managing your ports with one of the tools that
reads /usr/local/etc/pkgtools.conf (e.g. portupgrade).
This won't prevent make from pulling independencies unless you
define NO_DEPENDS (e.g. in /etc/make.conf).
Inside the ALT_PKGDEP section, map each port you want
redirected to it's target. To delete dependencies, use :delete as the
target. For example:
ALT_PKGDEP = {
'textproc/libxml' => 'textproc/libxml2',
'devel/ORBit' => 'devel/ORBit2',
'graphics/imlib' => 'graphics/imlib2',
'textproc/ispell' => 'textproc/aspell',
'media/gnome-media' => :delete, #gnome meta-ports won't pull this in
'media/gstreamer' => :delete,
}
Some libraries can't be redirected like this - for example, some GTK1.x programs will not build with GTK2.x. Remember, this only redirects the dependencies that portupgrade (et al) use when installing or upgrading ports. It won't remove existing ports or prevent you from installing the old ones directly.
First of all, create a custom kernel config and get rid of stuff you won't be using. I recommend building a GENERIC kernel as well as your custom one just in case.
Removing items from the kernel config won't stop make
buildkernel from creating them as modules though. To stop the
modules from being made.
Put any directories which you DON'T want scanned for locate(1) in the
PRUNEPATHS var in /etc/locate.rc - for example:
PRUNEPATHS="/tmp /usr/tmp /var/tmp /var/db/portsnap /scratch"Filesystems which are not of the type specified in
/etc/locate.rc will not be scanned either.
# csup stable-supfile
# cd /usr/src
# rm -rf /usr/opt/*
# make buildworld
# make buildkernel KERNCONF=MYKERNEL
# make installkernel KERNCONF=MYKERNEL
- (must reboot into single user mode with new kernel)
# mergemaster -p
# make installworld
# mergemaster
- (get rid of /var/run/temproot when done merging)
- (reboot into multi-user mode)
make -DNOPROFILE buildworld
...
make -DNOPROFILE installworld
Saving dump (backup) space: You won't need to dump /usr/src (unless you have modified source, in which case you should have it in version control anyway) and you won't need /usr/obj at all, since it's built from src. On my system they take up more than the rest of /usr including home directories, so setting "chflags nodump" makes a big difference to the number of backup volumes I need.
dump -0 -L -a [-f file or -p pipe] fsmountpointMost importantly, TELL THE USER ABOUT IT. And not somewhere in the middle of the build process where it's going to be missed. Do it at the start with a pause for config/build options, and at the end for defaults and post-install configuration.