Mount Indigo via NFS on BCM Reference Designs

Overview

This is a Quick How To that explains one way to set up and run Indigo on the BCM 56634 reference design using NFS.

Requirements

  • A BCM 56634 reference design.
  • A serial port connection to the switch. The BCM56634 reference uses the spee 9600, 8N1.
  • A server on the management network running a TFTP server and an NFS server
  • The NFS root file system tar file (soon to be) available at the Indigo download page: Indigo - Download Page
  • A Linux kernel image for the platform. This should also be available on the download page and called uImage-t2ref.

NFS

Please note that explaining how to install and set up NFS is beyond the scope of this document. Once installed, you will likely want an entry in /etc/exports of the form:

/var/exports	192.168.3.0/24(rw,sync,no_subtree_check)

Where:

  • /var/exports is the directory where you will put the root file systems to be NFS mounted by your switches
  • 192.168.3.0/24 is the network from which the servers will mount the directory.

You'll need to restart NFS after making changes.

TFTP

Similarly, installing and setting up a TFTP server is beyond the scope of this document. Some notes have been added in the 3290 doc

The Linux kernel uImage-t2ref file should be placed in the TFTP server directory (usually /tftpboot or /var/tftpboot).

Setting up the Root File System

Assuming you have the file system is in a tar file named t2ref-nfs.tgz and that you have set up your NFS server to export from /var/exports, you should move t2ref-nfs.tgz to /var/exports and then the following.

NOTE that you should be in the target directory when you untar the root file system.

cd /var/exports
mkdir t2ref
cd t2ref
sudo tar xzf ../t2ref-nfs.tgz
ls

The ls command should give something like:

bin/  etc/	lib/	  lost+found/  sbin/   tmp/
dev/  include/	linuxrc@  proc/        share/  usr/

It is recommended that you change the owner of the files for NFS mounting.

cd /var/exports
sudo chown -R nobody t2ref
sudo chgrp -R nogroup t2ref

On Redhat-like systems, the user and group are both called nfsnobody.

Setting up the Boot Variables on the Switch

Here is an example set of variables with explanations.

Set up network interface

setenv -p ifcfg ifconfig eth0 -addr=192.168.3.34.

Here, 192.168.3.34 is the management address of the switch.

Linux Command Line

You may want to save the existing definition of LINUX_CMDLINE.

setenv -p LINUX_CMDLINE 'console=ttyS0,9600 ip=192.168.3.34:192.168.3.10:192.168.3.10:255.255.255.0:my_host:eth0 root=/dev/nfs rw nfsroot=/var/exports/t2ref

Here, 192.168.3.34 is the management address of the switch; 192.168.3.10 is the address of the TFTP and NFS server; andtThe root file system is stored in /var/exports/t2ref.

The Boot Command

setenv -p nfsboot boot -uboot -tftp 192.168.3.10:uImage-t2ref

This indicates that the boot operation should come from the server via TFTP and load the uImage-t2ref file as the kernel. The subsequent boot operations are indicated by the LINUX_CMDLINE variable above which indicates that the root FS is to come from an NFS mount.

Putting It Together

Note that the system will still boot to the original image if you do not interrupt bootup. To avoid this, you can define

setenv -p STARTUP 'sleep 2; ifconfig eth0 -addr=192.168.3.34; sleep 2; boot -uboot -tftp 192.168.3.10:uImage-t2ref'

See above for an explanation of this line.

If you do not do this, you now use the commands defined above:

CFE> ifcfg                                                                      
Device eth0:  hwaddr 00-10-18-48-F9-24, ipaddr 192.168.3.34, mask not set       
        gateway not set, nameserver not set                                     
*** command status = 0                                                          
CFE> nfsboot                                                                    
Loader:uboot Filesys:tftp Dev:eth0 File:192.168.3.10:uImage-t2ref Options:(null)
Loading: .. 1382400 bytes read                                                  
Unpacking U-Boot image at 0x00000000 (1382336) .... 2892120 bytes               
Entry at 0x00000000                                                             
...

Setting up the Environment

After booting with the NFS image, the platform will have no identity. You can enter the CLI and define configuration variables.

Alternatively, and you can do this prior to init, you can edit the file local/sysenv in the file system and add the configuration variables you want with export commands there.