BSD Forever

Well, my Darling Dixie is now running FreeBSD 7.0-Release 🙂

I finished last minute backups of files and off loaded them to Vecta, just in case hehe. Unlocked my wireless network and installed from the three CDs I have for FreeBSD 7.0-Release. Since I don’t use the CD sets to install more extras then X.Org, I only needed disk one as usual.

I almost always use a custom installation of FreeBSD because I find it more expedient and very concise. Used sysinstall to finish the last bit of configuration before the first boot: nfs client on, sshd on, dhcp on ath0, set root password.

With the first boot I mounted my backups over NFS, copied the over and unpacked for reference — rc.conf, rc.conf.local, xorg.conf, and wpa_supplicant.conf. I also setup my users and groups via pw and edited loader.conf to load my sound driver.

Merged changes as desired into rc.conf and an xorg.conf file generated via X -configure. Then copied over a small script I had made to automate installing most software I use and started a review of it while running porsnap on anohtr vtty.

While the script ran, I poked around /usr/src with vi to pass the time. All went well until I started getting funky errors from pkg_add. Killing the script, I checked with df and sure enough, / was showing at 107% of capacity! Now that all is said and done, it seems I miscalculated about 600MB of dependencies lol.

mv /root/pkgs /usr/pkgs
sh
for JUNK in `du -ch /usr/pkgs/* | grep 0B | awk '{ print $2 }'`; do rm $JUNK; done

problem solved. I also found out the hard way that the csh is a pain in the ass, hence starting a new shell to handle the removal of empty packages. Used the scroll lock to check the terminals backlog for the last successful package add and modified my script to pick up where it left off.

/usr/pkgs is 834M of packages — just in case I need to reinstall, I won’t have to download them from my $PACKAGEROOT again, I can just bring them over from Vectra and save bandwidth for both my favorite mirror and myself.

I also had a bit of a problem with some port installations failing with strange pkg-descr missing messages, found out today while wrapping up that it was referecin $PKGDIR => /usr/pkgs :.

my packing list so far:

#!/bin/sh

cd /where/ever

# environment / compat
PKGDIR="`pwd`/pkgs"; export PKGDIR
GCC_VER="42"
PHP_VER="5"
MYSQL_VER="50"
pkg_add -Kr compat6x-i386

# languages
pkg_add -Kr javavmwrapper
# manual install needed for JDK/JRE
(cd $PKGDIR; pkg_add diablo-jdk-freebsd6.i386.1.5.0.07.01.tbz)
(cd $PKGDIR; pkg_add diablo-jre-freebsd6.i386.1.5.0.07.01.tbz)
pkg_add -Kr gcc${GCC_VER}
pkg_add -Kr perl
pkg_add -Kr python
pkg_add -Kr php${PHP_VER}
pkg_add -Kr ruby
pkg_add -Kr rubygem-rtags && pkg_add -r rubygem-rake
pkg_add -Kr guile
pkg_add -Kr scheme48

# libraries
pkg_add -Kr qt4
pkg_add -Kr gtk-2
pkg_add -Kr p5-DBI
pkg_add -Kr p5-DBD-mysql${MYSQL_VER}
pkg_add -Kr p5-DBI-SQLite
pkg_add -Kr p5-DBI-CSV
pkg_add -Kr p5-Digest


# development tools
pkg_add -Kr gmake
pkg_add -Kr ctags
pkg_add -Kr cscope && pkg_add -Kr kscope
pkg_add -Kr webcpp
pkg_add -Kr subversion

# games
pkg_add -Kr kdegames
pkg_add -Kr xgalaga
pkg_add -Kr prboom
pkg_add -Kr doom-data
pkg_add -Kr wesnoth
pkg_add -Kr supertux
pkg_add -Kr chromium

# graphics software
pkg_add -Kr gimp && pkg_add -Kr gimp-gap
pkg_add -Kr inkscape
pkg_add -Kr xv
pkg_add -Kr kdegraphics
pkg_add -Kr dia

# browsers
pkg_add -Kr linux-flock
pkg_add -Kr lynx

# e-mail and news
pkg_add -Kr thunderbird && pkg_add -Kr thunderbird-i18n
pkg_add -Kr mutt

# kontact and related
pkg_add -Kr kdepim


# chat
pkg_add -Kr konversation
pkg_add -Kr pidgin && pkg_add -Kr pidgin-hotkeys
pkg_add -Kr pidgin-guifications && pkg_add -Kr pidgin-libnotify
pkg_add -Kr pidgin-otr && pkg_add -Kr pidgin-encryption
pkg_add -Kr teamspeak_client

# install vim / emacs
pkg_add -Kr emacs || pkg_add -Kr xemacs
pkg_add -Kr mg
(bunzip vim-7.1.tar.bz2; tar -C /tmp -xf vim-7.1.tar; cd /tmp/vim71/src;
./configure
--enable-perlinterp --enable-pythoninterp --enable-rubyinterp
--with-x --enable-cscope --enable-fontset --enable-gnome-check
--with-features=huge --enable-gui=gtk2 && gmake && gmake install)

# multimedia
pkg_add -Kr nspluginwrapper
pkg_add -Kr libdvdread
pkg_add -Kr libdvdplay
pkg_add -Kr libdvdnav
pkg_add -Kr cdrtools
pkg_add -Kr mplayer
pkg_add -Kr linux-mplayerplug-in
pkg_add -Kr xmms && pkg_add -Kr xmms-pipe && pkg_add -Kr xmms-skins
pkg_add -Kr k3b
# this is an rpm
(cd /usr/ports/multimedia/linux-realplayer && make install clean distclean)

# documents
pkg_add -Kr gnumeric && pkg_add -Kr abiword
pkg_add -Kr koffice

# personal
pkg_add -Kr zsh
pkg_add -Kr rxvt-unicode
pkg_add -Kr terminus-font
pkg_add -Kr windowmaker
pkg_add -Kr blackbox
pkg_add -Kr bbkeys && pkg_add -r bbrun && pkg_add -r bbpager
pkg_add -Kr docker
pkg_add -Kr hsetroot
pkg_add -Kr fastest_cvsup
pkg_add -Kr psearch

# misc
pkg_add -Kr bsdstats
pkg_add -Kr amarok
pkg_add -Kr lzma
pkg_add -Kr unrar
pkg_add -Kr zip
pkg_add -Kr e2fsprogs
pkg_add -Kr pdksh
pkg_add -Kr sudo
pkg_add -Kr v7sh
pkg_add -Kr xcb

I had to install the ports manually because of the $PKGDIR thing, did that this afternoon. Which amounted to multimedia/libdvdcss, x11-wm/fvwm-devel, sysutils/gkrellm2, and just for the heck of it, www/linux-flashplugin9 and www/flashplugin-mozilla hehe. I also had the JDK and JRE packages in cold storage from my last installation, so no need for manual fetching them.

Some last minute additions were gdm and trayer — I actually like Gnomes Display Manager. I still need to compile mencoder, maybe install a few Perl/Python/Ruby binndings for good measure, etc but I’m basically done.

One thing that shocked me, The flash plugin v9 is working !!! I installed it just to see if the thing would crash my webbrowser but it works :

I need to get pf, sshd, and my kernel configuration setup and probably play with freebsd-update (I’ve never used it) but I’m essentially ready to rock and roll, it only took about 4 hours, because I downloaded all of the packages I wanted.

Compared to reinstalling Windows XP? Hahahahhahahahah !!!!

If I ever reformated my XP machine, it would take 3 hours to install XP from the vendors disks, 2 weeks to download all of the hotfixes, updates, and patches and crap, reinstall my firewall and ruleset from backup, then systematically install all of my games, programs, and such by manually visiting each website or inserting each disk — then spend time re-shoehorning XP into something livable with all of the little setting tweaks here and there.

FreeBSD, back online in a flash — hehe.

Wireless networking options

I’m contemplating *trying* to move my desktop PC to my room… Which means access to the ‘net will only by available via wireless. The computer doens’t have a wirfi card, just ethernet so that means shopping is involved.

It primarily runs Windows XP for gaming and has space reserved for testing GNU/Linux distros and BSD systems. Being a BSD-aware and manual reading shopper, I always crack open my operating systems manuals and look at what cards are supported by the drivers when I go looking for a product.

Since the only principal markets available to me off the web are Best Buy and Office Depot, those are where I looked online first.

The cards:

NETGEAR – 802.11g PCI Card Model: WG311

Pro’s:
Supported by ath drivers.

Same brand and chipset as my PCMCIA card (WG511T)

Con’s:

Old (or cheap) product, only supports WEP (which I don’t use)

Newer revisions may not be totally compatible with existing drivers (I suspect).

Belkin – Wireless-G USB 2.0 Network Adapter, Model: F5D7050

Pro’s:

Version 3 is supported by the rum driver and v2000 by the ral driver.

Con’s:

Reviews suggest bad gaming performance due to burst based transmissions

The rum driver is new to FreeBSD 7.0-Release (ported from OpenBSD)

GOD only knows what revision/version you might find at the store…

Hawking Technology – Wireless-G USB 2.0 Network Adapter,
Model: HWUG1 at best buy and at OfficeDepot

Pro’s:
Supported by the rum

Removable aerial and possibly good signal strength if you don’t have problems with it.

Con’s:

The rum driver is new to FreeBSD 7.0-Release (ported from OpenBSD)

May be hard to find (lesser known brand, at least from what I’ve seen of consumer (non enterprise) products).

Just look at Hawking Technologies website… (ugh)

Linksys Wireless-G 802.11g PCI Adapter, Model WMP54G at Office Depot and Best Buy

Pro’s:

Supported by the ral driver.

It’s cheap

It’s available while it is still on the market

It’s the same brand as my router (which is _not_ a plus in my book…)

Con’s:

More stores are carrying similar but newer models for Wireless-N and variants of the both (802.11g and 802.11g/n) proprietary speed boosting technology, which of course is unsupported.

It’s the same brand as my router (which I don’t care much for!)

MISC:

Driver support on OpenBSD and FreeBSD at release levels…

ath == OpenBSD 3.7, FreeBSD 5.2, NetBSD 2.0 (more recent modules don’t use a binary blob, at least the OpenBSD drivers that is (-;)

ral == OpenBSD 3.7, FreeBSD 6.0 and may require PCI 2.2 compatible mother boards.

rum == OpenBSD 4.0, FreeBSD 7.0

ural == OpenBSD 3.7, FreeBSD 6.0 and may have issues with communicating transmission speed (OBSD manual is more specific).

All of this is posted for my own reference and anyone else who may find use for it.

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

I never thought we’d be friends — Me & FVWM

Well, I have been looking for a suitable replacement for KDE3 of late on my laptop — tried enlightenment and chucked it. Nice desktop, very elegant feeling but just not my bag :|. Kicked through and finished working with FVWM, I chose to install the unstable 2.5.x build in port.

Normally I’ll only use stable releases unless I’m testing or in need of a ‘sneak peak’ but this time I opted in. I figure, it should be fairly stable with how long FVWM has been around. The original code base of FVWM 1.x was born in 1993 making it about as old as FreeBSD lol. FVWM 2.5 has newer features and I don’t mind a few quirks really, as long as my session doesn’t die or the entire system lock up.

Free Image Hosting at www.ImageShack.us

So far FVWM is really proving it’s possible to have a desktop *your way* without having to kill someone in the process !

I’ve always thought that if I’m ever going to find a window manager I truly love; I probably would have to write my own. I like programs that are powerful, configurable, and extensible — that’s one of the reasons I use Vim in the first place >_>

I have my pager and a useful means of employing my laptops limited screen space. The way The Flibin’ Virtual Window Manager as I call it, handles virtual desktops is actually quite nice. The M by N thing and configuration options have given me a very nice arrangement for working with many programs. Especially in my case, since I need to work with windows that are some times larger then my screen resolution!

Rather then resize the program (scroll bars, ugh) or rescale it as the situation may offer. I can just scroll my screen between the pages and vola! The illusion that the desktop is much bigger then it really is, really fits with the way I use programs.

I installed x11/trayer to get myself a (transparent) system tray, I actually like how FVWM handles iconifing windows but for some apps a system tray is helpful (pidgin). Notice that I do not have a taskbar, desktop icons, or a ‘panel’ — don’t need them nore want them most times.

I like to keep my workspace very thin, it’s for running programs not holding up bells and whistles everywhere. I fI wanted to look at bells and whistles (or unhide them when going to the screen border) I’d run them outright. And covering or autohiding the panel (KDE, Gnome, Windows) is a poor solution for my habits +S.

I have my FVWM configuration launching a program to auto-rotate my wall paper, need to properly daemonize it someday soon. I’m considering giving the X Session Manager (xsm) a whirl as well, worth a try judging by the manual page. I still have some more work to do but so far, I like how it has come out in such a short time.

Why didn’t I ever try the F* Virtual Window Manager before? lol.

Who builds these things !?

Well, I finally had it with the sound popping in/out so I decided to crack open my case, yank and reinsert the card. Sure enough it was loose.

I blew the dust off the Audigy 4’s board and set it aside when I noticed the air-duct like thing sucking air in and across the mother board was dusty.

I finally removed the masking tape that whoever assembled the bloody thing used to keep the line going from the PSU to the SATA drive used to glue the cable between the duct and the CPU’s heat sink (_don’t_ ask). I pulled off the ducting and looked at the fan blades, never been dusted.

Tried to unplug the fan so I could set it aside for cleaning but it proved, shall we say less then worth it. Blew out as much dust as I could from the venting and the CPU’s heatsink. Which on the air-ward side was starting to look like cobwebs :

The fan is mounted in the duct which is ‘hung’ on the side of the case… If it wasn’t for the handle to pull it out, it would fall out if I put the case on it’s port side. If the thing didn’t get seated properly, it would be resting ontop of the hard drive mounting.. Honestly I don’t know what people are thinking these days.

Still had more dust in the air-vents for the fan and I couldn’t see to hang the duct right. So I noticed these few clips sticking out of the front-side. Pushed the in and pulled off the front plastic panel (‘face’) of the computer case.

Holy guacamole !!!!

It was so bad I fetched a face mask to keep the dust away from my nose and mouth, to bad I didn’t have a pair of goggles to boot. Cleaned the entire computer throughly and hung the fan/duct. Using the air-vents to line up the placement. And then put the panel back on. I thought about popping the bezel setting with the card reader and inserting an old floppy drive because the case design would keep the dust from seeping inside.. But to insert the FDD I would have to remove my PSU and the CPU’s heatsink which is not really worth bothering with lol. Managed to get the case put back together and wiped off the monitor, keyboard, and rat for good measure (y).

Computer cases are fairly simple but I’ll never understand some of the things I’ve seen in pre-built computers… Who the hell puts tape less then half an inch over a heat sink which is there to help cool a really hot CPU, and it is like the BFG 9000 of heat sinks compared to Vectra’s Katmai P3 500 lol.

Really I think if I ever had the opportunity to build my own case, I would do it. With the right tools and materials one could actually pull it off, might not look sexy but it sure as heck can’t be any worse then the this Gateways case !!

Hmm, one of these days I really need to clean out the keyboard of my laptop but I’m not really interested in taking it apart right now. I wonder why, stripping down a computer always gives me strange ideas >_>

Norton to the rescue? Wow it actually did something useful

Hmm, for the first time in my life I’m actually glad that my Mom runs Norton on her PC.

She got an e-mail from the bank warning about repeating login failures on the account and that it was going to be suspended for T time unless she updated the account. I think that would have my heads anti-fraud warning bell ringing on it’s own right but hey, I’m paranoid at heart >_>

The message had a dead give away (for me) that someone might be trying to fake it, you probably would have to be familiar with building such things or just a heavy web surfer to spot that one though. When she clicked it it redirected her to a fake page to login which Norton shouted FRAUD before harm could be done.

The address was an obvious fake once you see the real URL, but how many causal users even look at that I wonder? So maybe despite it’s annoyance to people like me and those that just want to get stuff done, useful for watching over the uneducated.

She’s currently going through a spell of FUD over security but I’m familiar enough with the possibilities and they ain’t that bad thanks to Norton. The next best thing to actually educating users — babysit with resource hogs :

Now if only it could do something about her (greater then mine) paranoia, so I could get back to rewriting code lol.

Oh wells.

Them are fightin’ results.

Someone asked me about my connection today so I ran a speed test. The results were a horrendous 200~220Kbps down/310~320Kbps up — which is ridicules for an ADSL line, that is Asymmetric Digital Subscriber Line which generally means (and in the past extremely so! with my ISP) much higher download rates then upload rates.

After closing all other internet aware applications (Pidgin, XFire, WMP plugin) and closing the several webpage tabs (GMail, Forums) I waited several minutes and reran the speed test:

200Kbps downstream, 300Kbps upstream aDSL test result

This is crap, especially when you consider that for the strictly internet connection their going rate in this area is supposed to be $45/mo for more download then that and the upload rate compares to there top speed $65/mo service.

I pulled the plug on the modem and gave it half a minute before plugging the power back in. Ran a ping on the ISP’s mail server to check when it came back online then ran another speed test. I usually ping google but I hate why use a decent services bandwidth when I can hit the mail.MyISP.net instead?

1400Kbps downstream, 320Kbps upstream aDSL test result

The results are now much better but still less then what they are supposed according to the ‘minimal acceptable’ download and upload rates they should be being paid to deliver. Going to have to have Ma float through the statement and look up exactly what we are paying for because this sure ain’t it.

I also nearly died laughing when poking around there website and noting that part of there help-system and there ‘connection optimizer’ are Internet Explorer specific although the same website says that this ISP officially supports Windows NT, Mac OSX, IE5.5+, FF2+, Safari, and Netscape Communicator 4.x + which is an old dinosaur !!!

I don’t know what is worse, an ISP that can’t keep a stable connection (for the past several years), an ISP that can’t even keep there standards straight, or an ISP that collects higher bills then quality services rendered.

Why do I have a strange urge to lubricate my modem?

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

Fixing last nights screwups

Well this is what happens when your working around 0400 local time :

After last nights double upgrades my system wouldn’t except my login over ssh citing an invalid password (when it was correct!). Plus it was refus8ing connections on the port I have sshd listing to but accepting on the default port 22, even though I merged my sshd_config with the new one.

Hooked up a monitor and keyboard to the server and even root was being rejected. I know I forgot to run /dev/MAKEDEV before rebooting the kernel but if that had any problems either init, rc, or getty would be dying from problems setting up TTYs and mounting disks!

Booted off the install floppy I had left over from the 4.0 upgrade and dropped to shell. Since I had to did a rude shutdown when I realized what was up, I had to force the mounts before I could go to work. Then I change rooted into the servers file system to get to fixing the login problem.

mount -f /dev/wd0a /mnt
mount -f /dev/wd0g /mnt/usr
chroot -u root /mnt sh

I knew I forgot to make the new device nodes so I did that and took a look at /etc/group and /etc/passwd before touching any thing else.

/dev/MAKEDEV all
TERM=vt220 vi /etc/group
...

I had to set TERM for nvi because with an empty $TERM after the chroot operation, vi couldn’t handle the situation :

checked out the group file and noted my custom user groups were missing, changed files :e /etc/passwd and noted that my user account was also missing!

Made a fix of this:

group add -g 7778 nfsusers
adduser
...

Added the nfsusers group for the file shares and recreated my personal user before mounting /home. That gave me enough that I could reboot, strip monitor and keyboard, and SSH into it from the desktop to finish poking around.

On login my shell prompt was ‘Terry@noname-$ ‘ and I know my ksh prompts are ‘username@hostname-$ ‘ which means my systems hostname settings were nuked.

Lo and behold, it hit my like a bus.

During last nights upgrade I remembered specifically that I did remove etc42.tgz in /usr/obj/4.2 before using a for loop to extract all of the file sets. But I could not remember doing the same with etc43.tgz in /usr/obj/4.3 when I installed the last file sets :

Sure enough I looked in both directories and last nights log and bingo that is what happened! I ended up extracting the default configuration files for OpenBSD 4.3 after my upgrade.

I didn’t take a backup of /etc before hand because I knew it wouldn’t be harmed, assuming I didn’t fsck things up. And of course any thing irreplaceable is backed up in like 4 or 5 places any way.

It looks like the only major losses in /etc were exports which I rewrote simply. I copied the %ProgramFiles%etcgroup file to the server as /etc/group.old and used vimdiff to merge my other custom groups in before moving on.

rc.local was overwritten but that’s no loss because everything I had in there was commented out and there depends got pkg_delete’d last night 😉

I repaired /etc/hosts, checking my changes against the hosts file on my desktop, (%WinDir%system32driversetchosts). Each of my machines defines a couple of ‘quick’ items in hosts. Then fixed /etc/myname with my machines proper name.

the settings in /etc/ntpd.conf were overwritten but unused for ages, the patch operations also left me my original file as /etc/ntpd.conf.orig hehe and I cleaned the rest out

cp /etc/ntpd.conf.orig /etc/ntpd.conf.ORIG
rm /etc/*.orig

Then set to fixing ssh_config and sshd_config

cd /etc/ssh && vim .

This really is what I get for doing things so late at night +S

Upgrading OpenBSD — so darn easy!

Tonight I finally got around to upgrading my OpenBSD machine, Vectra functions as my file server among other things hehe. The 4.2 upgrade screwed around with the expat library making it depend on xbase42.tgz which is the X Windows System, normally not needed unless one is running a graphical desktop environment.

The system runs headless with no monitor, keyboard, or mouse and functions as a file server. So I have no need what so ever to run a GUI, using a command prompt over SSH is actually my preferred way of working on the box any way. because it means I don’t need a monitor, keyboard, or mouse to work on Vectra and because SSH is not as heavy on the network as using VNC/X Forwarding and crap. Now that 4.3 was released May 1st and fixed the libexpat thing I can update

I took the machine from OpenBSD 4.1 to 4.2 to 4.3. I could probably have saved time by not dealing with any of the *42.tgz files besides etc42.tgz but I did it any way. I’ve also learned the hardway to back up /root first hehe (see end of post notes). OpenBSD is one of the most easy to install, upgrade, use, and maintain operating systems I have ever used.

Here is my general log of things, and yes I do use the shells command grouping and flow-control constructs when I feel like it :-P. Most of the configuration file changes in 4.2/4.3 were never modified by me so I could install most of them over the old ones

EDIT:, be sure to remove BOTH etc*.tgz before using any the for loops to install files!!! or end up in my sleepy boat. Updating the files in /dev before rebooting is also not a bad idea.

su – root
Password:
cd /usr/obj
mkdir {4.2,4.3} && cd 4.2
cat ~/.profile          # look up my mirrors address
ftp ftp.usa.openbsd.org
        …             # login as anonymous
ftp> cd /pub/OpenBSD/4.2/i386
        …             # fetch files for OpenBSD 4.2
ftp> get base42.tgz
        …
ftp> get etc42.tgz
        …
ftp> get comp42.tgz
        …
ftp> get misc42.tgz
        …
ftp> get man42.tgz
        …
ftp> get games42.tgz
        …
ftp> lcd ../4.3
        …     # change directories
ftp> cd /pub/OpenBSD/4.3/i386
        …             # fetch files for OpenBSD 4.3
ftp> get bsd
        …
ftp> get bsd.rd
        …
ftp> get base43.tgz
        …
ftp> get etc43.tgz
        …
ftp> get comp43.tgz
        …
ftp> get misc43.tgz
        …
ftp> get man43.tgz
        …
ftp> get games43.tgz
        …
ftp> close
221 Goodbye.
ftp> bye        # return to my shell, pwd := /usr/obj/4.2
ftp>  http://openbsd.org/faq/upgrade42.patch      # fetch patch file for /etc
tar -xzphf etc42.tgz
cd etc          # pwd := /usr/obj/4.2/etc
# install the etc42 files as directed by the upgrade notes
cp magic man.conf netstart rc rc.conf rpc services /etc
cp mtree/* /etc/mtree/
cp mail/helpfile mail/localhost.cf mail/submit.cf /etc/mail
cp mail/sendmail.cf /etc/mail
cp etc/bgpd.conf /etc/                                                      
cp etc/mail/spamd.conf /etc/mail/                                            
cp etc/ospfd.conf /etc/                                                      
# test the patch
cd ..           # pwd:= /usr/obj/4.2 again
(cd /; patch -C -p0) < ./upgrade42.patch        # test patch
(cd /; patch -p0) < ./upgrade42.patch           # apply patch
        …    
# my /etc/ntpd.conf is customized and fails to patch clean
# remove the left over notes, _AFTER_ reviewing them !
(cd /etc; for i in `ls /etc/|grep rej`; do rm $i; done)
vimdiff etc/ssh/sshd_config /etc/ssh/sshd_config
        …    
# manually merge the new sshd_config with mine
                # this puts both files in a verticle split, new on the left,
                # old on the right. Merge changes in with the :diffput command
cd ../4.3              
# pwd := /usr/obj/4.3
ftp>  http://openbsd.org/faq/upgrade43.patch      # fetch patch file for /etc
# install the etc43 files as directed by the upgrade notes
tar -xzphf etc43.tgz
cp moduli netstart ospf6d.conf rc rc.conf relayd.conf security snmpd.conf /etc
cp mtree/* /etc/mtree/
cp mail/README /etc/mail
cp ../var/named/etc/root.hint /var/named/etc
cp etc/ttys /etc/ttys                                                        
(cd /; patch -C -p0) < ./upgrade43.patch        # test patch
(cd /; patch -p0) < ./upgrade43.patch           # apply patch
        …
# remove the left over notes, _AFTER_ reviewing them !
(cd /etc; for i in `ls /etc/|grep rej`; do rm $i; done)
# remove uneeded files, as directed in 4.3 upgrade
notes

rm /etc/hoststated.conf /var/named/standard/root.hint
# add the new users and groups in 4.3:
useradd -u90 -g=uid -c"OSPF6 Daemon" -d/var/empty -s/sbin/nologin _ospf6d
useradd -u91 -g=uid -c"SNMP Daemon" -d/var/empty -s/sbin/nologin _snmpd
newaliases      
        …    
# update mail aliases
mtree -qdef /etc/mtree/4.4BSD.dist -p / -u                                  
        …    
# create new directories as needed
# change permissions as instructed by the 4.3 upgrade notes
chown root:operator /etc/chio.conf                                          
chmod 644 /etc/chio.conf                                                    
# install the new kernel as directed, pwd := /usr/obj/4.3
ln /bsd /bsd.41                                                              
cp bsd /bsd.41
mv /bsd.41 /bsd                                                              
shutdown -r now         # reboot into the new kernel so we can begin
extracting

                        # upgrade files safely.
# wait for the machine to come back up, and ssh back to it
ping vectra
ssh2v                   # an alias that expands to ssh’ing me into vectra
        …
su – root
Password:
# install all of the 4.2 upgrade files
(cd /usr/obj/4.2/; for ark in `ls | grep .tgz`; do tar -C / -xzphf $ark; done
# install all of the 4.3 upgrade files
(cd /usr/obj/4.3/; for ark in `ls | grep .tgz`; do tar -C / -xzphf $ark; done

Since there are a lot of printing related packages from back when I screwed with setting up a Lexmark WinJet with cups awhile back and the Samba system which is no longer used… Since oddly integrating Windows and BSD clients forced me into NFS shares : I’ve opted to delete all of the packages installed on the server and reinstall the only ones I actually give a flying rats rear end about

pkg_delete -cxi -F dependencies /var/db/pkg/*
pkg_add -vi bzip2 lzma

Sadly it seems that /root/profile for some odd reason was overwritten by one of the upgrade files, which really sucks… Because I didn’t stop to think — the tarballs for upgrade are the same as a fresh install which has to create roots default home directory!!!

I had set up roots ~/.profile to set PKG_PATH dynamically based on the current architecture and release level. So I redirected the output of ‘set’ to a file to retain the values and rewrote my file by hand and changed ~/.profile to source a separate ~/.kshrc before rebooting the system

set > /tmp/root.profile
vim -o ~/.profile -o ~/.kshrc
shutdown -r now