Contents
- Introduction
- Resources
- Getting and Unpacking Voyage Linux
- Installing Voyage Linux
- Customizing Voyage Linux
Introduction
Part 2 of this tutorial walks us through installing Voyage Linux 8.0 on a CF card that will eventually be installed in a Soekris 4501 Single Board Computer. I had a couple of 256MB cards lying around, but they are just borderline big enough for what we want to do. It’s probably better to go with at least a 1GB card (if you can get one) or larger.
This tutorial assumes that you’ve got the Voyage Linux SDK installed on a virtual machine, and that it’s set up to allow NFS access to a shared directory.
We also assume that you have access to a CF card reader. I like the Vantek NexStar Universal Storage Adapter. It lets me connect 3.5 or 2.5 inch IDE drives, SATA drives, and lots of different card formats to my PC through USB. You may need to capture your card reader device to the VM using the Devices->USB Devices menu and choose the appropriate device.
Resources
- The main Voyage Linux website, there’s a link to download the latest Voyage Linux files. We’ll be needing that later.
- The Voyage Linux Getting Started guide. This is different than the LiveCD guide!
- The main Voyage Linux 8.0 tarball.
- The Soekris website. great products for setting up reliable, energy efficient servers for home and professional use.
- A summary of the Soekris BIOS settings
Getting and Unpacking Voyage Linux
These instructions assume you are running your Voyage Linux SDK set up as described here. This step happens on the VM, not the Soekris box.
First, you’ll need to get the latest tarball of Voyage Linux files to your SDK VM, like this:
|
1 2 3 |
mkdir -p ~/voyageLinux cd ~/voyageLinux wget http://www.voyage.hk/download/voyage/voyage-0.8.0.tar.bz2 |
Plug your CF card into the reader. You may need to capture the USB device for the VM to be able to use it.
After you plug the CF card into the reader, you need to find out which device the CF
card is recognized as. The output of tail dmesg should help – in this example
I’m going to use /dev/sdx as the destination drive. You’ll need to substitute
sdx for your actual device name.
Installing Voyage Linux
Follow along with the instructions given in the Voyage Linux Getting Started Guide. When running the voyage.update script take the default values except for:
- The Voyage Profile for our VM is 1 - Soekris 4501.
- Make sure to select the Serial console and a baud rate that matches the value set in the Soekris BIOS, otherwise you will be confused as to why the system appears to not boot.
- The target disk device is /dev/dsx – yours may be different. The target partition is 1.
- In the Partition and Create Filesystem section, select 1 - Partition Flash Media and Create Filesystem.
- In step 7, be sure to enter “y” to proceed otherwise the default (no action) is taken.
Now, if you take the just created CF card and put it in the Soekris 4501, it won’t work. That’s because for some reason, the default initrd image does not have the ide_generic driver built in. No amount of boot parameter fiddling will fix that. We need to add the ide_generic to initrd.
Fortunately, another Soekris Voyager named Hermann Gottschalk has found the solution. Here is an excerpt of his note in the Voyage Mailing List Archives:
I installed voyage 0.7.5 via PXE on a soekris 4501 and after the first
reboot, the system could not mount the rootfs an felt into initramfs.I figured out that the problem ist, that the ide_generic module is not
loaded in the initrd.So my workaround:
After having installed voyage like described here
http://linux.voyage.hk/content/getting-started-pxe-boot-v07x and BEFORE
the first reboot mount /dev/hda1 again on /tmp/cf (rw), then chroot to
/tmp/cf.$ mount /dev/hda1 /tmp/cf
$ chroot /tmp/cfHere edit /etc/initramfs-tools/modules in adding ‘ide_generic’. Then do
a update-initramfs -u (don’t worry about the absense of the mtab-file
which is complained).$ update-initramfs -u
Now do the first reboot and the soekris should boot.
You can do some basic customization while the CF card is still in the Voyage SDK machine such as setting the hostname and network interfaces, or we can just boot the CF card as is and use the serial terminal. It’s up to you, but I like to make sure the card at least boots before I put all kinds of effort into customizing the install.
I’ll wait while you make sure that the card boots the Soekris 4501. Log in and you should be ready to proceed. Refer to the Getting Started Guide to get the default root password.
Customizing Voyage Linux
If you want to continue to use the serial console, that’s fine. I prefer to use ssh to log in to the Soekris box. We’ll fix up a couple of key items, add nfs support so that we can access the shared drive on the Voyage SDK VM, and then reboot so that the hostname change takes effect.
Before doing anything, you’ll need to mount the CF filesystem as read/write, it’s mounted as read-only by default to avoid too many writes and to make it harder to wreck things by accident. Log in as root and execute:
|
1 2 |
# Run this command as root remountrw |
Changing the hostname is as easy as editing /etc/hostname and putting in whatever value you'd like.
Next, we'll add a user. To make permissions easier to deal with, make sure that the username/userid that you use matches the username/userid on the Voyage VM.
|
1 2 |
# Run this command as root useradd newusername |
If you need to change any of the defaults, usermod is your friend.
You might want to edit /etc/timezone to get your local timezone set up correctly.
I let my DHCP server assign the IP address based on the MAC address. That way I don't need to mess with forcing IP addresses on each host if I ever need to change my subnet. If you can't do that, it's still handy to choose a fixed address to make nfs sharing easier to set up. You can edit /etc/network/interfaces
Finally, we can get the nfs sharing set up. Recall that in the previous tutorial we had set up the Voyage VM to expect the Soekris 4501 to request an NFS share for ~/nfs/Soekris4501.
|
1 2 |
# Add a line something like this to /etc/fstab 192.168.254.214:/home/rhempel/nfs/Soekris4501 /home/rhempel/nfs/Soekris4501 nfs rw,sync,hard,intr 0 0 |
Unfortunately, the default Voyage Linux install does not come with nfs support built in - we need to install that package ourselves. So while we're at it, lets set up the apt subsystem to use a conveniently close mirror from this list. Edit /etc/apt/sources.list and replace the default Japanese source with one that's closer. For me, that's:
|
1 2 |
# Add a line something like this to /etc/apt/sources.list deb http://mirror.csclub.uwaterloo.ca/debian/ squeeze main contrib non-free |
Now, we could do an apt-get on the package, but we're going to avoid that and do the apt-gets on the Voyage VM and just install them on the Soekris 4501 using the nfs shared drive. But we still need to install nfs first - classic chicken/egg problem.
So let's get started and grab the following files (as root):
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# Run these commands as root cd /tmp wget http://ftp.ca.debian.org/debian/pool/main/n/nfs-utils/nfs-common_1.2.2-4squeeze2_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libe/libevent/libevent-1.4-2_1.4.13-stable-1_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libn/libnfsidmap/libnfsidmap2_0.23-2_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/o/openldap/libldap-2.4-2_2.4.23-7.2_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/g/gnutls26/libgnutls26_2.8.6-1+squeeze1_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.4.5-2_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libg/libgpg-error/libgpg-error0_1.6-1_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libt/libtasn1-3/libtasn1-3_2.7-1_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.23.dfsg1-7_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libr/librpcsecgss/librpcsecgss3_0.19-2_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/libg/libgssglue/libgssglue1_0.1-4_i386.deb wget http://ftp.ca.debian.org/debian/pool/main/u/ucf/ucf_3.0025+nmu1_all.deb |
And install them in this order:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# Run these commands as root dpkg -i ucf_3.0025+nmu1_all.deb dpkg -i libgssglue1_0.1-4_i386.deb dpkg -i librpcsecgss3_0.19-2_i386.deb dpkg -i libgpg-error0_1.6-1_i386.deb dpkg -i libgcrypt11_1.4.5-2_i386.deb dpkg -i libtasn1-3_2.7-1_i386.deb dpkg -i libgnutls26_2.8.6-1+squeeze1_i386.deb dpkg -i libsasl2-2_2.1.23.dfsg1-7_i386.deb dpkg -i libldap-2.4-2_2.4.23-7.2_i386.deb dpkg -i libnfsidmap2_0.23-2_i386.deb dpkg -i libevent-1.4-2_1.4.13-stable-1_i386.deb dpkg -i nfs-common_1.2.2-4squeeze2_i386.deb # Once that's done, we can mount the nfs shares described in /etc/fstab using: mount -a |
That's all for now - in the next article, we'll go over building and installing Hiawatha for the Soekris4501. So let's remount the drive read-only and reboot:
|
1 2 3 |
# Run these commands as root remountrw shutdown -r now |