»   »   »

Setting up a Minimalist FreeBSD Laptop

Prelude

This documents the setup of my writers machine, a laptop upon which the Great American Novel, or something remotely akin to it will (hopefully) be written.

The machine needed to be simple, and unable to do too many cool things which would provide distractions. As Jerry Pournelle once said: "...yes, it's all true. Many writers actually struggle with the act of writing and will grasp any excuse to do something else." (He does his writing in a room called the "Monk's Cell"). This is very true for me, probably any geek; I'd spend an hour writing a story, and three hours writing a script to reformat that story the way I like a manuscript to work, or browsing online to "research" something for a story. Sure, I could get a typewriter, or write by hand, but I'm a product of the late 20th Century, so that's not an option I'm comfortable with. I could also just use a regular pc and unplug it from the network, right? - Yes, but as long as there's something to mess with, I'll mess with it. If you can't overcome a weakness, then you should avoid it (you may notice that I didn't completely avoid distractions by adding a few "bells'n'whistles", but hopefully their sounds will be faint enough to be ignored).

Hardware

This document is generic enough to be used for most laptops. I run this setup on an old Dell Inspiron 3200, and an IBM ThinkPad T21 (I have documented some modifications for the Thinkpad here).

Operating System: FreeBSD

Why FreeBSD? - Well, to be honest, I tried installing several versions of Linux (including my favorite Slackware) on this laptop to no avail, they all had problems with the DVD drive at some time during the install, there are the occasional old machines that twart most operating systems, I guess this is one of them; I even couldn't install Windows 98 (not that I wanted to use it). So then I tried FreeBSD and it worked! - As it conformed to my criteria for the writers machine, I stuck with it, and have used it for subsequent writer's laptops. I've actually been a closet fan of FreeBSD anyway, so now I had an excuse to use it. As an addendum to this, since I've now been using it for a while, I can say that I really like using FreeBSD.

If you're new to FreeBSD, then I recommend this article as a primer, followed by a visit to FreeBSD.org.

Here's another bunch of good reasons to use FreeBSD.

Installation

The FreeBSD handbook gives very well detailed instructions as to the install, and is probably more up-to-date than this page, but I will detail what I did (for self documentation more than for instruction, even though I word this in an instructional format).

To download the CD ISO images (you only need the first for the minimal install, but if you have both, you can install many packages without having to go online to do them):

wget -b ftp://ftp.freebs86/ISO-IMAGES/6.0/6.0-RELEASE-i386-disc1.iso
wget -b ftp://ftp.freebs86/ISO-IMAGES/6.0/6.0-RELEASE-i386-disc2.iso
    

...and then burn them onto CDs.

Note: I chose the stable release; there are more recent releases, but FreeBSD is known for the stability of the releases they call "stable" so I chose not to be on the "bleeding edge" for my writers machine.

Then, put insert the CD and start/reboot the machine. The installation is fairly straightforward for anyone with Linux experience. Use the FreeBSD handbook if you need help.

Selected Standard installation

Once in the fdisk utility, I deleted all existing partitions, then selected A (Use Entire Disk) followed by Q to exit.

Selected Standard Boot Manager (as this is the only OS on my laptop).

Under the FreeBSD Disklabel Editor, I selected A (Auto Defaults) followed by Q to exit.

On the "Choose Distributions Screen", I selected A Minimal (The smallest configuration possible).

Once the minimal install was complete, I configured Ethernet with DHCP and no IPv6, then I accepted all the default options including adding Linux binary compatibility (this adds a package from the first disk).

I then browsed the FreeBSD package collection and added bash (coming from a Linux environment, I'm more comfortable with the bash shell), lynx (a text browser), and xorg (the X-Windows server).

I then used sysinstall to add a user, and I changed the Login shell to usr/local/bin/bash, and made the user a member of the "wheel" group, so that it will have su (superuser) access.

Lastly, I set the root password, and exited the install, which restarts the machine.

If you need to run the installer program again, run sysinstall; you can use this to add packages and modify your network and other settings easily too.

Adding Additional Packages

Now here's the coolest part of FreeBSD IMHO: the package management system. The Handbook covers this in detail, but for now, I'll just show the commands used to collect the packages I wanted from the internet and install them:

# my preferred writing tool is nano (a more advanced clone of pico, pine's editor)
pkg_add -r nano
# nano needs a decent spell-checker, so I use ispell
pkg_add -r ispell
# a simple, very fast windows-manager
pkg_add -r wmii
# if I want to research something, I prefer the firefox browser
pkg_add -r firefox
# and this one is for the occasional rtf (Rich Text Format) file I need to work with;
# Ted (capitilization required to run) is a neat little retro (rtf) Rich Text Format word processor
pkg_add -r ted
# and I wanted this one so I could view PDF format files (Ted can write to PDF BTW)
pkg_add -r xpdf
# For X-Windows, I like the configurability of this terminal
pkg_add -r rxvt
# as it's a laptop, I like to be able to see the battery status,
# from the command line, I use apm -l to check the status
pkg_add -r asapm
# always handy
pkg_add -r wget
    

rc.conf Modifications

The /etc/rc.conf file controls the core of additional applications and daemons, here is a summary of the modifications I made to this file:

# network settings
defaultrouter="192.168.1.1"
ifconfig_dc0="DHCP"
hostname="myhost.roqet.org"
# power management options that allow "power down" and "suspend"to work
apm_enable="YES"
apmd_enable="YES"
# terminal font modifications
font8x8="iso02-8x8"
allscreens_flags="80x43"
# if you want to enable remote ssh access
sshd_enable="YES"
# if linux binary compatability has been added
linux_enable="YES"
# enable a simple terminal screensaver (makes the screen to blank after a while of inactivity)
saver="blank"
blanktime="120" # the number is in seconds
    

Alternate network settings (if you don't want to use DHCP):

ifconfig_dc0="inet 192.168.1.77  netmask 255.255.255.0"
defaultrouter="192.168.1.1"
hostname="myhost.roqet.org"
    

Graphical Login

There are a couple of simple login managers if you're not using KDE or Gnome, for example, you could get SLiM (Simple Login Manager) - available in ports, or you could do it the manual way as I detail below...

I wanted a simple graphical login (one less command (startx) to type), so I did the following:

As root: pkg_add -r xv

Then modify /usr/X11R6/lib/X11/xdm/Xsetup_0:

#!/bin/sh
# $Xorg: Xsetup_0,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
# uncomment out the following if you want to see any error messages on start
# xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail
xsetroot -solid black
# the following can be any image
xv -root -quit /home/roqetman/freebsd6wp800x600.png
    

Then modify /usr/X11R6/lib/X11/xdm/Xresources:

#
# xdm simple theme
#

xlogin*greeting: MyHost Login
xlogin*namePrompt: Name:\040
xlogin*passwdPrompt: Password:\040
xlogin*fail: Failed!
xlogin.Login.greetFont: 9x15bold
xlogin.Login.promptFont: 6x13bold
xlogin.Login.font: 6x13
xlogin.Login.failFont: 6x13
xlogin*geometry: 220x140-0+0
xlogin*borderWidth: 1
xlogin*frameWidth: 0
xlogin*innerFramesWidth: 0
xlogin*shdColor: black
xlogin*hiColor: black
xlogin*greetColor: white
xlogin*failColor: red
xlogin*promptColor: grey75
xlogin*foreground: grey75
xlogin*background: black
xlogin*borderColor: grey50

# eof
    

As Root, modify /etc/ttys; find the following line, changing the off to on:

ttyv8  "/usr/X11R6/bin/xdm -nodaemon" xterm  on secure

Finally for each user set the window-manager that will launch after login:

echo "#!/bin/sh" > ~/.xsession
echo "/usr/X11R6/bin/wmii" >> ~/.xsession
chmod +x ~/.xsession
    

Then after you restart, you'll have a simple graphical login.

More Questions?

How Do I? : I have a bunch of FreeBSD questions and answers here.

On This document? : Contact me here.

Local Docs : /usr/share/docs; If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) man page.

FreeBSD's document on laptops : http://www.freebsd.org/doc/en_US.ISO8859-1/articles/laptop/article.html

FreeBSD Handbook : The handbook (available in multiple formats), and other documentation and support groups can be found at http://www.freebsd.org.

More on wmii : I've created a document here.

Need more applications : try here

Hypertext man (manual) pages : are here

© Roqet :: 2022-03-01 16:07:34