Notes - FreeBSD Tips

.plan
[Last 5] [Last 10] [Index] [RSS Feed] [Full .plan (>1MB)]
Contact Me
Todo Graph
(aka: How busy is Dylan?)

Notes

Notes
SubVersion
Vim
C and C++
FreeBSD
more...

RMITCS

C Helpdesk Resources
Customising Your CS Account
more...

Software

Codepile
Assorted little scripts and apps.
dumps.pl - FreeBSD Backup script
rastodo.py - Python Console todo/reminder
more...
Android
NumLock
Lost Emulators

Game Mods

LethalMod
A Max Payne 2 mod - more realistic and deadly.
more...

Image Gallery

Image Gallery
Photos
Screenshots
more...

Roleplaying Games

Shadowrun Notes(4th ed)
Heavy Gear Notes(2nd ed)
GURPS Notes
GameMastering Notes

Miscellaneous

links
Taglines
crazy
Trombone slide position chart [PDF]
[Back to home page]
[Back to Index]

[Raw XML]
Assorted FreeBSD stuff.

Contents:

The below notes are mostly from my .plan - I also have some notes cribbed from the FBSD mailing lists.

Redirecting or deleting port/package dependencies

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.

Cutting down the buildkernel (and modules) time

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.

Keeping the locate database sane

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.

Quick guide to tracking/updating FreeBSD-STABLE


# 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)
A few extra points:

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.

Once-off Live FileSystem Dumps

 dump -0 -L -a [-f file or -p pipe] fsmountpoint
-0 full backup (no u so it doesn't touch the dumpdates file)
-L live filesystem - if you specify this dump will take a UFS snapshot and dump that. Ignored on a read only or unounted fs.
-a auto-size (so it writes all to the one file instead of doing volumes... over the first volume file and breaking it)

-h 0 Honour the nodump flag for full (level 0) dumps. Default is to ignore nodump unless doing an incremental dump.

-f file (can be - for stdout)
-p pipecommand (e.g. bzip2 or somesuch)

Random Hints for port authors/maintainers

Most 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.

Getting apache/php/perl slave ports to work


mod_ssl only ever seems to work properly if installed with Apache (rather than adding it later), so make sure you choose apache*-modssl* or add the make options when you install. Judging from assorted newsgroups and forums this seems to be a common problem. However, many things (like php*) have dependencies on "apache13" or "apache2" and not any extended packages/ports. Once you figure out what to do it is actually very easy to fix, just add the line "APACHE_PORT=www/apache13-modssl" (or similar) to /etc/make.conf . Thanks go to Dr. Matthew J Seaman in the FreeBSD mailing lists for pointing me in the right direction. http://lists.freebsd.org/pipermail/freebsd-questions/2004-April/043816.html
Generated Fri, 27 Apr 2012 06:01:22 +1100
Copyright © 2002-2011 Dylan Leigh.
[HTML 4.01 Transitional]