Wednesday, April 4, 2012

Experience with FreeBSD

I use Windows Vista on my laptop, but I miss Linux a lot.
Maybe I am not the only one to see these days problems of popular Linux distros.  "Bloated."
My best featured machine is 5-year-old Dell Inspiron 1521 (AMD, 2G mem, 120G disk).  This barely runs modern FC15 without visual effects.  My choice of Desktop, KDE turned down my love with their broken nepomuk indexer.  

I feel like, my laptop is ruled out.  When I found myself disabling default stuffs just to make my user experience not terrible, a question came up.  Aren't there any other distro for small boxes?
Well, there are DamnSmallLinux.  But that's not a major distro.
How about Gentoo?  I used to be a big fan of Gentoo, but now I don't like compiling unless I have to do so.  If Gentoo supports binary packages a little better, that will be the perfect distro.

Then, FreeBSD came.
   1. FreeBSD is a major distro, and actually a traditional unix than Linux.
   2. FreeBSD supports not only source compilation, but also does binary packages.  Very strong and convenient.
   3. If the software works on both FreeBSD and Linux, then most likely its compatibility level is very high already.

However, I just realized that #3 is self-torturing, too much.  
I was about to develop my own patch for screen-4.0.3 on FreeBSD, I ran into a different issue.
Complaint of "sys/stropts.h".
I didn't know what that header file supposed to be... But, well, elite programmers like screen developers use this, and there should be a reason to be used.  So, I searched and learned about how FreeBSD organize compatibility header files.  But, when I looked at binary patch file, disappointed a little bit.


--- process.c
+++ process.c
@@ -37,7 +37,7 @@
 #include "config.h"
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others: */
-#ifdef SVR4
+#if defined(SVR4) && !defined(__FreeBSD__)
 # include sys stropts.h

This happens three times in different files.  
In other words, FreeBSD doesn't use this header.  Reading a little more from stackoverflow, surely this is for Sun.  Main source tree not having this patch means, FreeBSD isn't major enough, and I will run into this situations in the future..  This is self-torturing.  
Fine!  Close to 10 years of Development life won't give up this obstacle.  It's tedious, but not difficult.  So, I prepared seperate header directory from /usr/src/sys/compat/svr4/, and renamed its contents.  (svr4_ was prefixed, DAMN!!).  Modified Makefile and compiled.  The next "make" command passed "sys/stropts.h", but another complaint.

utmp.c:731: error: 'struct utmpx' has no member named 'ut_xtime'

struct is difined differently??  From BSD and Linux??
And again, from binary patch file (patch-os.c, patch-utmp.c) read about how to work around utmp problem (the patch was describing how to replace some sections of code, not just lines), I realized that "ENOUGH!!!"  Having compatibility by paying this torturing is costly.  I accepted that "FreeBSD isn't popular enough."

Now, I am not sure if I want to try out Arch Linux.

No comments: