Upgrading a Node using FreeBSD

Upgrading a Soekris 4526 using FreeBSD


This how-to document is designed to walk people through the process of upgrading the CUWiN software on a Soekris 4526 board using a FreeBSD operating system.


Software Requirements



Hardware Requirements



Conventions


Three different command line prompts will be used: # indicates the normal user; $ indicates the root user; and > indicates a prompt from the node. 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



  1. The easiest way to get the software for your node is to go to http://cuwireless.net/download#Update and download the upgrade file for your hardware. Download it and place it in your home directory.

Step 2: Start SSHD and login to node [You will need root privileges for this step.]



  1. Start SSH server by entering the following command:

    1. $ /etc/rc.d/sshd start

  2. 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].
  3. To find the node's IP address:

    1. $ ifconfig -a
    2. Find your ip address. Look for a line similar to:
      inet 10.23.54.27 netmask 0xffffff00 broadcast 10.23.54.255
    3. Record the number following “inet”. Record this a second time, replacing the digits following the last period with “254”. In our example, this would be 10.23.54.254 – this is the ip address of the node.

  4. Login to the node using the following command and the ip address of node, found in the previous step:

    1. $ ssh root@10.23.54.254

  5. Update the node

    1. Log into the node using the root password. The username is “root” and the default password is “changme”. If you have changed the password, use that password.

  6. This command makes the backspace key work the way we expect it to. Its not required, but prevents many headaches when you make a typo.

    1. $ stty <space> erase Control-v <Backspace>

  7. Now, upgrade the node. Replace “blah” with your username on your local machine, and the ip address with the ip address of your machine (from step C.2). The “~” stands for you home directory. If the file is not in your home directory, replace “~/” with the correct path to the upgrade file. Also, replace “upgrade.tgz” with the correct name of the upgrade file that you downloaded from the website. If you wish to erase the current configuraton file on the node and use the default one provided in the upgrade, replace the “-f” with a “-C -f”.

    1. $ upgrade -f blah@10.23.54.27:~/upgrade.tgz
    2. When prompted with the following:

      “The authenticity of host '10.23.54.27 (10.23.54.27)' 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)?”

      Respond by typing “yes”.

    3. When prompted to enter your password, enter the password you use to login to your local machine (and that corresponds to the username you used when you issued the “upgrade” command).
    4. 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 '10.23.54.27 (10.23.54.27)' 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 '10.23.54.27' (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).
      #
        


  8. After that runs, type the following at the command line to reboot the node:

    1. $ reboot

  9. The node begins to reboot and you are disconnected from the ssh session. Wait a couple minutes and verify that the node is back up and operational. If it is not, please consult our troubleshooting section.