# Which would I be able to customize and tinker with more: FreeBSD or Gentoo?



## Lifeonfull (Dec 22, 2014)

And how?


----------



## J65nko (Dec 22, 2014)

Because the source code of both FreeBSD and Gentoo are available you can tinker with them equally.
You could even create a TinkerBSD or TinkerGentoo


----------



## garry (Dec 22, 2014)

Lifeonfull said:


> And how?


Tinkering with Gentoo/Funtoo Linux ports usually is accomplished by adjusting the global USE flags to add or remove support for many optional features.  This is done by editing the USE variable in /etc/make.conf or by adding package-specific features in /etc/portage/package.use.  In this way it is relatively easy to create, for example, a desktop system such as KDE without semantic desktop features (without nepomuk or baloo, etc.).  It was fairly straightforward for me to create a fluxbox/rox-filer desktop that does everything I want but without certain Red Hat/Poettering created Linuxisms, avahi, dbus, consolekit, policykit, systemd, etc.  It's also pretty easy to configure your own kernel to support your specific hardware and no more, or to implement hardening features.

I don't find it so easy to tinker with Gentoo by writing or revising the "ebuilds" themselves.  The portage ebuild language is rather complex.  However I have written a few ebuilds for programs not in the (huge) Gentoo ports tree and it is easy to define your own local overlay that is, well, overlaid on the standard ports tree.

Customizing a FreeBSD system takes place every time you build from ports.  You cd into the directory for the port, such as
`cd /usr/ports/*/kde`
and type `make install clean`.  Everything needed for KDE will be compiled and for each package that has optional features (mysql vs. sqlite, pulseaudio or not, etc.) you see a nice graphical dialog in which you see the list of options for that package, with short descriptions, and you can enable or disable the options you want.  The system remembers what options you choose (you never have to edit a big file of flags).  The number of features that are optional is not quite so extensive as in Gentoo (but then in Gentoo it is definitely easier to get into trouble by choosing unwisely from the labyrinth of USE flags...)

As an example of a specific difference:  FreeBSD allows you to build a KDE desktop with pulseaudio or without it.  Gentoo also allows you to build a KDE desktop without any indexing (semantic desktop) daemon. The Gentoo customization is more flexible but the additional capability to run KDE without nepomuk/baloo is NOT supported by upstream and can lead to unexpected behavior or need for somewhat expert user intervention.

It seems easier to me to write or modify makefiles for the FreeBSD ports, but adding your own set of new and modified ports takes a little care, probably using portshaker to merge many (two?) trees into one unified tree.  The best part of working on software for FreeBSD is that the (very huge) ports tree uses standard makefiles that are easy to understand, everything is done with standard Unix tools, and there are quite a few useful software development tools available in /usr/ports/ports-mgmt -- everything in FreeBSD is well documented in man pages.  You can read or print the documentation for any software (base or ports) from the FreeBSD Man Pages.

I can't assign scores to Gentoo and FreeBSD and declare which wins.  That wouldn't mean anything.  I can only experience them and appreciate their ways.  I appreciate that it was very easy to customize my desktop in Funtoo Linux, and I appreciate that for me it is easier to understand and use the  software development tools in FreeBSD.  It would be easier, I think, to contribute to FreeBSD, and possibly easier to build a well-engineered custom system for "serious work". 

As a side note, with FreeBSD it is trivial with the new installer (in 10.0 and 10.1) to install the root system on a ZFS file system.  If you want to tinker, ZFS, especially with a mirror array, gives you a very sturdy system to play with.  ZFS with jails is the best environment for software development and testing.  (I use a ZFS mirror array with my Funtoo system but in Linux-land I don't screw around with ZFS on root.)

tldr; I gave a very long answer to a very short question.  Sorry... hope it helped.


----------



## ANOKNUSA (Dec 22, 2014)

Lifeonfull said:
			
		

> Which would I be able to cusomize and tinker with more ... And how?



This is far too vague. Why are you tinkering? I doubt you'll, say, learn anything about how GNU/Linux distributions work by messing with FreeBSD. And what are you tinkering with? Being put together differently, you'll have limitations on what can be done to each OS. As for how, that's obviously going to be different in each case, since each OS is fundamentally different.

For what it's worth I've tried Gentoo several times and always wound up frustrated, even after being a long-time Arch and CRUX user. It allows for (and the community, to an extent, seems to encourage) a lot of tedious, unnecessary tweaking of things that make no real difference in the long run. There are thousands upon thousands of packages, but because they're spread across three loosely relate branches you're pretty limited in how you can combine them without some degree of risk of breakage. The need to unmask supposedly "unstable" packages I'd used for a long time, supposedly "stable" packages failing to build---it was a pain. Turns out the best kind of Gentoo system is the one you don't tweak into oblivion. The fewer USE flags you use the better, and the less you mess around with the default @world set (the set of packages that make up the default base system) the better everything works. That, and I think Portage is ugly. Then again, all of that potential breakage gives you plenty of opportunities to learn how to fix problems on your own. On the other hand, those fixes would largely apply to GNU/Linux and not *BSD; in fact, the sort of issues that arise from the pieced-together nature of Linux make them totally foreign to *BSD.


----------



## zirias@ (Dec 22, 2014)

Not knowing Gentoo at all and knowing FreeBSD only from my latest experiments, I'd still like to give an opinion:

After reading a lot of fuzz around "ebuilds", "portage" and USE-flags ... and people always talking about "optimized" systems ... it appears to me as if Gentoo somehow misunderstood the traditional BSD way of building packages and turned it into something ... uhm ... strange  Yes, (Free)BSD has this ports tree, that gives anyone easy access to build their own packages, and traditionally, this was the standard way. Of course, this makes for a nice place to let the user easily configure build-time options, so we have this possibility there.

What Gentoo did was more like "hey, binary packages are boring, we need to do something like BSD, so users can optimize their system" -- WHAT? This may be a result of Linux distribution history, previously all distributions focused on distributing readily-built binary packages. Nevertheless, they all HAVE their tools and mechanisms in place for building these packages. And their (including BSD ports) primary purpose is to package software in a way suitable for the OS. NOT to provide the user with gazillions of knobs for "tinkering" 

Looking at package building mechanisms, Debian is closer to the BSDs than Gentoo, cause it uses Makefiles (debian/rules is a Makefile, using other debhelper Makefiles, just like a port's Makefile uses some common Makefiles in /usr/ports/mk) for the job. I think this approach is superior over using shell scripts ... after all, make is suitable to "build" anything from a set of input files, including packages (or, documents using tex, or musical scores using lilypond etc. pp.)

So, the most important question here: What exactly do you want to "tinker" and why?

If your answer is: optimizing performance -- forget it. It's not worth a single hour of the hassle.

If, on the other hand, you just want to learn more about the inner workings of each OS: For Linux, try the "Linux from Scratch" book (available online). For FreeBSD, try building the entire system from the CURRENT subversion tree, see the Using Subversion section in the FreeBSD handbook.

Both are only advisable for users familiar with Unix in general and having some prior knowledge about programming (preferably C/C++) and basic design principles of operating systems. With FreeBSD, you'll still get some comfort like the ports tree, this is because FreeBSD is a complete OS in one project. For Linux, following the LFS book, you won't even have package management (or, implement your own), because Linux is still nothing more than a kernel, everything else is up to you.

*edit*: Of course, J65nko with the first followup here already said it all ... I just wanted to go into (opinion-based) details on some aspects.


----------

