FreeBSD

Gonna install me some FBSD!

What makes freeBSD feel old?

4

This is a list of all the things that make it feel old. I started this while working at a place that ran a lot of FreeBSD machines. I never got around to finishing it because we started implementing linux boxes, but I think the complaints are still valid. The real shame is that I only wrote down 6 out of about 100 different things. Mostly it’s trivial stuff, but trivial stuff should be the easiest to fix- the FreeBSD people had a real fear of painting barns (take that as you will).

  • No Color during the install. none at all. even getting syntax highlighting in vim was a pain. Perhaps I’m just recalling the FreeBSD 3.1 installations they had, but it seemed a mess.
  • The ASCII art in the install menu. It gives the feel of a 1988 BBS. It didn’t help that there was a keyboard driver bug in 6.0 or 6.1 that prevented me from actually selecting anything at the menu.
  • Speaking of the install, I think out of the 30 or so installs I attempted, only 1 or 2 were even remotely close to trouble-free. I tried the easy, medium and advanced installs- perhaps it was just the box I was installing, or maybe bsd just hates me for calling it names.
  • The partitioning tool makes cfdisk look futuristic. Does FreeBSD actually listing my 200 Gig hd by block ranges? Let me just say, that’s WAY better than giving info in a useful unit.
  • network cards all have different device names- it seems a mess to have 4 Nics and have bge0, sf0, anxl0, and an0. It’s a bad example, but I guess it’s because I prefer the uniformity of eth0, eth1, eth2 in linux (which can be arranged by setting parameters in /etc/modprobe.d/options).
  • rc.conf always seemed to be the most cryptic thing ever- not that it was hard to read, you just never knew what you could put in there. Whenever I asked around for any way to tell what options were available for a given package to add them into rc.conf, the answer always turned to “well download the source and check.” I’m not sure if that was [several] someone’s idea of a joke, but it really made me dislike it. compare that to emerge -v package in gentoo, which lists all of the compile option in an easy to read format.

mrtg

0

So we just got these shiny new Netgear GSM7224 layer two 24 port managed switches, and I went about setting up MRTG. mrtg and snmp are one of my weak areas- I’m not too good at networking stuff to begin with, and mrtg has always seemed just out of my reach. Well, between rewiring half of the serverroom and threatening mrtg with a stick, I got it all working! now I can finally monitor network traffic and figure out which one of these network cards is a chatty cathy.

perhaps now I’ll set up mrtg on my system at home and play around with it more.

Intro to Vim Tip #3 (Visual Mode)

0

Another well used mode is Visual Mode, which turns your cursor into a hilighter.
open a textfile with several lines of text ad move the cursor to the middle

switch from command mode to visual mode:

v

You’ll notice as you move the cursor around, you highlight different sections from the point you started to the point you left. you can press [esc] to return to command mode.

hilight a few lines of text from command mode:

[shift]v[upkey]

my adding the modifier [shift] when pressing V, you switch to ‘visual line mode’. This allows you to copy paragraphs easily.

hilight a block of text from command mode:

[ctrl]v[upkey][upkey][rightkey]

Now what good is visual mode? we” for deleting or replacing, of course! This is great when you have the following block of text:

           [option min="1"  max="10"   ][/option]
            [option min="11" max="19"   multiplier="10000" ]cp[/option]
            [option min="20" max="38"   multiplier="1000"  ]sp[/option]
            [option min="39" max="95"   multiplier="100"   ]gp[/option]
            [option min="96" max="100"  multiplier="10"    ]pp[/option]

and you’ve decided you no longer need min and max.
– move the cursor in command mode over the ‘m’ in ‘min’ on the first line
– press [ctrl]v[downkey][downkey][downkey][downkey]
– press the right arrowkey until the closing quote on “100” is covered
– press ‘d’
all your text will be gone. But suppose you didn’t want the text to be gone, you wanted to replace it with something else?
– press ‘u’ and the text will reappear
– re-highlight it and press ‘c’ (text should disapepar)
– type your replacement string (use=”false”) and press [esc]
within a moment or two, use=”false” should jump up across all five lines

Visual modes are also useful for narrowing the scope of a search and replace, but I’ll get to that when I cover search and replacing.

Intro to Vim Tip #2 (deleting)

0

Deleting in vim can be done several ways- in insert mode, the delete key and backspace key perform as you’d expect them to, but what if you want more?

delete the character to the left of the cursor:

[esc]d[left arrow]

delete the character to the right of the cursor:

[esc]d[right arrow]

deleting the current line from insert mode:

[esc]dd

deleting the current line and the one below from insert mode:

[esc]d[downkey]

deleting the current line and the one above from insert mode:

[esc]d[upkey]

deleting current character and 4 to the right:

d5[rightkey]

deleting current line and 2 below:

d2[downkey]

You’ll notice from those last two examples that deleting characters to the left and right include the current character in the count, but deleting lines above and below do not. Weird.

Intro to Vim Tip #1

0

Vim is a great tool, but using is can be a pita in the beginning- hence, we go through the basics. There are several command modes, but we’ll only discuss a few at first: Command Mode and Insert Mode.

Command mode is used to perform actions like saving, searching, etc. Insert mode is used to insert and delete text. You’ll be switching between them a lot.

Open a file from the cli:

  $ vim foo.php

change to insert mode from Command mode:

  press 'i'

change to command mode from insert mode:

  press [esc]

save from insert mode:

  press [esc]:w[enter]

save and quit from insert mode:

  press [esc]:wq[enter]

quit and do NOT save from insert mode:

  press [esc]:q![enter]

An there you have it.

Dependencies of Dependencies in FreeBSD

4

Something that is really aggrivating the hell out of me is FreeBSD’s package management system. I’ve heard people go on and on about how it’s the best out there, but frankly I’m unimpressed.
The main reason for this is there is no way to determine ALL of the dependencies that are going to be installed when I install a package.
Lets do a comparison of a freeciv install on my workstations vs the freebsd server:

genbox ~ # emerge -tp freeciv

These are the packages that I would merge, in reverse order:

Calculating dependencies ...done!
[ebuild  N    ] games-strategy/freeciv-2.0.8
[ebuild  N    ]  media-libs/sdl-mixer-1.2.6-r1
[ebuild  N    ]   media-libs/smpeg-0.4.4-r7

As you can see, freeciv is dependent on sdl-mixer- not only that, sdl-mixer is dependent on smpeg, meaning for freeciv to be installed, BOTH sdl-mixer and smpeg need to be installed beforehand. you see not only the dependencies, but the dependencies of the dependencies. Fortuately for this example, there were only 2 layers of dependencies and they were fairly small.

Now, lets look at freebsd- to see the dependencies, you can’t actually do it from the command line- you have to visit their website: http://www.freebsd.org/cgi/ports.cgi?query=freeciv&stype=all&sektion=all
We can see there are a couple of matching packages, but we’re only interested in

freeciv-2.0.8 
A civilisation clone for X11; multiplayer
 Long description : Sources : Changes : Download
 Maintained by: infofarmer@gmail.com
Requires: Xaw3d-1.5E_1, expat-2.0.0_1, fontconfig-2.3.2_4,1, 
freetype2-2.1.10_3, gettext-0.14.5_2, jpeg-6b_4, 
libdrm-2.0.1_1, libiconv-1.9.2_2, pkgconfig-0.20_2, png-1.2.8_3, 
python-2.4.3, tiff-3.8.2, xorg-libraries-6.9.0

This shows all dependencies, not just the ones that need to be installed- but only one layer. What packages will freetype require installed? how about xorg-libraries? The best answer I’ve been able to find as of yet is “look them up for each dependency” and then for their dependencies, and then theirs. All of this manually, all of this through their website. plus, you have to make sure that each package you look up isn’t already installed. How many packages will it take?

I have yet to find a way to show dependencies of dependencies in freebsd, and several very competent BSD admins I know haven’t been able to answer this question.

My question is, WHY!?!? This is entry level base functionality that debian, gentoo, mandriva, suse and even freaking RHEL can do- why can’t BSD, the people behind the ports system, do this?

I’m afraid I know the answer to this question- they’re comfortable with what they have. I truly hope I am wrong. If anyone knows of the proper FreeBSD way to find dependencies of dependencies on the command line, please, let me know.

instablity

0

I don’t know if BSD can smell the gnu in my blood or what, but it is seriously putting up a fight. As I mentioned in the previous post’s followups, I got kde working finally- however every time I pop open Konqueror and hit slashdot, the entire machine locks solid. Not just konqueror, not just X; the whole machine.

Now, I know slashdot has a troll meme about BSD dying, but this is ridiculous. I had kde up and running for a good 24 hours before I popped open konqueror the first time, so it’s not like an instant hardware failure or something. I’ve been able to do everything fine in Linux for years on this hardware- Still works after this experience, as well. Konqueror, although not my first choice browser, has never had this issue before, either.

So what I’m really wondering is, where does the fault lie? Even if it is kde/konqueror based, why is a user-level application locking the entire system? Is it the fault of X, which probably falls in the top 20 most useful unix programs? Is it BSD itself? Perhaps K_F was right, maybe it is a library issue.

I know one thing for sure; VP was right when he said FreeBSD was not a workstation OS. I can’t cope with that kind of instability- I have no choice but to go back to Linux. I need to get shit done. I’ll convert my Ridllr sideproject box to BSD and see what I can do there. I hope it makes a MUCH better server than it does a workstation…

What’s Missing?

1

So, I’m compiling a list of what’s missing from my BSD install from the get go.

  • tab-complete – stupid default shell is csh, which means no tab complete. Come on guys, jump on up to 1999.
  • alt key – This is probably a keymap issue, but the alt and delete keys do not work. Alt acts like it does nothing, and delete behaves like a tilde. This means no alt tab. The question becomes, “if USA ISO is not the proper keymap, what is?” I’d like the one that windows and linux use as default if anyone knows offhand.
  • Where’s my X – installed as a “user + X” setup, but X does not start on boot. I can figure out how to get it to start, but still a pain in the ass.
  • searching in sysinstall – again a comparison to make menuconfig- searching in the package list with / would be really handy.
  • Scroll Wheel – stupid scroll wheel doesn’t work by default
  • cvsup not installed – I’m lead to believe that cvsup is responsible for the same effect as apt-get update or emerge sync in the linux world- i.e. major importance for package management. Then why isn’t it installed by default?
  • vim is not vi – Perhaps this is another keymap related issue, but vim seems to think it’s vi- i.e. simple things like backspace and delete do not work properly in insert mode. I don’t know what’s going on, but I had to install nano to make even simple changes, and I’ve been using vi for years.
  • Updatedb – There’s a locate, but no updatedb. Upon further research, I found a /usr/libexec/locate.updatedb. why it’s here, who knows, but it’s a pain in the ass- especially if you install a new system and you don’t want to wait a week for it to rebuild it’s database. Just one more thing to track down.

I know a lot of these arguments are of the vein “But that’s now how linux does it!”
Yes, I know, BSD isn’t linux, and yeah you could probably argue it’s apples to oranges or that BSD is more secure. But these are simple things. And to those who argue that BSD has better documentation than Linux, I suggest you check out the gentoo project’s documentation- it somehow manages to cover exactly what you need and does it in an efficient manner.

For cryin out loud guys, being “a real unix” doesn’t mean you have to stagnate.

First Impressions

2

Holy crap, welcome to 1980. The FreeBSD install is going to take a little bit longer than I thought. I booted off the Install CD and the first thing I noticed was the lack of color. Not shiny pretty GUI color, but angry fruit salad color. As pages of white text on black blackground whizzed past my screen, nothing stuck out as important; I noticed no dividers between sections. This is a very small, trivial thing, but it is nice. Compare and contrast with say a gentoo liveCD- I’m not even talking about the background images and framebuffered text; I just mean colored headers.

Never underestimate the power of syntax coloring.

Next up, HD partitioning- the tool they’re using is sorta like cfdisk, but ugly. I panicked at this point because I wasn’t sure where I wanted to install fbsd, and I was having second thoughts about completely wiping draccus. None of the partitions were labeled in silly ways like “hda1”, just (IIRC) ranges of blocks. Solution? Jumped back to linux, found a 15 gig partition that I had forgotten about, moved the stuff to the 150 gig linux partition, then booted off an unbuntu LiveCD I picked up at the FOSE Convention, and am currently resizing the 150 gig, deleting the 15 gig, and merging the free space so I can dedicate aroung 70 gigs to FreeBSD.

Unfortunately I’ve run out of time this morning to actually install FBSD, but I’ll get to it tonight. GParted is a very nice tool, BTW. Hopefully it’ll be done running e2fsck on the HD by the time I get home 🙂

Going FreeBSD

0

Well, the new job is gonna have a bucket full of FreeBSD servers. It’s been a while since I tinkered with FBSD, so it’ll be a challenge. To prepare for that challenge, I’ve decided to convert Draccus (my workstation) to BSD. The following is a list of hurdles I’ll need to surpass before I start in April:

  • get draccus up and running
  • get KDE up and running
  • get Gimp working
  • get my Wacom Graphire 3 tablet working
  • get my Logitech Quickcam working
  • get my m-audio keyboard working
  • get rosegarden recording again
  • burn a cd-rw
  • burn a dvd+rw

I’m presuming I’ll have no problems with my Nvidia 6600 GT, Audigy 4 soundcard, or other common hardware. With the problems I’ve been having with linux as of late (specifically draccus) there is a moderate chance I might fully convert from Linux to BSD. If I can accomplish the above list, I will continue using FBSD for one year. The disc is burning now.

Go to Top