HOWTO boot FreeBSD, Linux, and Windows XP with GAG, GRUB, LILO, and BootEasy

Abstract

This posting endeavours to allow users to successfully boot the following Operating systems: Windows XP, most GNU/Linux distro, and FreeBSD/PC-BSD; using the following boot loaders: GAG, GRUB, LILO, PC-BSD (aka BootEasy). The target audience are PC-BSD users coming from Linux.

There will be several references provided at the end of the posting.

Using the Graphical Boot Manager, GAG

Simply boot off the install media and follow the on screen instructions.

Note well that must install a boot loader such as LILO or GRUB in a Linux / partition in order to boot Linux from GAG, like most other abstract boot loaders.

Using GNU GRUB

In order to boot PC-BSD from GRUB, you must tell GRUB which drive, slice, and
partition to load from; usign GRUBs own notation
syntax
.

The systems kernel is stored on disk as /boot/kernel/kernel and it’s Loadable Kernel Module (LKM) drivers are stored in the same directory; with a .ko suffix. Although it is possible to load the kernel directly, it is better to load stage three instead, which gives you an easier interface to loading the desired kernel.

You will have to edit the GRUBs configuration file. The name and location of GRUBs configuration varies based on your Operating System. Under Debian (and thus Ubuntu), OpenSUSE, and FreeBSD based systems, you will find it as /boot/grub/menu.lst. On Fedora/Red Hat Linux and Gentoo based systems you will find it in /boot/grub/grub.conf. Many distros may provide a symbolic link to /etc/grub.conf, please refer to your operating systems documentation if you can not find the file.

Open it as root and edit it accordingly with the settings for your system. This example is is meant for triple booting Windows XP, GNU/Linux, and PC-BSD, where they are installed in that order, into primary partitions.

title WindowsXP
root (hd0,0)
makeactive
chainloader --force +1
boot

title Foo Linux
root (hd0,1)
kernel /boot/vmlinuz

title PC-BSD
root (hd0,2,a)
kernel /boot/loader

By default, if the slice number is omitted, GRUB searches the first slice which has a partition. I have however specified the slice number in this example.

If your distro has already configured Windows and Linux in menu.lst/grub.conf,
you should probably leave it as is; appending the PC-BSD entry to the
configuration. The location and file name of the linux kernel can vary a bit,
/boot/vmlinuz, /vmlinuz, and /boot/vmlinuz-x.y.z should be common, but my grasp
of Linux kernels dates to Linux 2.2, not modern 2.6 — as always check your
operating systems documentation when necessary! initrd users please see the grub
manuls notes on
linux
.

Using LILO

For those whom still prefer the LInux LOader, you can still use it for booting PC-BSD: edit /etc/lilo.conf accordingly:

# cp /etc/lilo.conf /root/lilo.conf.old
# vi /etc/lilo.conf
# /sbin/lilo

I will leave the top matter in lilo.conf as an exercise to the reader (if you use LILO, you should know this); so working off the GRUB example, the /etc/lilo.conf file should look like:

other=/dev/hda1
label=WinXP
table=/dev/hda

image=/boot/vmlinuz
label=FooLinux
root=/dev/hda2
table=/dev/hda

other=/dev/hda2
label=PCBSD
root=/dev/hda3
table=/dev/hda

NB that initrd users will want to add a initrd=/path/to/your/initrd/img rule to
the FooLinux image specs.

Users with multiple hard drives, please refer to the FreeBSD
FAQ
for details.

Using the PC-BSD Boot Loader

The header is actually miss leading, as this is really just the boot loader used by FreeBSD, a.k.a. Boot Easy or /boot/boot0. Hence forth called BootEasy.

To boot your operating systems with BootEasy, once is installed – just reboot the PC. Following the previous examples, you would see a prompt like this:

F1: DOS
F2: Linux
F3: FreeBSD

Press F1 on the keyboard to load Windows XP, F2 to chainload FooLinux, or F3 to load PC-BSD.

Note well that you must have a suitable boot loader installed into the linux / partition in order to boot linux from BootEasy.

The FreeBSD FAQ specifically recommends to install
LILO into the Linux /
, although GRUB should work fine when installed into Linuxes /

References

Post script:

If you have a problem with my spelling, grammar, or punctuation: you can pay my family to go on a shopping spree and leave me free to type slower then I can physically move my fingers across the keys.

Disclaimer

The information provided here is done for your convenience at the authors expanse, it however is without any form of warranty or guarantee of fittness — use at yur own risk, I’m not responsible.

Opinions on tactical FPS

Rants, Rambles, and Raves… On Tactical FPS games

From a person who has been gaming since he was in diapers, using a Nintendo, and all the way into the future.

More realistic ballistics:

In old times, weapons were little more then you hit target, you do damage. And each hit from a given weapon doing so much damage, like 10% of life bar per bullet from SMG, 20% from rifle, Which is a piece of crap to start with, even by modern standards. More modern implementations might take into account mass, velocity, and hit modifiers.

Objects are generally boiled down to objects that can be penetrated and objects that can’t. In Raven Shield they take it a step even worse, an object that can be penetrated is usually limited to a destructible one. I.e. a bullet may penetrate a pawn (rainbow, tango, hostage), a window, or a door. But it won’t go through a carboard box, a cereal box, or wood fence, because these are all “solid bullet proof objects”.

When a bullet hits something, the mass of the bullet and the velocity it hit at should be taken into account along with the type of material hit and the density of it and the bullet. For example compare trying to penetrate a strong tungsten alloy and a tin can, which takes more punch?

SWAT4 essentially operates on the concept that if an object may be penetrated, the bullet has M mass moving at V velocity used to calculate it’s momentum. While the object being hit requires a certain amount of momentum to penetrate; if I looked deep enough into the games SDK, I wouldn’t be surprised if “momentum” was just a synonym for velocity to the developers… When the momentum is exceeded, the the damage caused by the bullet on it’s way through is modified by a modifier range or factor of how much damage it can still do.

What should really happen, in my opinion?

There should be several types of impact material, e.g. liquid, wood, concrete, metal, plastic. The idea is pretty simple, let’s say you take a gun and fire into a pool of water. For an object to occupy a space within that water, it has to displace the same volume of water out of it’s way, to move through it, it has to keep displacing water out of the way. Shooting through block of wood that is as thick as the water (e.g. same volume of) works about the same way, but the density is different, taking more force to displace the wood out of the bullets way in order to ‘penetrate’ the wood.

For the sake of performance it would make sense to have several known (common) densities with known properties and tune accordingly. It would still fall short of accuracy with the real world but make it easier to apply ballistics to all objects within the game.

The biggest problem with ballistics in modern FPS games, they continue to use the “can penetrate” and “can’t penetrate” stupidly…

Proper damage models:

Shooting a the representation of a human in a tactical FPS should have similar effects to the real world. Most often, you get a set of hit boxes based on superficial anatomy. A head, a torso, arms, legs, etc. And if your lucky a modifier that adjusts damage done based on the hit box, e.g. head shots fatal, leg shots minor damage or something like that.

I think they should take it a step further and apply more things based on the hit boxes. For example, why not take a leg? Break it into 4 hit boxes, the foot, the crus, the knee, and the thigh. If the target gets hit in any of the leg hit boxes, they should die! Bleed to death or fall into shock awhile later maybe… but not die out right as in games. Getting hit in the crus or the thigh should effect ones ability to walk, getting hit in the knee or the foot should probably force the target to crawl instead of walk.

The torso should be split into h8it boxes based on internals, the “general torso”, the heart, lungs, maybe the kidneys, e.t.c. A human might be able to survive several shots to the chest but I would think a double tap to the heart would have more (quickly) lethal effects, even if not as much as going for a T-Shot, I would think it more likely to disable the enemy in the sense of more games, and kill the target more readily.

Compared to games like Raven Shield (last patch) where it doesn’t really matter where you shoot a tango, just hit them 2ce and they are as good as dead, pardoning latency and the FN Five-Seven. And SWAT4 where the only side effect is it pays to follow the Mozambique drill — just to do enough damage quickly to put the target down. While in real life, the idea is if the double tap to centre mass doesn’t stop the target, taking down their nervous system will put’em down for good.

Weapons Attachments and kit restrictions:

I think AAO:SF has the best in terms of realism but makes for a too oft abused configuration, M4 with aimpoint + suppressor + M203. Raven Shield limits you to one attachment but that sucks, especially since it makes weapons like the AUG, SA80, and G36K more powerful (built in scopes) — further pissing off people who know about the Tavor Assault Rifles!

I think the proper solution would be to allow 2 attachments for all primaries, such as an barrel and an receiver attachment. So using the M4A1 carbine as an example. One could have an M4 with a scope and a suppressor or with a M203 and scope but not a bipod and a suppressor or an M203 and a suppressor, e.t.c. That would at least keep it fair.

Load outs, I really think a merger of the “package” and “individual” item ideas would work. For example, so many slots, like something like this:

Player Kit:
— Primary Weapon = None | SMG | AR | SG | SR | LMG | LAW
——— Front Attachment: None | Suppressor | Grenade Launcher | Bipod
——— Rear Attachment: Default sights | CQB scope | Magnifying scope | Night scope | Laser aiming module
——— Ammunition: FMJ/Slug | JHP/Buckshot
— Secondary Weapon = None | Pistol | TASER | Special
——— Pistol Attachment: None | Suppressor | Laser aiming module | Tactical light
——— Ammunition: FMJ | JHP | Cartridge

— Specialist item = None | Binoculars | Radio | Laser designator | Night vision goggles | Spy gizmo | Gas mask

— Demolitions item 1 = None | Breaching shotgun | Door breaching charges | Plastic explosive | Satchel charge | LAW ammunition | Breaching hammer | Breaching bar

— Protective Gear = None | Light | Medium | Heavy

Where light = Level IIIA, medium = level III, heavy = level IV on the NIJ standards.

And allot like 3 or 4 slots for grenade “packages”, say 3 slots holding a “two pack” of grenades.

— Grenade slot 1 = None | 2 x Fragmentation | 2 x Flashbang | 2 x Smoke | 2 x CS Gas
— Grenade slot 2 = None | 2 x Fragmentation | 2 x Flashbang | 2 x Smoke | 2 x CS Gas
— Grenade slot 3 = None | 2 x Fragmentation | 2 x Flashbang | 2 x Smoke | 2 x CS Gas

Which in my opinion would be the most flexible and much faster then having to equip each slot individually.

Breaching methods:

Ballistic breaching with shotguns, any shutgun capable of destroying the door and frangible breaching shot as well — in effect making hinge and knob side breaching possible. Explosive breaching with any suitable explosive, as well as dedicated door breaching charges, using shaped charges to blast through doors and windows, etc. Mechanical breaching with bars, sledge hammers, and even fire axes that just happen to be sitting handy.

The ability to break down doors, blow up walls, come crashing through windows, is just a requirement. You can’t have a tactical game unless you can conduct a full breach. Not having to use the “door” is also more realistic, why send everyone through one door… When we can sneak a team into the next room, frame charge through the damn wall. And employ snipers to pick off X-Rays through the windows — after coordinating kill zones ahead of time that is.

Vehicles:

One of the big problems with games is the “vehicle” selling point. In games like BF2 or Halo, they often become the gods of the battlefield, you have to use the vehicles to win.

By nature of things, vehicles make good transport and are very useful. But have to be controlled to avoid them becoming all powerful monsters of destruction in adversarial games. Having stuff like personal motorcycles and dune buggies or HMMWVs for transporting troops would be nice.

What I would like to see is AI controlled support vehicles that can be called in by team leaders using a “radio” item. So for example, a squad leader could call in an attack helicopter or a gun ship and have it circle in a radius overhead, attacking every enemy in sight.

To make that even sweeter, in some maps the enemy could have AAA and shoot the thing down !!!

That would open up so many possibilities, such as vaulting a few DPVs into the target area, send a group/groups to secure the objective, while the other members of the patrol set up a parameter, guards the cars for egress, and calls in a few helo’s for backup. The possibilities for hit and fade runs are infinite when that is combined with a map editor…

Game Types:

Round based Cooperative, following “mission” and various special coop types, e.g. search and destroy, recon, hostage rescue. Round based and respawn based team death matches in “objectiveless” team with the most points wins, capture the flag, and search and destroy games. Heck, you could probably convert coop levels over for use as player Vs. player missions by using some form of squad based spawn points for the defending team.

Mission Planning:

It’s imperative to be able to play the mission ahead of time and adjust in combat. Raven Shields F4 map sucks horribly but at least you can draw on it. A real planning map that can accommodative multiple floors would be perfect.

Team leaders need to be set, teams organized, mission objectives reviewed, and assault teams synchronized on their objectives.

Human Capabilities:

People can walk, run, crawl, roll, jump, e.t.c so why why not do like wise in game? One of the most annoying thing in Tactical FPS games is when you get killed in one of those, “I could have just … like in real life” moments. Walking should be quick but not to quick, watching a SWAT team on the moves a perfect example. Running should be quick and really jumble your aim around. The ability to crouch and crawl is a requirement IMHO, and on top of that. When going prone while running or dashing, one should go into a dive.

If your walking and drop to the ground, odds are you want to get on the deck eh? But if your running like a bat out of hell, odds are you might not want to stop where ya are and lay down!!! I think to avoid the bunny hopper problem, jumping should be limited to a very short height and while running, just enough to be useful, yet realistic for someone in ~15 plus kilograms of combat gear.

That would allow one to still move quick, jump quite short heights, and avoid the usual crap of not being able to jump at all, because nubs and pansies abuse it so often online.

One thing I would really like, is a special “physical” action button. One that changes what it does based on the situation, whne close to people, go for a rifle butt/pistol whip/CQC attack, when close to objects, try to push, throw, kick, or otherwise employ them. Such as kicking a chair across the room or flipping a table over — be versatile.

Team Organization:

It should be kept simple, AAO is a perfect example. Platoon leader, Squad/Section Leaders, Squad members. I think it’s useful to occasional have specialists but when it goes to the extent of say, BF2 or other class based configurations. I think you really loose all of the flexibility gained by having a tactical FPS modeled on anything beyond the general infantry…

Kit selection should define specialization options, not soldier “class”.

A perfect example, in RvS if we need more grenades, we bring more grenades, if we need a demolitions man, we bring demolitions! We don’t limit the demolitions man to a special class, we equip for the job. I think SWAT4’s split of grenades, breaching, and protective gear is the right style but the devs chose to divide it wrongly in terms of a Tactical FPS. But for simulation of Police SWAT environment, quite well since there are less, uhh… Fun toys to play with in most police departments >_>.

Graphics and Performance:

An Intel or AMD chip with performance comparable to a Pentium 4 in the 2.0-2.2 Ghz range, 768MB, and a 256MB Graphics card supporting OpenGL or DX9 decently would be an ideal minimal spec IMHO.

If you have a super gaming rig, you should get what you paid for within reason. If you only have a common gaming rig, you should at least be able to play the game smoothly with lower graphics. Games should look as *nice* as you can make them on your hardware but you shouldn’t need a $300 graphics card and double your RAM just to play.

Hell, a good make of GeForce 6800 is dirt cheap now and one of the best graphics cards of it’s generation.

Communication Functions:

Text chat, V-Commands, and Text Macros.

Text chat is the lowest common denominator of the internet, and most games require a keyboard and mouse to use properly ^_^. Pre recorded Voice Commands like that used in MOHAA, RvS, SWAT3, SWAT4, BF2, and such are great. The only problem is game developers almost never choose decent stuff and many gamers never bother to use them.

V-Commands should be a quick pop up menu and issued through keystroke OR mouse gesture and drop a HUD or on screen indicator that says WHO, WHAT, and WHERE. Like in SWAT4, you can see a marker of WHO issued the V-Command, you can hear the WHAT part, and when orders are given you can see the WHERE part marked on screen.

In game VoIP has always been a pile of shit, no matter what game that has implemented it, it has ALWAYS been shit. Striking a deal with the TeamSpeak or Ventrillo people for a dream-team setup that allows the game to auto-join certain servers/channels from in game or when just joining the a given team on the server.

I’ve always liked TeamSpeak because its channel commander feature offers a lot for serious team gaming.

The ability to record text macros in game, without having to use keybinds like in Unreal 2 games, I think is something every FPS should do. SWAT3 is one game that really got it right, text + sound bites. Although, being able to open your configuration data in a text editor and adjust things to taste is, like the hugest perk ever created.

User account and Points / Rewards system:

Having any kind of spend your life playing this game and racking up kill points, and we will reward you with unlocks. Is just a crock full of shit, it’s a marketing gimmick to make you play the game longer and an excuse to sell you expansion packs that add features that, often in my experience — should have been there in the first place. Or freely able to be made by a modding community.

Game Mods:

SWAT3 was perfect, download ZIP file, copy ZIP file to folder, flick the on/off switches for what mods you wanted to play. Launch game, and play. The mods you had on got used when hosting the game but when joining OTHER peoples games, WITHOUT RESTARTING. The game would load the required mods for joining other peoples games, as long as you had them installed.

That is the way it should be, having to restart the game to swap mods or worse, having to use a conversion utility (e.g. MW4:Mercs) are just piles of crap, unless of course. You want to appear to be a company that would rather lock people into buying expansion packs or sequles that your not obligated to make, rather then letting people extend what hopefully is a decent game, and make it better!

User Accounts and Anti-Cheat:

The games got to have some way of ID’ing users uniquely, PB generally does a decent enough job of it. While I don’t care much for PB, and in fact have never had much use for it as anti-cheat (aside from the spying part). It does do one good thing.

It helps enforce server policy.

Level Design:

Missions need multiple ways of completing it, unless the game is a “quickie” that you’ll play once and then chuck on a CD-Rack, which means there is no point in paying more then ~20 bucks for it.

Problems should be approachable from many different angles, there should be multiple paths available on most missions. Objective and enemy placement should be able to be randomized, one of the greatest things of early SWAT3 was that the missions placed some “mission” specifics in a normal set of spawn points, then placed other stuff in more random locations. No playing from memory, you know X, Y, and Z are choke points, you know hostages may be on Level 2, but only the machine knows what you will find in between ^_^.

HUD:

A customizable hud, the ability o change colors and whats on it works best.

The ability to have a small tactical map or SAI like element is ideal. Having helmet cameras and UAV feeds available and the ability to reorganize the HUD and toggle cams on/off based on position in the team — is even more fun 😉

Cross hairs should be used but be able to be disabled (I for one prefer no cross hairs on my HUD, unless I’ve got grenades). Iron sights and scopes should work on every weapon available but allow for proper shooting. In CQB, you don’t aim with the sights for every shot, learn how to use the weapon.

When it comes to ammo counts, I think the traditional rounds in the magazine counter is nice, although not really necessary once you get used to how the game tunes the rates of fire. What is important is knowing how much ammo you have left. I love how SWAT4 implements it, you know how many rounds are in your current magazine. You can see how many magazines you have on the HUD and how “relatively” full they are. Magazine based ammo tracking is much more accurate the the old NNN total rounds remaining ammo counter anyway.

I think moving some features that would really improve the value of a HUD, into a separate “PDA” screen would be useful. B ecause then one could really stretch things to realistic limits, targeting people like Robocop or a T-800 are a bit futher off for most troops in the 21st Century.

I recently heard that they are making Terminator 4, I can’t help but be interested ^_^. Action flicks and Science Fiction are of course two of my favorite types of movies.

Earlier today, I was thinking about it. In general the Terminator Universe has always presented me with some what of a paradox, in Terminator John Connor and Skynet essentially create the impetus for their own creation.

Yet, how could they possibly exist in the future: in order to create themselves in the past!

Let us postulate that such a thing is impossible and that at some point their creation must have come apart through the natural flow of time. I admit, while it is quite possible for Sarah Connor to have had a son named John. It is rather improbable or quite probable depending on your frame of mind, that an artificial intelligence or super computer the likes of Skynet could have crept into existence [yet] but hell, it is a movie after all !!!!

In which case when Skynet sends the first Model 101 back in time to assassinate Sarah Connor before its greatest enemy, John Connor can be born. Is ‘time line 0’ the first part of the time flow.

John Connor sends Kyle Reese back in time to protect Sarah Connor, altering history in the process: thus creating a new path in time, ‘time line 1’

John Connors father is now Kyle Reese from the future in time line 0, Sarah Connor is now warned of the future and tries to prepare John for it, potentionally creating an even more effective form of John Connor, who will lead the human resistance in time line 1’s future against skynet, then that of time line 0.

The crushed arm and CPU of the Terminator find their way into Cyberdyne Systems hands, leading Miles Dyson to create Skynet, bypassing Skynets original creation in much the same way as John Connor.

Now that John Connor of time line 1 is more effective then the John Connor of time line 0 at fighting Skynet. The new Skynet sends a more lethel killing machine back in time, the T-1000, in an attempt to kill the young John Connor. John Connor sends back a reprogrammed Model 101 to protect himself but this too ultimately changes history, creating another alternate flow of time, ‘time line 2’ when history is changed in time line 1’s past.

Learning from the Terminator about the history of Skynet in their own flow of time, time line 1. The Connors embark to destroy Skynet before it is completed, changing history themselves…

The creator of Skynet is destroyed, the data is destroyed (although for us more computer savvy types, the probability of backups on or off site surviving is quite high). The arm is destroyed, the CPU is destroyed, both Terminators are destroyed, and John Connor is further prepared to lead the resistance against the machines.

This leads to a fork of time line 1, creating the aforementioned ‘time line 2’ in which the method of creation from time line 1 for Skynet no longer occurs.

However the method by which Skynet was originally created in time line 0, is still uncertain… Now if we postulate that the original creation of Skynet within time line 0, leading to Kyle Reese and the first Model 101 being sent back in time to change history. Was in fact a Department of Defense related project, like the Cyber Research Systems work under General Brewster in Terminator 3…

Skynets birth has merely been delayed, Judgement day occurs late, John Connor and Kate Brewster’s future in time line 2 leads to the Skynet of time line 2 sending back a super weapon, the ‘T-X’ back in time to time line 0s past, before Skynets own creation… In effect changing history again when the ‘T-X’ begins killing off members of the human resistance, in an attempt to cripple the resistance before it is even created.

Thus causing a fork of time line 2 resulting in ‘time line 3’ being created when the T-X begins killing off people. The third Model 101 sent back by Kate Connor to protect John Connor and herself in the past is ultimately succesful, into which they are now much more formidable foes for Skynet in the *new* future or time line 3.

Where time line 3 is the superposition of all the events within time lines that lead to it’s creation, except for elements not merged because of the alterations or ‘created’ time lines caused by said events.

e.g. 2004 in time line 3 is different then that of time line 2, where the T-X does not exist yet because it is created in the future, which is a future that does not exist yet because Skynet was created by Cyberdyne Systems in time line 1, which occurred because of events within time line 0 that caused a change in history…

You could say I believe in the possibility of destiny but not paradoxes, even if the concept of a paradox is more then occasionally abused by sci-fi writers.

And I think people are right, I just think to damn much lol. But hey, in lack of interesting things to try and analyze… Whats wrong with a little TV to supply the input?

It’s not like anyone has invented a time machine yet or a way of proving the dynamics of time travel, if such a thing is even within mans capability.

Besides, unlike in real life (if time travel ever occurs) you can’t foul up the space time continuum if you don’t get it right because it’s only a movie :-).

Converting FreeBSD into PC-BSD

Abstract

This post describes an example of how one can manually convert a FreeBSD installation into a PC-BSD one using the install disk. There are more elegant ways of doing it, such as pulling things from PC-BSDs SVN and compiling only PC-BSD specific components.

Disclaimers and warnings

This was done purely for ‘fun’ to see if the programs would work reasonably well. Which is why FreeBSD 7.0-Release was used as a base and PC-BSD 1.5.0 as the overlay (which is based on an old build of FreeBSD 6.3). I do not recommend, endorse, or even suggest actually doing something like this beyond exploratory or playful thoughts at heart !!!

If anyone actually tries this, your on your own.

If someone actually tries this they should probably use a PC-BSD 1.5.1 disk build, the files are newer.

Installing the PC-BSD v1.5.0-v1.5.1 update will install FreeBSD 6.3 files and may break your system — note that I didn’t enable the updater for my user account during this process.

Now that you are warned…

My test partition is reserved fro testing various alpha/beta/rc releases of operating systems I wish to test. So I wiped it clean and set out to install a basic working FreeBSD system.

I Installed FreeBSD 7.0-Release via CD-ROM, using the express option, auto
partitioning to save time, X-Developer dist set, and configured the system
lightly (set root pw, network services etc).

You want the X.org and related drivers from the disk, so they match your release level — you also want source code for later to build a custom kernel (optional)

Booted the system and logged in as root, one vtty for work and one for logging my notes in vim over ssh.

Then began converting the system to a FreeBSD-PC-BSD hybrid. Since the FreeBSD auto mode for partitioning the slice only gave me a 512mb / and 512mb /tmp, I created a /usr/work directory to use.

NOTE:
actual PC-BSD systems require several gigs of space for / to ensure safe updates and this is noted during previous upgrade notes. My guess after reading some of the 1.4/1.5 scripts is the developers have ‘yet’ to figure out how to use mount -a for mounting the needed file systems before extracting files and reserved storage places with the default partitioning scheme

pkg_add -r lzma && rehash  # to unpack pc-bsd files
mount -t cd9690 /dev/acd0 /mnt # mount pc-bsd disk 1
mkdir -m 0700 /usr/work
lzma d /mnt/PCBSD.tar.lzma /usr/work/PCBSD.tar
...
# lzma has fast decompression speeds but
# this is a ~451mb lzma file being
# unpacked into a 1.9gb tar file!

tar -C / -kpf /usr/work/PCBSD.tar # extract files without overwrite

cp /etc/rc.conf /etc/rc.conf.local # fix rc.conf
tar -C /tmp -f /usr/work/PCBSD.tar -px './etc'
cp /tmp/etc/rc.conf /etc/rc.conf
cp /tmp/etc/devfs.conf /etc/devfs.conf # modified in pc-bsd

vi /etc/ttys # start x on boot up
... # note the ttyvNum is arbitrary
#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure
ttyv8 "/PCBSD/bin/pdm" xterm on secure
...
X -configure && mv /root/xorg.conf.new /etc/X11/xorg.conf

#
# create users and groups that come with PC-BSD 1.5.0 but not FreeBSD
# 7.0-Release. Numerical values for -u userid and -g groupid are taken from
# viewing a unified diff of the group files.
#
pw groupadd -n haldaemon -g 560
pw groupadd -n cups -g 193
pw groupadd -n cyrus -g 60
pw useradd -n haldaemon -u 560 -g 560 -L daemon -d /nonexistent
-s /usr/sbin/nologin
pw useradd -n cups -u 193 -g 193 -L daemon -d /nonexistent -s /usr/sbin/nologin
pw useradd -n cyrus -u 60 -g 60 -L daemon -d /nonexistent -s /usr/sbin/nologin

#
# add my own user with the bash shell as a test (because it. Note that I typically set
# user/group id numbers by year of birth.
#
pw groupadd -n Terry -g 1988
pw useradd -n Terry -u 1988 -L default -m -s bash -g Terry
-G wheel,operator
passwd Terry
...

#
# now build a custom kernel merging GENERIC with /PCBSD/conf/PCBSD.i386
# I find Micro GNU Emacs (mg) to be both light and effective for this task.
# -- normally I would use vimdiff
#
pkg_add -r mg && rehash # if using mg !
cat > ~/.mg
auto-fill-mode
set-fill-column 78
global-set-key "^x^f" find-file
global-set-key "^h" delete-backward-char
set-default-mode blink
^D # end of ~/.mg

diff -u /usr/src/sys/i386/conf/GENERIC /PCBSD/conf/PCBSD.i386 > /tmp/kern.diff
cd /usr/src/sys/i386/conf
mg KAI
... # kernel config attached at EOF
# used GENERIC and /tmp/kern.diff to
# write the file if needed.

cd /usr/src # compile & install kernel
make -j12 buildkernel KERNCONF=KAI
... # roughly 10 minutes later..
make -j12 installkernel KERNCONF=KAI
...
umount /mnt && cdcontrol -f /dev/acd0 eject
reboot # let's rock it and roll on to KDE

On reboot, I was greeted with KDM, PC-BSDs login theme, and a clean startup of KDE (no error message popups). I was able to install and use the Firefox PBI from PBIDir without problems. But as one can see in the screen shots, there are sound system related core dumps

Free Image Hosting at www.ImageShack.us

Free Image Hosting at www.ImageShack.us

Free Image Hosting at www.ImageShack.us

I was also interested to see that there is now a ‘snd_emu10kx’ driver added in FreeBSD 7.0-Release which supports my card. So I guess I won’t have to manually compile the ‘outdated, unmaintained, etc’ audio/emu10kx port to get working sound, the manual page seems to suggest it is the same driver more or less. I only had to add an entry to my loader.conf file to get it loaded before PC-BSD sound detection system, just like audio/emu10kx from ports it won’t work (for me) if kldload’ed later on.

I found that although everything I tested was working fine, audio and video related apps were dumping core (mplayer at start, kaffeine during playback). So I did a pkg_delete on kaffeine and kaffeine-mozilla and reinstalled from packages and soon was blasting MP3’s from a FAT32 partition 😉

MPlayer needs to be recompiled as expected, The KDE sound system will likely need that to but otherwise I’ve observed no real breakages. Not that I’ve taken the time to test every single program!

Personal Opinions

If like me, your primary reason for using PC-BSD is a quick way of grabbing KDE — you would be better off installing PC-BSD! As far as setting up a working desktop system, one can do that easy through FreeBSD. If one doesn’t want to go into configuration details for ‘extra’s like PF or X11 using PC-BSD or DesktopBSD is a better idea anyway.

If all you want is PBI, export, compile, and install the necessary files from PC-BSDs SVN repository.

Kernel Configuration: KAI

Note to SATA hard drives out there, the ATA_STATIC_ID option effects device numbering. FreeBSD GENERIC kernel configuration uses it and detects my SATA drive as ‘ad4’, PC_BSD kernel configuration has it turned off and detects my drive as ‘ad0’ — I only have one SATA II hard drive installed.

Changing the ATA_STATIC_ID kernel option means you will havve to make sure /etc/fstab is in working shape unless you want to see a mount root prompt.

#
# Custom FreeBSD 7.0 kernel based on PC-BSD 1.5 Kernel config for FreeBSD 6.3
#

cpu I686_CPU
ident KAI



#options SCHED_$BSD # 4BSD scheduler
options SCHED_ULE # ULE scheduler ;-)
options PREEMPTION # ENABLE KERNEL THREAD PREEMPTION
options INET # INTERNETWORKING
options INET6 # IPV6 COMMUNICATIONS PROTOCOLS
options SCTP # STREAM CONTROL TRANSMISSION PROTOCOL
options FFS # BERKELEY FAST FILESYSTEM
options SOFTUPDATES # ENABLE FFS SOFT UPDATES SUPPORT
options UFS_ACL # SUPPORT FOR ACCESS CONTROL LISTS
options UFS_DIRHASH # IMPROVE PERFORMANCE ON BIG DIRECTORIES
options UFS_GJOURNAL # ENABLE GJOURNAL-BASED UFS JOURNALING
options MD_ROOT # MD IS A POTENTIAL ROOT device
options NFSCLIENT # NETWORK FILESYSTEM CLIENT
options NFSSERVER # NETWORK FILESYSTEM SERVER
options NFS_ROOT # NFS USABLE AS /, REQUIRES NFSCLIENT
options MSDOSFS # MSDOS FILESYSTEM
options CD9660 # ISO 9660 FILESYSTEM
options PROCFS # PROCESS FILESYSTEM (REQUIRES PSEUDOFS)
options PSEUDOFS # PSEUDO-FILESYSTEM FRAMEWORK
options GEOM_PART_GPT # GUID PARTITION TABLES.
options GEOM_LABEL # PROVIDES LABELIZATION
options COMPAT_43TTY # BSD 4.3 TTY COMPAT [KEEP THIS!]
options COMPAT_FREEBSD4 # COMPATIBLE WITH FREEBSD4
options COMPAT_FREEBSD5 # COMPATIBLE WITH FREEBSD5
options COMPAT_FREEBSD6 # COMPATIBLE WITH FREEBSD6
options SCSI_DELAY=5000 # DELAY (IN MS) BEFORE PROBING SCSI
options KTRACE # KTRACE(1) SUPPORT
options SYSVSHM # SYSV-STYLE SHARED MEMORY
options SYSVMSG # SYSV-STYLE MESSAGE QUEUES
options SYSVSEM # SYSV-STYLE SEMAPHORES
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B REAL-TIME EXTENSIONS
options KBD_INSTALL_CDEV # INSTALL A CDEV ENTRY IN /DEV
options ADAPTIVE_GIANT # GIANT MUTEX IS ADAPTIVE.
options STOP_NMI # STOP CPUS USING NMI INSTEAD OF IPI
options AUDIT # SECURITY EVENT AUDITING

# TO MAKE AN SMP KERNEL, THE NEXT TWO LINES ARE NEEDED
options SMP # SYMMETRIC MULTIPROCESSOR KERNEL
device apic # I/O APIC

# CPU FREQUENCY CONTROL
device cpufreq

# BUS SUPPORT.
device eisa
device pci


# FLOPPY DRIVES
device fdc

# ATA AND ATAPI deviceS
device ata
device atadisk # ATA DISK DRIVES
device ataraid # ATA RAID DRIVES
device atapicd # ATAPI CDROM DRIVES
device atapifd # ATAPI FLOPPY DRIVES
device atapist # ATAPI TAPE DRIVES
options ATA_STATIC_ID # STATIC device NUMBERING
device atapicam # Atapi CAM support

# SCSI CONTROLLERS
device ahb # EISA AHA1742 FAMILY
device ahc # AHA2940 AND ONBOARD AIC7XXX deviceS
options AHC_REG_PRETTY_PRINT # PRINT REGISTER BITFIELDS IN DEBUG
# OUTPUT. ADDS ~128K TO DRIVER.
device ahd # AHA39320/29320 AND ONBOARD AIC79XX deviceS
options AHD_REG_PRETTY_PRINT # PRINT REGISTER BITFIELDS IN DEBUG
# OUTPUT. ADDS ~215K TO DRIVER.
device amd # AMD 53C974 (TEKRAM DC-390(T))
device isp # QLOGIC FAMILY
#device ispfw # FIRMWARE FOR QLOGIC HBAS- NORMALLY A MODULE
device mpt # LSI-LOGIC MPT-FUSION
#device ncr # NCR/SYMBIOS LOGIC
device sym # NCR/SYMBIOS LOGIC (NEWER CHIPSETS + THOSE OF `NCR')
device trm # TEKRAM DC395U/UW/F DC315U ADAPTERS

device adv # ADVANSYS SCSI ADAPTERS
device adw # ADVANSYS WIDE SCSI ADAPTERS
device aha # ADAPTEC 154X SCSI ADAPTERS
device aic # ADAPTEC 15[012]X SCSI ADAPTERS, AIC-6[23]60.
device bt # BUSLOGIC/MYLEX MULTIMASTER SCSI ADAPTERS

device ncv # NCR 53C500
device nsp # WORKBIT NINJA SCSI-3
device stg # TMC 18C30/18C50

# SCSI PERIPHERALS
device scbus # SCSI BUS (REQUIRED FOR SCSI)
device ch # SCSI MEDIA CHANGERS
device da # DIRECT ACCESS (DISKS)
device sa # SEQUENTIAL ACCESS (TAPE ETC)
device cd # CD
device pass # PASSTHROUGH device (DIRECT SCSI ACCESS)
device ses # SCSI ENVIRONMENTAL SERVICES (AND SAF-TE)

# RAID CONTROLLERS INTERFACED TO THE SCSI SUBSYSTEM
device amr # AMI MEGARAID
device arcmsr # ARECA SATA II RAID
device asr # DPT SMARTRAID V, VI AND ADAPTEC SCSI RAID
device ciss # COMPAQ SMART RAID 5*
device dpt # DPT SMARTCACHE III, IV - SEE NOTES FOR options
device hptmv # HIGHPOINT ROCKETRAID 182X
device hptrr # HIGHPOINT ROCKETRAID 17XX, 22XX, 23XX, 25XX
device iir # INTEL INTEGRATED RAID
device ips # IBM (ADAPTEC) SERVERAID
device mly # MYLEX ACCELERAID/EXTREMERAID
device twa # 3WARE 9000 SERIES PATA/SATA RAID

# RAID CONTROLLERS
device aac # ADAPTEC FSA RAID
device aacp # SCSI PASSTHROUGH FOR AAC (REQUIRES CAM)
device ida # COMPAQ SMART RAID
device mfi # LSI MEGARAID SAS
device mlx # MYLEX DAC960 FAMILY
device pst # PROMISE SUPERTRAK SX6000
device twe # 3WARE ATA RAID

# ATKBDC0 CONTROLS BOTH THE KEYBOARD AND THE PS/2 MOUSE
device atkbdc # AT KEYBOARD CONTROLLER
device atkbd # AT KEYBOARD
device psm # PS/2 MOUSE


device vga # VGA VIDEO CARD DRIVER

device splash # SPLASH SCREEN AND SCREEN SAVER SUPPORT

# SYSCONS IS THE DEFAULT CONSOLE DRIVER, RESEMBLING AN SCO CONSOLE
device sc

device agp # SUPPORT SEVERAL AGP CHIPSETS

# POWER MANAGEMENT SUPPORT (SEE NOTES FOR MORE options)
#device apm
# ADD SUSPEND/RESUME SUPPORT FOR THE I8254.
device pmtimer

# PCCARD (PCMCIA) SUPPORT
# PCMCIA AND CARDBUS BRIDGE SUPPORT
device cbb # CARDBUS (YENTA) BRIDGE
device pccard # PC CARD (16-BIT) BUS
device cardbus # CARDBUS (32-BIT) BUS

# SERIAL (COM) PORTS
device sio # 8250, 16[45]50 BASED SERIAL PORTS
device uart # GENERIC UART DRIVER

# PARALLEL PORT
device ppc
device ppbus # PARALLEL PORT BUS (REQUIRED)
device lpt # PRINTER
device plip # TCP/IP OVER PARALLEL
device ppi # PARALLEL PORT INTERFACE device
#device vpo # REQUIRES SCBUS AND DA

# IF YOU'VE GOT A "DUMB" SERIAL OR PARALLEL PCI CARD THAT IS
# SUPPORTED BY THE PUC(4) GLUE DRIVER, UNCOMMENT THE FOLLOWING
# LINE TO ENABLE IT (CONNECTS TO SIO, UART AND/OR PPC DRIVERS):
#device puc

# PCI ETHERNET NICS.
device de # DEC/INTEL DC21X4X (``TULIP'')
device em # INTEL PRO/1000 ADAPTER GIGABIT ETHERNET CARD
device ixgb # INTEL PRO/10GBE ETHERNET CARD
device le # AMD AM7900 LANCE AND AM79C9XX PCNET
device txp # 3COM 3CR990 (``TYPHOON'')
device vx # 3COM 3C590, 3C595 (``VORTEX'')

# PCI ETHERNET NICS THAT USE THE COMMON MII BUS CONTROLLER CODE.
# NOTE: BE SURE TO KEEP THE 'device MIIBUS' LINE IN ORDER TO USE THESE NICS!
device miibus # MII BUS SUPPORT
device bce # BROADCOM BCM5706/BCM5708 GIGABIT ETHERNET
device bfe # BROADCOM BCM440X 10/100 ETHERNET
device bge # BROADCOM BCM570XX GIGABIT ETHERNET
device dc # DEC/INTEL 21143 AND VARIOUS WORKALIKES
device fxp # INTEL ETHEREXPRESS PRO/100B (82557, 82558)
device lge # LEVEL 1 LXT1001 GIGABIT ETHERNET
device msk # MARVELL/SYSKONNECT YUKON II GIGABIT ETHERNET
device nfe # NVIDIA NFORCE MCP ON-BOARD ETHERNET
device nge # NATSEMI DP83820 GIGABIT ETHERNET
#device nve # NVIDIA NFORCE MCP ON-BOARD ETHERNET NETWORKING
device pcn # AMD AM79C97X PCI 10/100 (PRECEDENCE OVER 'LE')
device re # REALTEK 8139C+/8169/8169S/8110S
device rl # REALTEK 8129/8139
device sf # ADAPTEC AIC-6915 (``STARFIRE'')
device sis # SILICON INTEGRATED SYSTEMS SIS 900/SIS 7016
device sk # SYSKONNECT SK-984X & SK-982X GIGABIT ETHERNET
device ste # SUNDANCE ST201 (D-LINK DFE-550TX)
device stge # SUNDANCE/TAMARACK TC9021 GIGABIT ETHERNET
device ti # ALTEON NETWORKS TIGON I/II GIGABIT ETHERNET
device tl # TEXAS INSTRUMENTS THUNDERLAN
device tx # SMC ETHERPOWER II (83C170 ``EPIC'')
device vge # VIA VT612X GIGABIT ETHERNET
device vr # VIA RHINE, RHINE II
device wb # WINBOND W89C840F
device xl # 3COM 3C90X (``BOOMERANG'', ``CYCLONE'')

# ISA ETHERNET NICS. PCCARD NICS INCLUDED.
device cs # CRYSTAL SEMICONDUCTOR CS89X0 NIC
# 'device ED' REQUIRES 'device MIIBUS'
device ed # NE[12]000, SMC ULTRA, 3C503, DS8390 CARDS
device ex # INTEL ETHEREXPRESS PRO/10 AND PRO/10+
device ep # ETHERLINK III BASED CARDS
device fe # FUJITSU MB8696X BASED CARDS
device ie # ETHEREXPRESS 8/16, 3C507, STARLAN 10 ETC.
device sn # SMC'S 9000 SERIES OF ETHERNET CHIPS
device xe # XIRCOM PCCARD ETHERNET

# WIRELESS NIC CARDS
device wlan # 802.11 SUPPORT
device wlan_wep # 802.11 WEP SUPPORT
device wlan_ccmp # 802.11 CCMP SUPPORT
device wlan_tkip # 802.11 TKIP SUPPORT
device wlan_amrr # AMRR TRANSMIT RATE CONTROL ALGORITHM
device wlan_scan_ap # 802.11 AP MODE SCANNING
device wlan_scan_sta # 802.11 STA MODE SCANNING
device an # AIRONET 4500/4800 802.11 WIRELESS NICS.
device ath # ATHEROS PCI/CARDBUS NIC'S
device ath_hal # ATHEROS HAL (HARDWARE ACCESS LAYER)
device ath_rate_sample # SAMPLERATE TX RATE CONTROL FOR ATH
device awi # BAYSTACK 660 AND OTHERS
device ral # RALINK TECHNOLOGY RT2500 WIRELESS NICS.
device wi # WAVELAN/INTERSIL/SYMBOL 802.11 WIRELESS NICS.
#device wl # OLDER NON 802.11 WAVELAN WIRELESS NIC.

# PSEUDO deviceS.
device loop # NETWORK LOOPBACK
device random # ENTROPY device
device ether # ETHERNET SUPPORT
device sl # KERNEL SLIP
device ppp # KERNEL PPP
device tun # PACKET TUNNEL.
device pty # PSEUDO-TTYS (TELNET ETC)
device md # MEMORY "DISKS"
device gif # IPV6 AND IPV4 TUNNELING
device faith # IPV6-TO-IPV4 RELAYING (TRANSLATION)
device firmware # FIRMWARE ASSIST MODULE

# THE `BPF' device ENABLES THE BERKELEY PACKET FILTER.
# BE AWARE OF THE ADMINISTRATIVE CONSEQUENCES OF ENABLING THIS!
# NOTE THAT 'BPF' IS REQUIRED FOR DHCP.
device bpf # BERKELEY PACKET FILTER

# USB SUPPORT
device uhci # UHCI PCI->USB INTERFACE
device ohci # OHCI PCI->USB INTERFACE
device ehci # EHCI PCI->USB INTERFACE (USB 2.0)
device usb # USB BUS (REQUIRED)
#device udbp # USB DOUBLE BULK PIPE deviceS
device ugen # GENERIC
device uhid # "HUMAN INTERFACE deviceS"
device ukbd # KEYBOARD
device ulpt # PRINTER
device umass # DISKS/MASS STORAGE - REQUIRES SCBUS AND DA
device ums # MOUSE
device ural # RALINK TECHNOLOGY RT2500USB WIRELESS NICS
device rum # RALINK TECHNOLOGY RT2501USB WIRELESS NICS
device urio # DIAMOND RIO 500 MP3 PLAYER
device uscanner # SCANNERS
# USB ETHERNET, REQUIRES MIIBUS
device aue # ADMTEK USB ETHERNET
device axe # ASIX ELECTRONICS USB ETHERNET
device cdce # GENERIC USB OVER ETHERNET
device cue # CATC USB ETHERNET
device kue # KAWASAKI LSI USB ETHERNET
device rue # REALTEK RTL8150 USB ETHERNET

# FIREWIRE SUPPORT
device firewire # FIREWIRE BUS CODE
device sbp # SCSI OVER FIREWIRE (REQUIRES SCBUS AND DA)
device fwe # ETHERNET OVER FIREWIRE (NON-STANDARD!)
device fwip # IP OVER FIREWIRE (RFC 2734,3146)
device dcons # DUMB CONSOLE DRIVER
device dcons_crom # CONFIGURATION ROM FOR DCONS


#
# from PC-BSD conf
#
options LIBICONV
options LIBMCHAIN
options CD9660_ICONV
options MSDOSFS_ICONV
options NTFS
options NTFS_ICONV
options UDF
options UDF_ICONV
options GEOM_UZIP # read only compressed disks
# wifi
device wlan
device wlan_wep
device wlan_ccmp
device wlan_tkip
device an
device ath
device ath_hal
device ath_rate_sample
device awi
device ral
device wi
device iwi
device ipw
device firmware
options DEVICE_POLLING
device pf
device pflog
device pfsync
options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_CDNR
options ALTQ_PRIQ
options ALTQ_NOPCC

Adding MySQL to my OpenBSD machine

My best friend while doing all of this was the MySQL Reference Manual :-).

The hard part was the fact that this and every thing else I want setup should have been done like 6 or 7 hours ago… But that’s my family for ya….

Phase I: Install and Configure the MySQL database service:

My desktop has WAMP installed and a mother load of development tools, my PC-BSD
laptop has the most complete development environment I have access to, and is
where I do all of my real work ^_^.

In order to make some progress in a few bits of playful testing and work that I
do need to tinker with, I’ve elected to setup things on Vectra to avoid the more
transient nature of the Windows machine here…

This is the notes I’ve compiled during the process. Managing to sleep off the
headache and get this done before everyone else wakes up… Grr. The machines an
OpenBSD 4.3-Release system working off an old Pentium 3 500Mhz with 384MB of RAM
— far from ideal for running MySQL but with just me to play with it, it’s no
problemo.

ssh2v
...
su - root
Password:

pkg_add -iv mysql-server
less /usr/local/share/doc/mysql/README.OpenBSD # refer to the instructions
given

vi /etc/login.conf
... # let the login class for _mysql and rebuild the login database
cap_mkdb /etc/login.conf
/usr/local/bin/mysql_install_db
... # initialize the database files
vi /etc/rc.mysql
... # quick script to launch mysql properly, listing 2A
vi /etc/rc.local
... # start it during resource configuration, listing 2B
/etc/rc.mysql
/usr/local/bin/mysql_secure_installation
... # secure the installation := -u root -p (pw=V1p3l2)
mysqladmin -u root -p status
...
mysql -u root -p -h localhost # set up our databases using the mysql client
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 18
Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> CREATE USER trowa IDENTIFIED BY '*********';
Query OK, 0 rows affected (0.03 sec)

mysql> CREATE DATABASE SpidersWeb
-> ;
Query OK, 1 row affected (0.01 sec)

mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| SpidersWeb |
| mysql |
+--------------------+
3 rows in set (0.00 sec)

mysql> GRANT ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, DELETE, DROP,
-> EXECUTE, INDEX, INSERT, LOCK TABLES, SELECT, CREATE VIEW, SHOW VIEW,
-> UPDATE ON SpidersWeb.* TO 'trowa'@'%';
Query OK, 0 rows affected
mysql> exit
Bye

That basically allows the database user to do just about everything to the
specified database from anywhere. I considered restricting access further but am
not in the mood to screw with changing it later should it become necessary (and
I hate setting up replacement routers, which happens every now and then).

Since every thing in the mysql client ends up in ~/.mysql_history, including the
password used in the CREATE USER statement. I am also rather glad that OpenBSD
keeps everyones nose out of /root by default, I plan on shredding the file:

rm -P /root/.mysql_history

for safety.

Phase II: Verify it works!

To make sure every thing works out properly enough (considering the current
local time!). I opened another urxvt on my laptop and connected to the server
machine.

Terry@dixie$ mysql -h vectra -u trowa -p SpidersWeb                        5:44
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 22
Server version: 5.0.51a-log OpenBSD port: mysql-server-5.0.51a

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql> SHOW TABLES
-> ;
Empty set (0.01 sec)

mysql> exit
Bye
Terry@dixie$ 5:45

Various notes

I found the kern.maxfiles sysctl and standard issue /etc/my.cnf file suitable
for my needs (for now). So no need to screw with them tonight, later on I need
to work on setting up httpd and things… Already 0600Z and work is early
tomorrow so no time to sor that out

Rather then muck about, in case I need to stop and start mysqld I moved the
startup from /etc/rc.local to calling a shell script to run it properly. That
way OpenBSD should allow mysqld sufficant file handles and I can control things
via /etc/my.cnf if I wish to lower it.

Listing 1: /etc/login.conf

#
# This class is used when running MySQL from /etc/rc.local
# XXX: It will *N_O_T* be used when starting/stopping mysqld manually!!
#
_mysql:
:ignorenologin:
:datasize=infinity:
:maxproc=infinity:
:openfiles=3580: # I've set this to sysctl::kern.maxfiles
:stacksize-cur=8M:
:localcipher=blowfish,8:
:tc=daemon:

Listing 2A: /etc/rc.mysql

#!/bin/sh
#
# A simple script to launch mysqld with the proper login privledges
#

su -c _mysql root -c '/usr/local/bin/mysqld_safe >/dev/null 2>&1 &'
echo -n ' mysql

Listing 2B: edits to /etc/rc.local

# launch the MySQL database server
if [ -x /usr/local/bin/mysqld_safe -a -x /etc/rc.mysql ]; then
/etc/rc.mysql
fi

Manually upgrading PC-BSD v1.4 to using FreeBSD 7 underneath

It can be done although I don’t actually recommend it lol, I did this solely for fun. Here is what I recored in the ~/fun-log file on my Samba server. A copy of my kernel configuration and a screen shot of the first GUI enabled boot is at the end of the post:

——————————————————————
Enabled SSH login to my test machine, since I don’t use the default port 22 for SSH I had to open ssh_config and sshd_config in /etc/ssh/ and uncomment the ‘Port’ line and change the port number.

A quick restart of the SSH Daemon from a root shell:

/etc/rc.d/sshd restart

I also disabled the firewall (pf) since I was in no mood to sort it out or port my laptops pf.config over.

and from my own shell

ssh Terry@xxx.xxx.xxx.xxx # s/xxx.xxx.xxx.xxx/server ip/g

I accepted the finger print and logged in, then ssh’d to this machine from that ssh connection doing like wise.

I’d recommend taking back ups of the system before proceeding, since this is a test machine I can skip it. I would suggest using either tar or dump in conjunction with a mounted recovery partition (or other storage device) or SSH if you have another system to use for storing the backups. Some people prefer Optical disks (cd/dvd) but I only use these for perm. backups.

rebooted with the FreeBSD 7.0-RELEASE install cd in the drive and chose the upgrade option from sysinstall. I chose to upgrade ‘custom’ and selected all sets except the profiled libraries and source code: every thing worked perfect except that X.Org failed to upgrade due to already installed packages, unexpected yes but no problem as I was not planning on using X until after KDE was upgraded.

Completed the upgrade and chose the ‘Fixit’ option in the main menu dropping to a shell on ttyv4 which I used to edit /etc/ttys and disable the start of X.Org on boot up.

Located the ttyv4 line that starts /PCBSD/bin/pdm on an xterm and change the ‘on’ to an ‘off’. Saved the file and gave a ‘reboot’.

I forgot that FreeBSD’s GENERIC kernels detect my hard drives wrong because the kernel uses the ATA_STATIC_ID option. I have a SATA drive for ad0 and with ATA_STATIC_ID in the kenrel config it detects ad0 as ad4, PC-BSD’s kernel builds have the ‘right’ option commented out to fix that so I had to manually select a root disk at boot:

ufs:ad4s3

While I could easily fix this with changing the lines in /etc/fstab that would defeat the point of merging PC-BSD’s SMP Kernel configuration with FreeBSD’s GENERIC kernel. Which I could have done before rebooting any way.

I Inserted my install disk and ran /usr/sbin/sysinstall, using the ‘Configure’ option I chose to install the source code for every thing through the distribution sets. As far as I know you need the full system source to build a kernel.

I set PACKAGEROOT and did a pkg_add of lynx so I could view the installed version of the FreeBSD handbook without reading HTML source code. I like to have access to the handbook when building a kernel so that I can check if any new notes have been made in the section on the kernel configuration file. I also did a pkg_add of the mg editor, much smaller then vim but easier for me to work with then FreeBSDs /usr/bin/vi when I wish to view two files at once.

mkdir ~/kernel-config; cd ~/kernel-config
cp /PCBSD/conf/PCBSD-SMP.i386 ./
cp /usr/src/sys/i386/conf/GENERIC ./
pkg_add -r mg
...
vi ~/.mg # set a few options I like for emacs

Then I used MicroGNUEmacs (mg) to merge PCBSD-SMP.i386 into GENERIC saving it as mykernel with the ^x^w command, the basics of using mgh you can find in the man page; if you choose to use mg but don’t know emacs. In point of fact, I have not used emacs regularly to edit files in over 2 years!

touch ./mykernel; ln -s /root/kerne-config/mykernel /usr/src/sys/i386/conf/mykernel; mg ./mykernel
cd /usr/src
make buildkernel KERNCONF=mykernel

You know, I wish I remembered to use the -j 8 option to make… Because last time I did that on my Pentium D it only took ~45 minutes to compile a kernel on 6.1-RELEASE or so.

Build started at: Sun Mar 2 21:19:14 UTC 2008
Build finished at: Sun Mar 2 21:40:51 UTC 2008

And to top it off, when I got up to do a few chores when I got back the console ‘screen saver’ kicked in. Which just happened to be the PC-BSD splash screen that comes up when ever the system boots kicked in during my kernel compile. This appears to have been some thing I broke with the upgrade, unless there is a difference because my laptop uses a Beastie image for the console screen saver.

I’m standing here like WTF? Did I crash or are they joking. Sure enough the system was playing a mean joke on me haha. And I know the system shouldn’t go down during a buildkernel even with what I’ve been ‘doing’ to the system without some serious problems. Right now it looks like the NIC drivers are compiling so it shouldn’t take to much longer.

While I wait, I’ll start merging the configuration files in /etc with those in /etc/upgrade.

A quick look to see if there are any config files from PC-BSD with pcbsd mentioned in them:

find /etc/ -type f -exec grep -ni ‘pcbsd|pc-bsd’ ‘{}’ ;

Of course they are *never* so nice as to denote what files are explicitly changed from the base FreeBSD installs 8=). Used lynx to browse PC-BSD’s SVN Repository online, looking at the system overlay in the 1.4 branch. I don’t see any any thing here that should effect me seriously — if any one tries this after me, check PC-BSDs SVN -> pcbsd/branches/1.4/system-overlay/etc (some thing like that) and look at the commit messages, if you see some thing that might effect you. Carefully compare the relevant files in /etc/ and /etc/upgrade unless like me, there is nothing you can seriously break that you will ever want to fix later.

There are two ways of doing this part, manual and mergemaster. If you have never done a buildworld/installworld before read the manual page for mergemaster and run it in a more user friendly mode. I usually do this any way because I use mergemaster only a few times a year at the most.

Some switches to mergemaster you might want to look up are: -a, -i, -v, -U

If you are going manually, I suggest you move the files from /etc/upgrade to /etc/ but pay special attention to files such as group and rc.local -> You don’t want to be unable to login as any thing but root on your reboot now do you? Hehe.

mv /etc/upgrade /root/etc-upgrade
mergemaster -viU
...

I installed most files but merged several others, among them:

ssh_conf and sshd_conf I merged to keep my port settings

group I merged to keep the various groups PC-BSD has setup for HAL’d and friends as well as having my user in wheel, operator, and its own group 😉

login.conf because I use ‘blf’ for the pass word format rather then the default md5. At the end of my mergemaster’ing I was happy to see that mergemaster was already a step ahead of me and promped for the login.conf database to be rebuilt for fool proof safeties sake:

*** You installed a login.conf file, so make sure that you run
'/usr/bin/cap_mkdb /etc/login.conf'
to rebuild your login.conf database

Would you like to run it now? y or n [n] y
Running /usr/bin/cap_mkdb /etc/login.conf

Some files that I chose to delete, the extra rc scripts which may have broken one of the Intel Wifi drivers. Also I decided not to install the *new* printcap file -> which if I had installed would have overwritten any printer setup I have done on my test machine.

One nice advantage is I have PC-BSD’s kernel stored in /boot/kernel.prev from the FreeBSD upgrade proceedure and the GENERIC FreeBSD 7.0-RELEASE kernel in /boot/kernel.old after installing my newly compiled custom kernel.

For extra safety, I’ll archive these in roots home directory with more normal names in case I need them later:

tar -cf - /boot/kernel.old | bzip2 -9 > /root/kernel-FreeBSD7.0-RELEASE.g
eneric.tar.bz2
tar -cf - /boot/kernel.prev | bzip2 -9 > /root/kernel-PCBSD1.4.2.smp.tar.
bz

I don’t know how to get BSD tar to adjust the compression level for gzip/bzip2 (-z,-j), assuming there is a switch for it. So I redirected tar’s output to bzip2 directly to enable maximum compression.

Sadly, on reboot my system would lock up when ever the kernel tried to probe /dev/da3. No matter how many times I try to boot it, it locks up on this. I booted the Windows XP installation on the machine, rebooted into PC-BSD again and it boots perfectly — This is a *standing* issue with this test machine.

Often FreeBSD will lock up during boot while probing my (internal) USB Card Reader when it gets to the memory stick slot and refuse to boot until I have booted another operating system on the machine. I have had this problem since FreeBSD 6.0-RELEASE, never tried any earlier ones.

Yes I hate this computer.

But otherwise my system however works bloody perfect 🙂

pcbsd# uname -ai
FreeBSD pcbsd 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Mar 2 16:27:13 EST 2008
root@pcbsd:/usr/obj/usr/src/sys/mykernel i386 TERRYP

Now to get X.Org and KDE back online, installed the ports tree from the FreeBSD 7.0-RELEASE CD-ROM, new enough for my needs. While that goes, lets back up a few things of interest:

tar -czf /root/old-ports.tgz /usr/local/etc /usr/local/share/{icons,config,config.kcfg,apps,applnk}
tar -cjf /root/linux-fc4.tar.bz2 /compat

These files are essentially our KDE icons and a few directories we might want to keep handy for later. Also I chose to backup the /compat directory that houses the linux files.

Now for the portupgrade business:

After telling the pkgdb what to do with it self, I checked the help and gave this a go after I got tired of the interactive:

pkgdb -fFi

The one thing I hate about dealing with portupgrade and friends on FreeBSD is the packages database — it’s a royal pain in the arse to deal with when you are not in the mood! After sorting out all of the crap that pkgdb had to shout at including the mother ****ing **** load of fonts mentioned in the sale dependencies I know I will __never__ do this again.

In fact, if I ever go back to maintaining a standard FreeBSD system for my workstation I’ll do this my way — use a list of programs needed, and do upgrades with out mucking with pkgdb and it’s friends lol -> less trouble I think to do it by hand the way my mind is thinking of it now hehe.

Now to fetch every thing needed before we start and prefer binary packages where possible to save on some compile time. -> Warning!!! Not my reccomendation, done here out of my lack of concern for breaking the test machine.

portupgrade -FDParR

Now to upgrade every thing preferring packages, go to splitsvile and read the log later.

portupgrade –batch -faPrR –results-file /root/portupgrade.log

Whether -a impiles -rR or not I don’t know, never really read the source code that much but I’m used to using all three switches at once for this. Portupgrade also crashed about 3 times during the installation, mostly from upgrading ruby and missing stuff in /tmp. It also fragged /var/db/pkg/pkgdb.db once or twice and shouted at /usr/ports/INDEX-7.db’s format. So I had to run the command several times taking about a day and a half to complete the entire operation as described here.

Now I remember why I don’t use portupgrade or mass software upgrades a lot on my stable machines.

I had to create a new xorg.conf so I did an

X -configure
X -config /root/xorg.conf.new

and it worked, a reboot and I was soon greated by KDE 3.5.8 running on X.Org 7.3 😉

I know I broke the PBReg program so I would expect most other custom programs that PC-BSD has needs a recompile from the source code. I also used as many packages as possible during the upgrade procedure to save time, not what I normally do on FreeBSD but it actually worked well enough. Tomorrow after work I’ll test out a few of the PC-BSD programs and the Firefox PBI I have installed on the test machine, and installing a PBI to see if any thing survived without a recompile needed. I also want to test the Linux ABI’s new abilities and see what happens when installing linux-flock binaries.

——————————————

Screen shot:

Free Image Hosting at www.ImageShack.us

Here is a copy of my kernel configuration:

# My PC-BSD v1.4.2 + FreeBSD 7.0-RELEASE kernel configuration

cpu I686_CPU
ident TERRYP

# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.

makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols

#options SCHED_4BSD # 4BSD scheduler
options SCHED_ULE # ULE scheduler instead ;-)

# options from PC-BSD that I'll keep handy
options LIBICONV
options LIBMCHAIN
options CD9660_ICONV
options MSDOSFS_ICONV
options NTFS
options NTFS_ICONV
options UDF
options UDF_ICONV
options GEOM_UZIP
options DEVICE_POLLING
device iwi # intel wireless adapters
device ipw # intel wireless adapters

#### I want to use PF.
device pf
device pflog
device pfsync

options ALTQ
options ALTQ_CBQ
options ALTQ_RED
options ALTQ_RIO
options ALTQ_HFSC
options ALTQ_CDNR
options ALTQ_PRIQ
options ALTQ_NOPCC

# Memory card drivers I want to test:
device mmc
device mmcsd

# options in GENERIC
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Improve performance on big directories
options UFS_GJOURNAL # Enable gjournal-based UFS journaling
options MD_ROOT # MD is a potential root device
options NFSCLIENT # Network Filesystem Client
options NFSSERVER # Network Filesystem Server
options NFS_ROOT # NFS usable as /, requires NFSCLIENT
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_PART_GPT # GUID Partition Tables.
options GEOM_LABEL # Provides labelization
options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options COMPAT_FREEBSD6 # Compatible with FreeBSD6
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
options KTRACE # ktrace(1) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options ADAPTIVE_GIANT # Giant mutex is adaptive.
options STOP_NMI # Stop CPUS using NMI instead of IPI
options AUDIT # Security event auditing

# To make an SMP kernel, the next two lines are needed
options SMP # Symmetric MultiProcessor Kernel
device apic # I/O APIC

# CPU frequency control
device cpufreq

# Bus support.
device eisa
device pci

# Floppy drives
device fdc

# ATA and ATAPI devices
device ata
device atadisk # ATA disk drives
device ataraid # ATA RAID drives
device atapicd # ATAPI CDROM drives
device atapifd # ATAPI floppy drives
device atapist # ATAPI tape drives
#### XXX:
#### This option must be commented out for SATA drives to be
#### detected properly, e.g. ad0 not ad4 on boot up!
#options ATA_STATIC_ID # Static device numbering

# SCSI Controllers
device ahb # EISA AHA1742 family
device ahc # AHA2940 and onboard AIC7xxx devices
options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
device ahd # AHA39320/29320 and onboard AIC79xx devices
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
device amd # AMD 53C974 (Tekram DC-390(T))
device hptiop # Highpoint RocketRaid 3xxx series
device isp # Qlogic family
#device ispfw # Firmware for QLogic HBAs- normally a module
device mpt # LSI-Logic MPT-Fusion
#device ncr # NCR/Symbios Logic
device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
device trm # Tekram DC395U/UW/F DC315U adapters

device adv # Advansys SCSI adapters
device adw # Advansys wide SCSI adapters
device aha # Adaptec 154x SCSI adapters
device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
device bt # Buslogic/Mylex MultiMaster SCSI adapters

device ncv # NCR 53C500
device nsp # Workbit Ninja SCSI-3
device stg # TMC 18C30/18C50

# SCSI peripherals
device scbus # SCSI bus (required for SCSI)
device ch # SCSI media changers
device da # Direct Access (disks)
device sa # Sequential Access (tape etc)
device cd # CD
device pass # Passthrough device (direct SCSI access)
device ses # SCSI Environmental Services (and SAF-TE)

# RAID controllers interfaced to the SCSI subsystem
device amr # AMI MegaRAID
device arcmsr # Areca SATA II RAID
device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
device ciss # Compaq Smart RAID 5*
device dpt # DPT Smartcache III, IV - See NOTES for options
device hptmv # Highpoint RocketRAID 182x
device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
device iir # Intel Integrated RAID
device ips # IBM (Adaptec) ServeRAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID

# RAID controllers
device aac # Adaptec FSA RAID
device aacp # SCSI passthrough for aac (requires CAM)
device ida # Compaq Smart RAID
device mfi # LSI MegaRAID SAS
device mlx # Mylex DAC960 family
device pst # Promise Supertrak SX6000
device twe # 3ware ATA RAID

# atkbdc0 controls both the keyboard and the PS/2 mouse
device atkbdc # AT keyboard controller
device atkbd # AT keyboard
device psm # PS/2 mouse

device kbdmux # keyboard multiplexer

device vga # VGA video card driver

device splash # Splash screen and screen saver support

# syscons is the default console driver, resembling an SCO console
device sc

device agp # support several AGP chipsets

# Power management support (see NOTES for more options)
#device apm
# Add suspend/resume support for the i8254.
device pmtimer

# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
device cbb # cardbus (yenta) bridge
device pccard # PC Card (16-bit) bus
device cardbus # CardBus (32-bit) bus

# Serial (COM) ports
device sio # 8250, 16[45]50 based serial ports
device uart # Generic UART driver

# Parallel port
device ppc
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
device ppi # Parallel port interface device
#device vpo # Requires scbus and da

# If you've got a "dumb" serial or parallel PCI card that is
# supported by the puc(4) glue driver, uncomment the following
# line to enable it (connects to sio, uart and/or ppc drivers):
#device puc

# PCI Ethernet NICs.
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 adapter Gigabit Ethernet Card
device ixgb # Intel PRO/10GbE Ethernet Card
device le # AMD Am7900 LANCE and Am79C9xx PCnet
device txp # 3Com 3cR990 (``Typhoon'')
device vx # 3Com 3c590, 3c595 (``Vortex'')

# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device miibus # MII bus support
device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
device bfe # Broadcom BCM440x 10/100 Ethernet
device bge # Broadcom BCM570xx Gigabit Ethernet
device dc # DEC/Intel 21143 and various workalikes
device fxp # Intel EtherExpress PRO/100B (82557, 82558)
device lge # Level 1 LXT1001 gigabit Ethernet
device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
device nfe # nVidia nForce MCP on-board Ethernet
device nge # NatSemi DP83820 gigabit Ethernet
#device nve # nVidia nForce MCP on-board Ethernet Networking
device pcn # AMD Am79C97x PCI 10/100 (precedence over 'le')
device re # RealTek 8139C+/8169/8169S/8110S
device rl # RealTek 8129/8139
device sf # Adaptec AIC-6915 (``Starfire'')
device sis # Silicon Integrated Systems SiS 900/SiS 7016
device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet
device ste # Sundance ST201 (D-Link DFE-550TX)
device stge # Sundance/Tamarack TC9021 gigabit Ethernet
device ti # Alteon Networks Tigon I/II gigabit Ethernet
device tl # Texas Instruments ThunderLAN
device tx # SMC EtherPower II (83c170 ``EPIC'')
device vge # VIA VT612x gigabit Ethernet
device vr # VIA Rhine, Rhine II
device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')

# ISA Ethernet NICs. pccard NICs included.
device cs # Crystal Semiconductor CS89x0 NIC
# 'device ed' requires 'device miibus'
device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
device ex # Intel EtherExpress Pro/10 and Pro/10+
device ep # Etherlink III based cards
device fe # Fujitsu MB8696x based cards
device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
device sn # SMC's 9000 series of Ethernet chips
device xe # Xircom pccard Ethernet

# Wireless NIC cards
device wlan # 802.11 support
device wlan_wep # 802.11 WEP support
device wlan_ccmp # 802.11 CCMP support
device wlan_tkip # 802.11 TKIP support
device wlan_amrr # AMRR transmit rate control algorithm
device wlan_scan_ap # 802.11 AP mode scanning
device wlan_scan_sta # 802.11 STA mode scanning
device an # Aironet 4500/4800 802.11 wireless NICs.
device ath # Atheros pci/cardbus NIC's
device ath_hal # Atheros HAL (Hardware Access Layer)
device ath_rate_sample # SampleRate tx rate control for ath
device awi # BayStack 660 and others
device ral # Ralink Technology RT2500 wireless NICs.
device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device wl # Older non 802.11 Wavelan wireless NIC.

# Pseudo devices.
device loop # Network loopback
device random # Entropy device
device ether # Ethernet support
device sl # Kernel SLIP
device ppp # Kernel PPP
device tun # Packet tunnel.
device pty # Pseudo-ttys (telnet etc)
device md # Memory "disks"
device gif # IPv6 and IPv4 tunneling
device faith # IPv6-to-IPv4 relaying (translation)
device firmware # firmware assist module

# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeley packet filter

# USB support
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices
device ugen # Generic
device uhid # "Human Interface Devices"
device ukbd # Keyboard
device ulpt # Printer
device umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
device ural # Ralink Technology RT2500USB wireless NICs
device rum # Ralink Technology RT2501USB wireless NICs
device urio # Diamond Rio 500 MP3 player
device uscanner # Scanners

# USB Ethernet, requires miibus
device aue # ADMtek USB Ethernet
device axe # ASIX Electronics USB Ethernet
device cdce # Generic USB over Ethernet
device cue # CATC USB Ethernet
device kue # Kawasaki LSI USB Ethernet
device rue # RealTek RTL8150 USB Ethernet

# FireWire support
device firewire # FireWire bus code
device sbp # SCSI over FireWire (Requires scbus and da)
device fwe # Ethernet over FireWire (non-standard!)
device fwip # IP over FireWire (RFC 2734,3146)
device dcons # Dumb console driver
device dcons_crom # Configuration ROM for dcons

Creating Firefox searchplugins for any site – including Qt !

You know, Firefox and friends have a nice search system but there are so many websites that just don’t have a canned search plugin you can install like the Wikipedia and Google ones. Because I use Qt and Python for most work on Neo Ports Manager I tend to RTFM a lot and one of the things I truly love about using KDE’s Konqueror webbrowser is I can go to the address bar and

qt3: someclass

and it will take me there, in fact I have it setup in Flock at the moment to use qt3, qt4 e.t.c as keywords to take me to the index. The thing is, I would like to search, after all there is a bloody search bar !

I tried looking online on how to make one but didn’t find any thing helpful, I think the stuff was written for Firefox 1.x so to heck with it. I opened profile and looked for where the search scripts were located. My laptop and desktop use Flock as the default web browser but the only difference this should make here is that my profile is stored in ~/.flock instead of ~/.mozila/*

The searchplugins are in your user profile, for me with flock it is:

/home/Terry/.flock/browser/t247gnll.default/searchplugin

On Windows the profile goes in your %UserProfile%Application Data in a folder such as mozillafirefoxprofile-name or flockbrowserprofilename depending on the browser you are using. Don’t have a Mac so dunno where it goes on there but thats why there is a FAQ online 😉

In here are several XML files,

Terry@dixie$ ls                                                            7:25
dictcc.xml gmail.xml qt3.xml youtube.xml
dictionarycom.xml photobucket.xml weathercom.xml
Terry@dixie$ 7:26

Each one is a search plugin in the search bar in the top right of my browser, qt3.xml is a file of my own creation.

If you are like me, when you are surfing the fine web you occasionally look at the URL’s of the web pages you visit, since I spend alot of time looking around at the Qt documentation I know that the documentation for each class is stored as ClassName.html in a specific folder on trolltechs web servers. This means if you can find out how your favorite website stores it’s files you can create a search plugin for nearly any website on the world wide web !!!!

I opened the dictcc.xml file to see how it is done, so simple it is easy as pie. And unlike Operas easy way of doing it in the GUI, we can set an ICON to use in the search bar 🙂

Qt class docs are in http://doc.trolltech.com/major-version.minor-version/classname.html so we want the text we type in the search bar to be replace the classname part of the URL with out search text, we do that with a little string interpolation.



Qt Toolkit
Qt3 - Search all classes
UTF-8
data:image/x-icon;base64,
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABtUlEQVQokY2Rv0sbYRjHv+97d1zu
8gtzwauGGmgjXU+hpaVCMlUMDnZox4IS/AvcCg4Obv4HLZk6dNLFJJ3SQoYkpSTQVUMj8Vf10KaX
O+Jd7u2QkHha0O/4PJ8Pz/PwkE8/XuB+cWwGBv6eNIAri7nuLeG4Yde/WidNGwxqXNBS0uRjod+S
QxQAGa7EXOSz7Uquw9jIJwRP5+V0JkzpoDKakM+2y7sdUSJzS4HEjAiC/Vq3tGNUCyaAxdVwH6PD
TSq5jiiRzKaSfBOIJYSwwkVjfGZT8cn0+xfzcM/2CPVvFmN4uRRQ4wIA49LNruufty7OWr25137G
UC+aHuH0lw0goYlD+qzljKncwyfC9IwI4PTA8QiDE6/Rnuq1DI5W40Lj59VevTs+xetHTmSCo5Sc
HzrZdX161gdAneI9E7SURAhKO0bkAfd2bWxlQ1neUKIxXj/ulXc7hEBLyR5h4pHwbMHftdiH9/p5
yzEu3b8Xvf72AHwBGowMyNHjXBf5j3+qBfPG46QgNdvu87Q/nQl5hH6O9u1a0frdtAGMx3ktKYei
XGnbePUuyPHkP8KdoXcj3vwDRIGtlNEJQYAAAAAASUVORK5CYII=





I saw that icons were encoded in Base64 much like with E-Mail attachments by looking at the dictcc.xml file so I wanted to include an icon for my qt3.xml search plug.

So I went to trolltechs website, downloaded their logo, opened it in kolourpaint and resize/scale’ed it down to 16×16. I then searched for a base64 encoder/decoder that could handle more then plain text, because opening an image file in a text editor to copy/paste is a pain in the neck. I consider this fair-use of the logo, if Trolltech doesn’t they can write me a search plugin ^_^.

I copy and pasted the encoded form of the icon into the file as you can see above and volia we have a search plugin muhauahauha ! Then saved the file, restarted flock, wrote “QLineEdit” in the search bar without qoutes and clicked the ‘Qt Toolkit’ entry and flock opened a new tab with the QLineEdit class documentation for Qt3.3 ;-).

In a few minutes I will make a Qt4 one and change the ShortNames accordingly. With a little attention to detail this means a search plugin can be created by most any user for most any website. In fact with a little work I could probably set it up so I could search the [SAS] or PC-BSD forums this way, either through the search functions ability to look for topics posted or by thread #’s to go straight to a thread (which would not be fun to have to search by!).

I wonder if with a little poking around at the Open Search and XML specifications if I could have the searchTerms passed on to a perl script to do a a few tricks and pass it back in… I should look at that option some day hehe.

I love it when people make it so you can plug into an application without having to compile crap !

Vs

Hmm, what a day.

Ironed out a few more things with my work in the SNCO Project.

Fire & Movement -> Submited
Rules of Engagment -> Submited
Breaching -> Fixing (post submited)
Stacking -> Converted (post submited)
Tactical Aids -> Working
Reloading Drill -> Submited + Tweaked & Resubmited
Equippment Loadouts -> Completed, not submited

Made changes to En4cers changes on basic training, submitted it back to him but no word yet. Maybe I should send it to Rouge since its technically supposed to go through the RSM then to GCHQ. No idea what En4cer is doing these days…. Feeling is mutal I’m sure.

Can’t really complete every thing on Room Clearing at the moment (En4cer) and I have little interest in the Planning & Leading one. Although that one might be able to stand as is hehe (y).

Spent most of the day on holiday after finishing some work on it. Joined Lazko & Ranger for some 2 on 1 on a super small map. Abiliterated them using the 40mm and mixing my kit around. Never really they knew what I was going to do, other then strike.

After wards joined Random/Lazko for a game, Random I soon found. Was much to seasoned a cat to fall prey to a Spider. Just as I was a bit to expirenced for Lazko & Ranger to have to much a head start. Since they were very fair and didn’t spawn rape much.

Eventually got into a baton war hehe. That blighters the fastest reloading weapon in the game I bet.

SSMTP/Getmail how-to part III

back to part II

The getmail documentation said that was the best way to automate it, and its bloody better then buling up getmail with ‘daemon mode’ code. But also like the documentation said if we want to ‘stop’ this daemon like mail checking we need a script for cron to run getmail through and program it to not run getmail if a file is pressent. Now we can do this many ways, heck we could set a enviroment variable if we want.

I’ve written a little script that can be run with a users cron jobs and skip over all mail or only the given account. You need one rcfile per account and you can tweak it to follow any conventions you want. My RCFiles follow the convention of getmailrc-shortaccountname, hence getmailrc-bell and getmailrc-sas for my bellsouth and sasclan accounts. This script should work on any system that has a bourneshell compatible /bin/sh. Just edit the shebang if you need to run it as another shell (such as /bin/ksh).

#!/bin/sh

# Use getmail to check my E-Mail account using the RC variable
# This script has the advantage that one can save it as another file, change
# one variable and set a cron job to check each account at different times (1
# cron job per script). Then not only use a file in their .getmail folder to
# stop all the scripts from running getmail or use a file to stop one script
# from checking its account. It also keeps a log which will be trimmed by
# another script

# Name of the getmailrc file to use
RC=getmailrc-sas

# log to a file when mail is checked
LOGFILE=${HOME}/.getmail/cronjobs.log

#
# If a nomail or nocheck file is found in ~/.getmail/ exit without checking
# else look for a no file. Where is equal to every thing that
# comes after the getmailrc- in $RC. If none of these files exsist check mail
# using the $RC file.
#
if [ -e ${HOME}/.getmail/nomail ]
then
LOG=$(echo "Skipping mail for $RC")
exit 1
elif [ -e ${HOME}/.getmail/nocheck ]
then
LOG=$(echo "Skipping mail for $RC")
exit 1
else
DIE=$(ls ${HOME}/.getmail| grep $RC | cut -d '-' -f 2)
if [ -e ${HOME}/.getmail/no${DIE} ]
then
LOG=$(echo "You have desided not to check this mailbox - $DIE")
else
LOG=$(echo `date` "checked mailbox with $RC")
getmail -r$RC
fi
fi

# Update log with the result
echo $LOG >> $LOGFILE 2> /dev/null

if you want to use the script copy and paste it into a text file and mark it executible. I saved them as ~/.getmail/check-.sh and chmod’d them 0700

Ok, let us make a cron job, because this is allready a big long post that took me forever to write with the way my house is. I’m not detailing cron(8) so please read the handbook or read the fine manual.

I created this crontab file to run my scripts to check my accounts every 5 and 4 hours respecfully and to ‘trim’ my log file every week.

# rstf's crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/usr/home/rstf/
MAILTO=""
#
#minute hour mday month wday who command
#
# check sas every 5hr
5 * * * * rstf ${HOME}/.getmail/check-sas.sh
#
# check bell every 4hr
4 * * * * rstf ${HOME}/.getmail/check-bell.sh
#
# trim log @weekly
0 0 * * 0 rstf ${HOME}/sh/trim-getmail-cronlog
#

The trim-getmail-cronlog script is thus

#!/bin/sh

# Rotate my logfile for running get mail via cron

LOGFILE=${HOME}/.getmail/cronjobs.log
TMPDIR=/tmp/

if [ -e $LOGFILE ]
then
tail $LOGFILE > $TMPDIR/gmlog.$$
rm $LOGFILE
mv $TMPDIR/gmlog.$$ $LOGFILE
else
exit 1
fi

To load my crontab file into crons system i.e. /var/run/tabs/${USER} all I have to do is run a simple command.

crontab ~/rstf-contrab

SSMTP/Getmail how-to part II

Back to Part I

It should’ve taken like two minutes to install or so. The getmail program is very nice and it follows the concept of do one ting and do it well + allows for a great level of modularity. We can use it with a number of protocols and other softwares like procmail, spamasassion, clamav e.t.c.

Setting up getmail is very easy and theres great documentation so far I’ve been very happy with it. Lets go to our home directory, we do *not* want to be the root user for this.

I’m gong to use a console because thats how i like it, so I’ll short how to do it via that way. If you want to use a GUI app like Konqueror to do it be my guest, you should be able to easy enough.

Make a directory your home directory called .getmail and set the permissions so that only you have access.

mkdir -m 0700 ~/.getmail That ammounts to the owner having read, write, and execute but no one else but the root user being able to enter the directory. Lets cd over to our ~/.getmail folder and create a rc file. By default getmail reads the ${HOME}/.getmail/getmailrc file but we can create multiple rc files and have getmail use the one we choose.

getmail -rRCFILENAME

if its not in our .getmail/ folder we need to supply the path to the rc file, if its in .getmail we can skip it.

The syntax of the file reminds me alot of .ini files on Win32, to be perfectly honest the getmailrc file syntax is the easist I've seen. Heres a copy of one of the RC files I use complete with anotations of what the ooptions do. After this I'll go into more detail about the options to help you get a owrking rc file.

[retriever]
# This file is getmailrc-sas which is for checking my @sasclan.org account
type = SimplePOP3SSLRetriever
server = mail.host.tld
username = my_emailaddr@sasclan.org
password = My_Password

[destination]

# This destination is just for my e-mail not the systems local mboxes.
type = Maildir
path = ~/Mail/
user = rstf
filemode = 0600

[options]
# Note that '0' means disable for all integar values.

# (int) 0-warn/err only, 1-retriv/delete only, 2-every thing
verbose = 1
# (bool) true = fetch all, false = only what getmail has not seen before
read_all = true
# (bool) true = delete messages after downloading, will override delete_after
delete = true
# (int) delete messages from server after int days
#delete_after = 1
# (int) max server reported message *total* size to download per session
max_bytes_per_session = 0
# (int) do not retreve messsages larger then this number of bytes
max_message_size = 0
# (int) max number of messages to process
max_messages_per_session = 0
# (bool) adds Delivered-To: header field to the message.
delivered_to = true
# (bool) add received: header field to the message
received = true
# (str) log to file
#message_log
# (bool) use system logger
message_log_syslog = false

as a reminder so I wouldn't have to check the documentation in /usr/local/share/doc/getmail/ or online. I put comment notes in the file briefing discribing what each option does and the type of setting, namely bool (i.e. true/false), int(eger) i.e. 0 1 or 435 e.t.c., or str(ing) likethis. Basically you need to have a [retriever] and a [destination] section. Under retriever we tell getmail what type of protocol to use, taken from the documentation heres the options.

  • SimplePOP3Retriever
    — for single-user POP3 mail accounts.
  • BrokenUIDLPOP3Retriever
    — for broken POP3 servers that do not support the
    UIDL
    command, or which do not uniquely identify messages; this provides basic
    support for single-user POP3 mail accounts on such servers.
  • SimpleIMAPRetriever
    — for single-user IMAP mail accounts.
  • SimplePOP3SSLRetriever
    — same as SimplePOP3Retriever, but uses SSL encryption.
  • BrokenUIDLPOP3SSLRetriever
    — same as BrokenUIDLPOP3Retriever, but uses SSL encryption.
  • SimpleIMAPSSLRetriever
    — same as SimpleIMAPRetriever, but uses SSL encryption.
  • MultidropPOP3Retriever
    — for domain mailbox (multidrop) POP3 mail accounts.
  • MultidropPOP3SSLRetriever
    — same as MultidropPOP3Retriever, but uses SSL encryption.
  • MultidropSDPSRetriever
    — for domain mailbox
    SDPS mail accounts,
    as provided by the UK ISP Demon.
  • MultidropIMAPRetriever
    — for domain mailbox (multidrop) IMAP mail accounts.
  • MultidropIMAPSSLRetriever
    — same as MultidropIMAPRetriever, but uses SSL encryption.

Odds are if you don't know what you need, its probably SimplePOP3Retriever. If you've ever set up a mail client before you should know it, your ISP or webhost should be able to tell you as well. Next we gotta tell getmail what server to fetch mail off of with the server option. If your ISP is some thing like charter, its probably mail.charter.net. I don't have charter but all the mail servers I've seen have been mail.ispname.topleveldomain lol.

We need to set the username and password so the server knows its us and which mailbox we want. Other wise it will tell us to go 'eff off.

Now we need to tell getmail what to do with our mail once it checks the incoming mail server. This is what the destination section is for. You basically have two big options here, Maildir or MBox. I've always used mboxrd since thats what Mozilla Mail&Newsgroups, Mozilla Thunderbird, and Seamonkey Mail&Newsgroups used. Plus the systems local mailboxes are mbox format as well. Theres various 'variations' of mbox and probably maildir but compatible enough for our needs I'd say. Other options for 'type' allow us to use an

External Message Delivery Agent (MDA) like procmail.
Mutilple Destinations, using multiple maildir/mbox/externMDAs e.t.c.
Mutiple message sorting
Sort mitple messages into geussed destinations
And to use qmail-local to deliver messages as instructed in the .qmail file.

The exact specifics and how to set getmail to use these features are in the manual, go read it if you want to know more. I suggest ether mbox or maildir personally.

Maildir is pretty simple there is a folder containing new, cur, and tmp directories full of e-mails. If you plan on checking e-mail often or automating it (as I do) this is probably for you. Each e-mail gets its own file in one of those directories which I personally think makes it better suited sharing messages but bad for FAT32 file systems (i.e. many small files).

We can make a mail directory like this on the command line, assuming we want ~/Mail. Or just make four directories in a GUI file manager.

mkdir -p ~/Mail/{new,cur,tmp}

You'll need to set the path to the mail directory as well to use Maildir. You can also set the user and file permissions to use. You've got to use the unix octal format, i.e. 0755 instead of u=rwx g=rx o=rw or some thing.

[destination]
type = Maildir
path = ~/Mail/
user = rstf
filemode = 0600

Setting filemode to 0600 means only I and the root user have read-write permission to my mail.

Now if we want to use mboxrd we have to specify the type and path to the mbox file as well. The user option works here too. Also you need to consider the locktype option. It takes a string argument and you have a choice of 'lockf' which uses fcntl locking or 'flock' default as of this writing (getmail v4.7.0) is lockf.

[destination]
type = Mboxrd
path = ~/Mail/inbox
user = rstf
locktype = lockf

We can also set up filter sections to use stuff like clamav & spam assasion on our e-mail. Considering that the odds of a virus or trojan that can invect a windows machine through being ssh'd into a freebsd box that is using mutt to view mail fetched with getmail from a server that filters spam (optional /w my ISP) and scans for viruses (nice ISP). I don't blood ythink I need to filiter things through an Anti-Virus ! But if you like go read the documentation on how to set that up.

I think I'll be looking into spam assasion for my ISP account though so maybe I'll have some thing topost there.

The options section I don't think is required but I'd suggest you set your read_all and ether delete or delete_after options.

My suggestions

[options]
# fetch all mail on the server
read_all = true
# then delete it after its in our Maidir or Mboxrd destination(s)
delete = true

[options]
# fetch mail getmail has not seen before
read_all = false
# then delete old messages after 1 day
delete_after = 1

The bottom option deletes the messages you download today from your mail server (not your destination) the next time getmail checks for mail and sees that the old messages are '1' day old. Any integer number will do but not a floating point number. i.e. 4675 will work but 2.43 will not.

I have two getmail rc files one for each account

$ ls -R ~/.getmail                                             20:21
getmailrc-bell
getmailrc-sas
oldmail-mail.host.tld-110-username
oldmail-mail.host.tld-995-username

So I can run getmail and tell it which file to use so Ican deside which mailbox to check. I've made a pair of shell aliases in my shells rc file to save typing.

alias gm-bell='getmail -rgetmailrc-bell'
alias gm-sas='getmail -rgetmailrc-sas'

Ok, lets run getmail (I'll skip the alias), it will take a few seconds bu t if it takes a really long time you might want to make sure your system is configured correctly to resolve the hostnames.

rstf@Vectra$ getmail -rgetmailrc-sas                                                       20:22
getmail version 4.7.0
Copyright (C) 1998-2006 Charles Cazabon. Licensed under the GNU GPL version 2.
SimplePOP3SSLRetriever:My_EmailAddr@sasclan.org@OurMailServer:
0 messages retrieved, 0 skipped

Looks like I have no new mail in the account.

Ok, lets try some automation we can set cron jobs to run getmail -rRCFILE when ever we want on one or all of our files.