KB6GE: Linux and Amateur Radio

CentOS 6 iGate with aprx and soundmodem. Incomplete, March 2013.
I assume: You know APRS. You understand computers somewhat. You may have never used CentOS or Red Hat, but may have experience outside of Windows.
External Download Links
Things you type
Install CentOS
First we've got to install CentOS 6 on a machine. I happen to have an old 32-bit MacMini that I'll be using but there isn't much specific to that hardware here. I happened to have a Minimal image already burned to a CD that I used; if you're unfamiliar with installing CentOS, don't worry, the install is fairly simple. I'm using the onboard wired Ethernet interface with DHCP from my router.
Specific to that Mac, I had to remove the GPT partitioning from the disk to replace it with a legacy MBR. I booted the CentOS CD into rescue mode and typed this at the command prompt, identifying "sda" as the internal harddrive.
dmesg | grep sd
parted /dev/sda
Update the Operating System
Logging in at the console as root with the password from the installation, our first task is to bring the system up-to-date. I'll also increase the size of the command history so it can be reviewed in the future.
echo HISTFILESIZE=6000 >> /root/.bashrc
echo HISTSIZE=6000 >> /root/.bashrc
sed -i -e "s/HISTSIZE=1000/HISTSIZE=8000/g" /etc/profile
yum -y update && reboot
Fix email and generate a key
Computers generate nightly emails. We're going to create aliases so you can receive them... change the "devnull@localhost" below into your real email address, or leave it as-is to have the emails silently discarded.
ssh-keygen -t dsa && ssh-keygen -t rsa -b 4096
chfn root -f "root `hostname`"
echo "devnull: /dev/null" >> /etc/aliases
echo "root: devnull@localhost" >> /etc/aliases
Install Vendor-provided Software
I'm not concerned about disk space requirements, so I'll be making the Minimal installation a little more complete by installing groups of packages. Even though this machine will run headless without a monitor attached, it can be convenient to have a graphical environment. Nevermind the "soundmodemconfig" tool later will require the libraries provided here.
yum grouplist | more
yum -y groupinstall "X Window System" "Desktop" "Desktop Platform" "Fonts"
yum -y groupinstall "Development tools" "Internet Applications" "Console internet tools"
Maybe we missed some packages that will be useful later...
yum -y install minicom screen telnet nc nmap
yum -y rpm-build alsa-utils alsa-lib-devel alsa-lib libxml2-devel gtk2-devel audiofile-devel audiofile alsa-plugins-oss
yum -y hmaccalc zlib-devel binutils-devel elfutils-libelf-devel ncurses-devel perl-ExtUtils-Embed
yum -y install python-devel newt-devel elfutils-devel audit-libs-devel xmlto asciidoc
If you later see messages like "Package newt-devel required but missing" use the Search argument to yum, like so:
yum search "yum-plugin"
Enable auto-updates
Computer security matters. We're going to enable an option that allows yum to check for updates when the computer turns on.
yum -y yum-updateonboot
sed -i -e 's/#REBOOT_RPMS="kernel/REBOOT_RPMS="kernel kernel-ml/g' /etc/sysconfig/yum-updateonboot
/sbin/chkconfig yum-updateonboot on
Create the RPM build environment
RPM, the Redhat Package Manager, is a format akin to Zip used to keep track of where software is installed. We'll use it in the next few steps so let's prepare this machine.
yum -y install rpm-build
mkdir -p /usr/src/redhat/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %/usr/src/redhat' > ~/.rpmmacros
Install a kernel with AX.25 support
I dislike deviating from vendor-supplied software but we need the AX.25 support that Red Hat doesn't supply.
Here's how to enable an extra repository and let them handle future kernel updates:
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel
yum -y install kernel-ml
Afterwards, edit the grub.conf to make sure the v3 kernel is preferred over the v2.6 kernel and reboot. The "title" lines are numbered beginng with zero. Find the line beginning with "default=" and make sure it's not set to 1 or 2 but instead prefers the initial kernel option.
vi /boot/grub/grub.conf
#[line 10]
For the sake of being a nerd, here's how you'd run that manually without enabling their support:
cd /usr/src/redhat
wget http://elrepo.org/linux/kernel/el6/SRPMS/kernel-ml-3.8.3-1.el6.elrepo.nosrc.rpm
rpm -Uvh kernel-ml-3.8.3-1.el6.elrepo.nosrc.rpm
cd /usr/src/redhat/SOURCES
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.8.3.tar.xz
cd /usr/src/redhat/SPECS
time rpmbuild -ba kernel-ml-3.8.spec
rpm -Uvh /root/rpmbuild/RPMS/i686/kernel-ml-3.8.3-1.el6.i686.rpm
rpm -Uvh /root/rpmbuild/RPMS/i686/kernel-ml-devel-3.8.3-1.el6.i686.rpm
Test Out The Soundcard
Let's make sure our soundcard works. First we'll set the input and output levels to about fifty-percent, play some noise out of the speakers, and then play out the speakers whatever we hear on the line-in port.
rpm -e alsa-plugins-pulseaudio
alsamixer -V all
alsactl store
speaker-test -c 2
arecord | aplay
AX25 Tools
Body Serif
Code Yellow
Build a custom RPM for soundmodem
Now we're going to install Thomas Sailer's soundmodem software to act as a TNC.
cd /usr/src/redhat/SOURCES
wget http://www.baycom.org/~tom/ham/soundmodem/soundmodem-0.18.tar.gz
cd /usr/src/redhat/SPECS
tar xvfz ../SOURCES/soundmodem-0.18.tar.gz soundmodem-0.18/soundmodem.spec
mv soundmodem-0.18/soundmodem.spec soundmodem.spec && rmdir soundmodem-0.18
The spec file needs its version number updated and we need to tell it about an extra directory to package.
vi soundmodem.spec
#[line 2]
%define ver 0.18
#[line 48]
Body Serif
Code Green
Code Yellow
Useful Links
APRS SSIDs in 2012
Thomas Sailer's Multiplatform Soundcard Packet Radio Modem
pa0esh Raspberry Pi APRS
Sivan Toledo writes about software modems
Hampacketizing Centos by K16ZHD
Xastir soundmodem wiki
Forum comments on hardware digipeating
WhereAVR APRS tracker by Gary Dion
Notes from Bob Brose
WX3in1 from Microsat
Digipeater filter ruleset
another filter guide
status pages for aprs2 on 14501
headless mac mini with resistor
aprs in aviation
Solar Powered APRS Weather
The end.
Copyright © 2013 Patrick Tudor