Using ccache on FreeBSD (howto)

ccache is a compiler cache. It speeds up re-compilation of C/C++ code by caching previous compiles and detecting when the same compile is being done again.

The following is a step by step guide to how to enable and use ccache on FreeBSD 7.1:

  1. su
  2. # cd /usr/ports/devel/ccache
  3. # make install clean
  4. # vim /etc/make.conf

.if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*)) && !defined(NOCCACHE)

CC=/usr/local/libexec/ccache/world-cc

CXX=/usr/local/libexec/ccache/world-c++

.endif

Basically we’ve started by installing ccache (steps 1 through 3) and proceeded by editing /etc/make.conf as to enable ccache on builds.

Now we need to update the environment.

Further instructions here

Source: linux-bsd-sharing.blogspot.com (19/01/2009)

Differences between BSD and Linux

Geekmalaya has a post with 18 points on why the writer thinks FreeBSD is better than Linux

  1. BSD license allows users/companies to modify a program’s source code and not to release changes to the public
  2. BSD has the so-called “core system” (without packages)
  3. On BSD systems, all add-on packages are strictly installed into the /usr/local directory
  4. BSD systems use the system of “ports”, which are fingerprints of applications in the /usr/ports directory
  5. BSD systems have also their stable version
  6. Of course, the kernel is absolutely different
  7. BSD has FFS file system
  8. BSD systems divide their partitions internally
  9. Unless you make a good kernel hack, BSD systems can only be installed into the primary partition
  10. System configuration is manual for most of the time, but various clones like PC-BSD break this convention
  11. All BSD systems have a Linux emulation support
  12. BSD systems have less support from driver vendors, thus they lag behind in this view
  13. BSD systems do not use the Unix System V
  14. BSD kernels can be set to several security levels
  15. BSD’s have everything under one ROOF
  16. Generally, BSD systems boot and reboot faster than Linux
  17. In comparison to BSD, most Linux distributions are overbloated
  18. If you compile programs from ports, you will not stumble into compilation errors

I’m only linking to this article for information – please don’t start a flame war here. Read the whole article and the reasoning here.

Source: geekmalaya.com – 22/01/2009

FreeBSD Network Bugathon – 30 Jan until 1 Feb

The FreeBSD bugbusting team is coordinating a network bugathon, which will be held from 2009-01-30 to 2009-02-01 (Fri-Sun). The plan is to work through all network related PRs still open in GNATS. Everyone is welcome to join and help this effort.

Lots of more information is available on the FreeBSD wiki: http://wiki.freebsd.org/Bugathons/January2009

IRC channel where all the fun stuff will happen: #freebsd-bugbusters on EFNet

Source: FreeBSD Forums

Setting up a FreeBSD ZFS-only system

“After loader support for ZFS was imported into FreeBSD around a month ago, I’ve been thinking of installing a ZFS-only system on my laptop. I also decided to try out using the GPT layout instead of using disklabels etc.

The first thing I started with was to grab a snapshot of FreeBSD CURRENT. Since sysinstall doesn’t support setting up ZFS etc, it can’t be used, so one have to use the Fixit environment on the FreeBSD install cd to set it up. I started out by removing the existing partition table on the disk (just writing zeros to the start of the disk will do). If you’re reading this before the january 2009 snapshot of CURRENT comes out , you have to create your own iso image in order to get loader with the latest fixes. Look in src/release/Makefile and src/release/i386/mkisoimages.sh for how to do this.

Then, the next step was to setup the GPT with the partitions that I wanted to have. Using gpt in FreeBSD, one should create one partition to contain the initial gptzfsboot loader. In addition, I wanted a swap partition, as well as a partition to use for a zpool for the whole system.

To setup the GPT, I used gpart(8) and looked at examples from the man-page. The first thing to do is to setup the GPT partition scheme, first by creating the partition table, and then add the appropriate partitions”

Step-by-step instructions can be found here (Lost in volumes – 16/12/2008)

Software licensing; GPL, BSD or public domain?

The discussion on GPL vs BSD  licensing will probably never end, unless one or both licenses cease to exist.

There’s an interesting post about the GPL license and BSD license, and the writer’s suggests that the public domain license is the license to be chosen for real freedom, as the other two lay restrictions on the user.

About the GPL license he notes:

That’s what the GPL really is. A binding contract : That is a set of restrictions on those who use, develop or modify content licensed under it. It is not now or has ever been a formula on “freedom”. The GPL is not the definition of “generocity” that is giving without expecting any return. I hope all you GPL advocates would stop treating it as such and call it what it is. A license and a binding contract. Nothing more.

I.e. GPL restrictions are there to keep the freedom to change, modify, and share the code.

With regards to the BSD license he remarks:

Unlike the GPL, the BSD license doesn’t pretend to be something it isn’t and users of BSD license are well aware that, like all licenses, it is a binding contract between developers, distributors, and users. They have no delusions about how much “freedom” both licenses afford however the BSD still being a license it still has usage restrictions. Namely the copyright and disclaimer.

Developers using the BSD license don’t care nor want to police the actions of users once the source is copied. They’re not interested in “freedom” through coersion, which is actually slavery. They just want to make sure their products and sources are available from them regardless of need or future availability. If the users want to share their own modifications, then more power to them. But they’ll be damned if it’s by force.

I.e. the BSD license lets users do whatsoever they want with the software, even using it commercially (in closed source).

If real freedom is to be chosen, the author suggests going down the public domain route. This license places basically no restrictions whatsoever on your software. Anybody can use the software, may sell it or do with it what (s)he wants.

Read the post in its entirity.

Talking about blog posts discussing GPL vs BSD, here’s another recent one: BSD vs GPL (nevali.net – 30/12/2008)

FreeBSD Forums; some useful howto’s

The FreeBSD Forums seem to be getting more and more popular and it’s also starting to  become a useful source of information with howto’s, suggestions, advice etc

Some useful ones are:

 These are just a few; there are many more.

Links: FreeBSD Forums | Howtos & FAQs

FreeBSD Kernel Internals Lecture Posted

The first lecture from Kirk McKusick’s full length FreeBSD Kernel Internals course has been posted to the BSD Conferences channel on YouTube.

The following video is the first hour of Marshall Kirk McKusick’s course on FreeBSD kernel internals based on his book, The Design and Implementation of the FreeBSD Operating System. This course has been given at BSD Conferences and technology companies around the world.


Murray Stockely has some interesting details and stats on how the BSD Conferences Youtube channel is doing.