Build and Install on a Soekris 4526 using Arch Linux
INSTRUCTIONS FOR PXEBOOT OF 4526 SOEKRIS BOARD WITH ARCH LINUX
*NOTE* Some of these instructions are specific to Arch Linux. If you would like to contribute instructions for other Linux distributions, please email them to us.
A text version of this document is available here: pxeboot4526archlinux.txt
SOFTWARE REQUIREMENTS:
- A current Linux distribution (This tutorial was devised and tested on ArchLinux (http://www.archlinux.org)
- GCC 3-4 and G++ 3-4 (and their dependencies)
- Subversion (and its dependencies)
- Wget
- Minicom
- Bunzip2
HARDWARE REQUIREMENTS
- One Ethernet port
- One serial port [We found that a USB-RS232 Serial Connector worked as well.]
- One crossover cable
- One cat5e cable
- One null-modem cable
- One power-over-ethernet injector [POE]
CONVENTIONS
Three different command line prompts will be used: # indicates the normal user; $ indicates the root user; and > indicates a prompt from the node. The end of all command line entries are signaled by the following notation: <enter>. All key strokes (e.g. Shift, Control, Enter, etc...) will use the following syntax: <key> [e.g. <Shift>, <Ctrl>, etc.].
VI TUTORIAL
For text editing, we use VI, but feel free to use whatever text editor you like. Some useful vi commands:
i - enter the edit mode to change text
<Esc> - to escape the edit mode
:q! - to exit without saving changes
<Shift>zz - to save changes and exit
STEP 1: GETTING THE SOFTWARE IMAGE
- The easiest way to get the software for your node is to go to http://cuwireless.net/node/208. You will need to download the pxeboot_ia32_com0.bin, netbsd.gz, and the update files. Download them and place them in your /var/tftpboot directory. [Directions for making the /var/tftpboot directory are in step 1B10.] Skip to step 1B12.
- The best way to get the software is to compile it yourself. This is why we include GCC as a required package. These steps will help you compile the software from scratch. Be sure that you follow these directions as yourself, not as root.
- In this step, you will make a directory named "cuwin" in your home directory directory. At the command line, enter the following:
# mkdir ~/cuwin - Place the latest version of the CUWiN software in your home directory by typing:
# svn co http://svn.cuwireless.net/svn/cuw/trunk - Now we need to place the latest version of the NetBSD sources in your home directory. Enter:
# wget http://superb-west.dl.sourceforge.net/sourceforge/wireless/cuwin-0.6.0-netbsd-src.tar.bz2 - Decompress the NetBSD files by entering the following at the command prompt:
# tar -jxvf cuwin-0.6.0-netbsd-src.tar.bz2 - Move these directories and their contents to the directories you just created in 1.B.1:
-
# mv trunk cuwin/cuw-trunk -
# mv cuwin-0.6.0-netbsd-src cuwin/scratch
-
- Make your .mkstabootrc file in your home directory and edit it:
-
# vi .mkstabootrc - Type <i>
- Enter the following, where MACHINE_ARCH equals the processor architecture of your computer(i386 should be fine for most people):
BUILDDIR=$HOME/cuwin/scratch SRC=$HOME/cuwin/scratch/src LOWER_FAT=yes MACHINE_ARCH=i386 - When you have typed the above information into the file, press <Esc>.
- Exit the text editor by using the following command:
:wq
-
- To fix a difference in syntax between Linux and *BSD, you may have to do the following:
- Edit the build.sh file in the NetBSD "src" directory
# vi ~/cuwin/scratch/src/build.sh - Find the line that reads "TOP=$(/bin/pwd -P 2>/dev/null)" by typing /pwd followed by pressing <Enter>
- Type <i>
- Edit the line to read "TOP=$(/bin/pwd 2>/dev/null)"
- Edit the text editor by typing :wq
- Edit the build.sh file in the NetBSD "src" directory
- Move to the bootimage directory in the CUWiN source files by entering the following at the command line:
# cd ~/cuwin/cuw-trunk/src/boot-image - Start the compile process [This step takes a couple of hours to complete, so feel free to make other plans for about three hours.]:
# ./buildmd - Type "ls" at the command line. You should be able to find a file that has something similar to the following name:
23-April-staboot.md
If you do, you have successfully compiled the software. If not, don't be discouraged, that happens. We are working on a Troubleshooting Guide, but that may not be available for a few months. In the mean time, you should just use the sources provided on the website listed in 2.A.
- Assuming that you have successfully compiled the software, copy two files to the /var/tftpboot directory. The first command will create the /var/tftpboot directory. The next two commands will copy the required files.
-
# mkdir /var/tftpboot -
# cp ~/cuwin/cuw-trunk/src/boot-image/23-April-staboot.img /var/tftpboot/netbsd - [Because this command line is so long, it has been placed on the next line.]
# cp ~/cuwin/scratch/O/sys/arch/i386/stand/pxeboot_com0_19200/pxeboot_ia32_com0.bin /var/tftpboot/pxeboot_ia32_com0_19200.bin
-
- Before we build the update file, we need to change the user accounts. To do this, we are going to need to move into the boot-image directory and change the passwords for root. Then we can add other users. Before you begin this step, be sure that you know what you want to make the root password and which new users you will want to add.
-
# cd ~/cuwin/cuw-trunk/src/boot-image -
# ./cw_passwd ./pwds root - The previous command prompts you for the new root password.
-
# ./cw_passwd ./pwds newusername - The previous command prompts you to enter the password for the account "newusername".
-
- Now we need to build an update file. First, you will return to the /boot-image directory. Then you will build the upgrade. Then you will copy the upgrade to the /var/tftpboot directory.
-
# cd ~/cuwin/cuw-trunk/src/boot-image -
# ./buildelanup install -
# cp upgrade.tgz /var/tftpboot/.
-
- Change directories to the /var/tftpboot directory by entering
# cd /var/tftpboot - Compress the netbsd file by entering the following:
# gzip netbsd - Change the ownership and permissions of the /var/tftpboot directory and the files you just copied into /var/tftpboot by entering the following commands:
-
# chown -R nobody:nobody /var/tftpboot -
# chmod -R 777 /var/tftpboot
-
- In this step, you will make a directory named "cuwin" in your home directory directory. At the command line, enter the following:
Step 2: Setup the Network Boot
- Get the most recent BIOS update from Soekris.
- Open your web browser and go to the following page: http://www.soekris.com/downloads.htm
- Save the most recent version of the BIOS to the /var/tftpboot directory.
- DHCP Server [You will need root privileges for this step.]
- To find out if you have a DHCP Server running, type
# ps wuax | grep dhcp
If there is something on the next line (e.g. /etc/init.d/dhcpd or /usr/sbin/dhcpd), you have a DHCP Server already installed and running and you should proceed to Step 2.B.4. - To find out if you have a DHCP Server installed, type
# find /etc /usr/local/etc -name '*dhcp*' print
If you see a file named "dhcpd.conf", you have a DHCP Server installed and should skip to Step 2.B.4. - Install the DHCP Server by entering the appropriate installation command for your distribution:
- For ArchLinux:
# pacman -Sy dhcp
- For ArchLinux:
- At this point, you will need to configure your DHCP server. NOTE: MAKE SURE THAT YOU ARE DISCONNECTED FROM YOUR NETWORK! RUNNING THIS SERVICE MAY DESTROY YOUR NETWORK. Enter the following commands:
-
# vi /etc/dhcpd.conf - <i>
- Enter the following:
subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.101; option subnet-mask 255.255.255.0; range 192.168.1.1 192.168.1.15 } class "pxe-clients-ia32" { match if substring(option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.1.101; filename "pxeboot_ia32_com0_19200.bin"; } class "netbsd-pxe-clients-ia32" { match if substring(option vendor-class-identifier, 0, 17) = "NetBSD:i386:libsa"; next-server 192.168.1.101; filename "tftp:netbsd.gz"; } - <Shift>zz
-
- Configure your Ethernet Device.
- Determine your Ethernet. When you use the following command, the item that says, "Link encap: Ethernet" is the Ethernet device [from here on, the Ethernet device will be indicated by dev0:
# ifconfig -a - Find out your IP address and subnet mask. The important line should look something like: inet 10.0.0.103 netmask 255.255.255.0 broadcast
# ifconfig dev0 - Release and reset the current IP address by entering the following:
-
# ifconfig dev0 down -
# ifconfig dev0 inet 192.168.1.101 netmask 255.255.255.0 - Now, if you enter "ifconfig dev0", you should see a line that reads:
inet 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255
-
- Determine your Ethernet. When you use the following command, the item that says, "Link encap: Ethernet" is the Ethernet device [from here on, the Ethernet device will be indicated by dev0:
- To find out if you have a DHCP Server running, type
- TFTP Server: There are two different ways to do this. The first is to use either inetd or xinetd, and the second is to start the tftpd daemon standalone, either manually or with a script [You will need root privileges for this step.]
- Now you need to edit the TFTP Server Configuration. TFTPD requires the INETD service. If you have inetd, you will need to edit /etc/inetd.conf.
-
# vi /etc/inetd.conf - Move to the line below and put the cursor on the "#". Press DEL to remove the comment mark.
tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -U 777 -s /var/tftpboot
- <Shift> zz
-
- If you are using xinetd, you will have to create a file in your /etc/xinetd.d entitled "tftp"
-
# vi /etc/xinetd.d/tftp - Type <i>
- Insert the following in the file:
service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd disable = yes }
-
- The other method is to start tftpd manually:
-
# ls /etc/rc.d/
Where /etc/rc.d is your init scripts directory. (Possibly /etc/init.d/) If you see a file entitled in.tftpd, tftpd, tftp, or similar, then you can most likely start the daemon by typing at the prompt:
# /etc/rc.d/tftpd start - Otherwise, you can most likely start tftp manually
# /usr/sbin/in.tftpd -l -U 777 -s /var/tftpboot
or
# /usr/libexec/tftpd -l -U 777 -s /var/tftpboot
-
- Now you need to edit the TFTP Server Configuration. TFTPD requires the INETD service. If you have inetd, you will need to edit /etc/inetd.conf.
- Allow the system to run TFTP and DHCP daemons. [You will need root privileges for this step.]
- Edit your /etc/hosts.allow file
-
# vi /etc/hosts.allow - Add the line in.tftpd:all
- Type :wq
-
- Edit your /etc/hosts.allow file
Step 3: Update the BIOS and flash the node [You will need root privileges for this step.]
- Restart network services by entering the following commands (Depending on your distribution, your initscripts directory may be something different from /etc/rc.d/, like /etc/init.d/ or /usr/local/etc/rc.d/):
-
# /etc/rc.d/dhcpd start -
# /etc/rc.d/tftpd start -
# /etc/rc.d/sshd start
-
- Plug the null-modem cable into the serial port on your computer and the serial port on the Soekris board. If you do not have a serial port on your computer, you may need to use a USB-to-serial adapter cable. Now, plug the Crossover Cable into your computer's Ethernet port and the "Data" port on the POE injector. Make sure that the POE injector has power [there should be a green light on top to indicate that it has power].
- Now you will need to run Minicom in order to connect to the node over the serial line
- Enter su and the root password when prompted.
- Now you will need to access the node console. At the command prompt, enter: # minicom
- Hit the key combination Ctrl-A Z to bring up the options screen, and select "Serial Port Setup." The correct settings BP/Par/Bits settings are 19200 8N1, and all flow control should be turned off. The serial device is the device file of your serial port. If you're using USB-to-serial, it will most likely be something like /dev/tts/USB0.
- Break into the comBIOS monitor with <Ctrl>-P at the beginning of the boot process. [This may happen quickly when the node is started, so be prepared.]
- At the > prompt, enter the following commands:
> download <enter>
~C lsx b4501_xxx.bin
[where xxx is the number of the Soekris BIOS upgrade; note: the ~C can be a bit tricky. Think of it as follows: Press and hold the <Shift> key, then press <~> and then <c>] - When you are returned to the > prompt, enter:
> flashupdate - When the update is complete, you will need to reboot. Do that by entering:
> reboot
- Set the node to PXE boot.
- Break into the comBIOS monitor again with <Ctrl>-P.
- At the prompt, enter: > set bootdrive=f0 80 81 ff
- Enter:
> reboot
- At this point, your node should PXEboot from your computer. A successful PXEboot looks like this:
Pre-boot eXecution Environment PXE-2.0 (build 082) Copyright (C) 1997-2000 Intel Corporation CLIENT MAC ADDR: 00 00 24 C3 A8 40 CLIENT IP: 192.168.1.9 MASK: 255.255.255.0 DHCP IP: 192.168.1.101 GATEWAY IP: 192.168.1.101 >> NetBSD/i386 PXE Boot, Revision 1.1 >> (rgmussel@cuw.ojctech.com, Sun Apr 23 07:50:45 CDT 2006) >> Memory: 582/64512 k Press return to boot now, any other key for boot menu Starting in 0 PXE BIOS Version 2.1 Using PCI device at bus 0 device 6 function 0 Ethernet address 00:00:24:c3:a8:40 net_open: client addr: 192.168.1.9 net_open: subnet mask: 255.255.255.0 net_open: net gateway: 192.168.1.101 net_open: server addr: 192.168.1.101 net_open: file name: tftp:netbsd.gz 2159776+33612688- - Update the node
- Log into the node using the root password: changeme
- Enter:
# stty <space> erase Control-v <bksp> - Enter:
# fixlabel - Enter:
# ifconfig sip0 - Find a line that looks something like this:
inet 10.168.64.254 netmask 0xffffff00
- Enter:
# ifconfig sip0 inet 10.168.64.254 netmask 0xffffff00 -alias - Enter:
# ifconfig sip0
You should see a line that looks something like this:inet 192.168.1.7 netmask 0xffffff00 broadcast 192.168.1.255
- Ping the server to verify your connection:
# ping 192.168.1.101 -c 5
You should see lines like this:64 bytes from 192.168.1.101: icmp_seq=0 ttl=64 time=0.656 m
- Enter:
# upgrade -f blah@192.168.1.101:/var/tftpboot/upgrade.tgz
where blah is your user name. If that is successful, you should see something like this:fdisk: DIOCGDEFLABEL: Invalid argument fdisk: DIOCGDINFO: Invalid argument Disk: /dev/rwd0d NetBSD disklabel disk geometry: cylinders: 977, heads: 4, sectors/track: 32 (128 sectors/cylinder) total sectors: 125056 BIOS disk geometry: cylinders: 977, heads: 4, sectors/track: 32 (128 sectors/cylinder) total sectors: 210453442400 Partition 0: NetBSD (sysid 169) start 32, size 62512 (31 MB, Cyls 0-488/2/17) Making partition 0 active. Preparing for upgrade on /dev/wd0e. /dev/rwd0e: 30.5MB (62512 sectors) block size 8192, fragment size 1024 using 4 cylinder groups of 7.63MB, 977 blks, 1920 inodes. super-block backups (for fsck_ffs -b #) at: 32, 15664, 31296, 46928, Installing the upgrade. The authenticity of host '192.168.1.101 (192.168.1.101)' can't be established. DSA key fingerprint is a8:75:fe:7d:46:b7:a8:05:65:77:43:7a:67:e7:a4:fc. Are you sure you want to continue connecting (yes/no)?yes Warning: Permanently added '192.168.1.101' (DSA) to the list of known hosts. Password: 100% |*************************************| 4041 KB 237.68 KB/s --:-- ETA Updating etc/fstab Updating primary bootstrap Updating active partition Disk: /dev/rwd0d NetBSD disklabel disk geometry: cylinders: 977, heads: 4, sectors/track: 32 (128 sectors/cylinder) total sectors: 125056 BIOS disk geometry: cylinders: 977, heads: 4, sectors/track: 32 (128 sectors/cylinder) total sectors: 210453442400 Partition 1: NetBSD (sysid 169) start 62544, size 62512 (31 MB, Cyls 488/2/17-977) Making partition 1 active. Copying existing /etc/cuw_config. Upgrade complete (/dev/wd0e). # - After that runs, type the following at the command line to reboot the node: shutdown -r now
- When you are finished, you will want to exit Minicom. Do that by typing Shift-Q.
| Attachment | Size |
|---|---|
| pxeboot4526archlinux.txt | 15.34 KB |



