Difference between revisions of "Niagara 510: Initial bootup"

From Define Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 38: Line 38:
 
== Getting network interfaces online ==
 
== Getting network interfaces online ==
 
In theory, the networking should automatically initialise but I never found this to be the case!
 
In theory, the networking should automatically initialise but I never found this to be the case!
<br><br>
+
<br>
 
'''<code>modprobe nae</code>''' to start the networking:
 
'''<code>modprobe nae</code>''' to start the networking:
 
<syntaxhighlight>
 
<syntaxhighlight>
Line 48: Line 48:
 
Enter 'help' for a list of built-in commands.
 
Enter 'help' for a list of built-in commands.
  
~ # insmod nae
+
~ # modprobe nae
 
  27:<4>hal_interface: module license 'Proprietary' taints kernel.
 
  27:<4>hal_interface: module license 'Proprietary' taints kernel.
 
  27:<4>Disabling lock debugging due to kernel taint
 
  27:<4>Disabling lock debugging due to kernel taint
Line 74: Line 74:
 
  27:Registering nae msgring handler
 
  27:Registering nae msgring handler
 
  27:PCI: Enabling device 0000:00:03.0 (0000 -> 0002)
 
  27:PCI: Enabling device 0000:00:03.0 (0000 -> 0002)
 +
~ #
 +
</syntaxhighlight>
 +
 +
== chroot to a debian rootfs ==
 +
'''N.B.''' - At the time of writing this, IM have not been able to provide instructions to illustrate how to generate a rootfs specifically for the N510/N511.
 +
<br>
 +
I've tried using the rootfs generated by the Cavium SDK, as used with the IM N804/N805 product. See the following for information on how to generate this: [[Cavium: SDK Install and build Debian image#Build a basic Debian Image (needs a manual chroot at every boot) | Cavium - SDK Install and build Debian image ]]
 +
 +
=== Copy the prepared rootfs to a USB drive ===
 +
* Copy the prepared rootfs to a USB drive (or build a new one directly to a USB drive)
 +
* Install the USB drive into a USB port of the N510/N511
 +
 +
=== Create a mount point in BusyBox ===
 +
Create a mount point (by default, the BusyBox environment does not include a <code>/mnt</code> folder):
 +
<syntaxhighlight>
 +
~ # mkdir /mnt
 +
</syntaxhighlight>
 +
 +
=== Mount the Debian rootfs to the <code>/mnt</code> directory ===
 +
<syntaxhighlight>
 +
~ # mount /dev/sda2 /mnt
 +
  1:<6>EXT3-fs: barriers not enabled
 +
  1:<6>kjournald starting.  Commit interval 5 seconds
 +
  1:<6>EXT3-fs (sda2): using internal journal
 +
  1:<6>EXT3-fs (sda2): mounted filesystem with writeback data mode
 +
</syntaxhighlight>
 +
 +
=== Mount & bind the <code>/proc</code> directory to the <code>/mnt/proc</code> directory ===
 +
<syntaxhighlight>
 +
~ # mount --bind /proc/ /mnt/proc/
 +
</syntaxhighlight>
 +
 +
=== chroot the rootfs ===
 +
<syntaxhighlight>
 +
~ # chroot /mnt/
 +
root@XLP-Linux:/#
 +
</syntaxhighlight>
 +
 +
=== Set up networking, ssh, etc ===
 +
I created a script to do this:
 +
<syntaxhighlight>
 +
#!/bin/bash
 +
 +
## Check the script is being run by the root user
 +
if [[ $EUID -ne 0 ]]; then
 +
  echo "This script must be run as root"
 +
  exit 1
 +
fi
 +
 +
## Check for the correct number of arguments
 +
EXPECTED_ARGS=4
 +
if [ $# -ne $EXPECTED_ARGS ]
 +
then
 +
  echo "Usage: `basename $0` {hostname} {ip address} {gateway server ip} {dns server ip}"
 +
  echo "Eg:    `basename $0` mexa1 172.28.254.1 172.28.0.1 172.28.0.1"
 +
  exit 1
 +
fi
 +
 +
HOSTNAME=$1
 +
IPADDR=$2
 +
ROUTER=$3
 +
DNS=$4
 +
 +
## Set hostname
 +
hostname ${HOSTNAME}
 +
echo ${HOSTNAME} > /etc/hostname
 +
 +
## Setup mgmt0 network interface
 +
ifconfig eth4 ${IPADDR}
 +
 +
## Wait 5 seconds for network to become active
 +
echo "Wait 5 seconds for network to be active..."
 +
sleep 5
 +
 +
## Define the default gateway
 +
route add default gw ${ROUTER} eth4
 +
 +
## Define DNS server
 +
echo "nameserver" ${DNS} > /etc/resolv.conf
 +
 +
## Start/restart SSH daemon
 +
/etc/init.d/ssh restart
 +
 +
## Mount /dev/pts/
 +
mount /dev/pts/
 +
 +
## Set time via NTP
 +
ntpdate ntp.ubuntu.com
 +
 +
## Set root password
 +
passwd
 +
 +
## Exit message
 +
echo "You should be able to SSH into this Mexascale system now."
 +
echo "SSH to " ${IPADDR}
 +
echo "Use the root account and password you just created."
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 15:12, 20 May 2014

Booting BusyBox environment from network

Setup networking in uBoot environment

The network interface(s) will need to be configured and operational before you can pull down the necessary files using TFTP.
Follow instructions at: Niagara 510 - Assigning a MAC address in u-boot

Load the necessary files into memory

tftpboot 0xa800000006000000 172.28.0.2:vmlinux_N511_23.xlp
tftpboot 0xFFFFFFFF80100000 172.28.0.2:linux-nae.dtb

N.B. - Replace 172.28.0.2 with the appropriate TFTP server.

Boot the image

bootelf 0xa800000006000000 - 0xFFFFFFFF80100000

Booting BusyBox environment from MMC (SD card)

Place the necessary files on the MMC

Copy the vmlinux_<version>.xlp and linux-nae.dtb files from the Interface Masters SDK onto the second partition of the MMC (SD card).

Ensure the MMC device is initialised in uBoot

mmc init

Load the necessary files into memory

fatload mmc 0:2 0xFFFFFFFF80100000 linux-nae.dtb
fatload mmc 0:2 0xa800000006000000 vmlinux_N511_23.xlp

Boot the image

bootelf 0xa800000006000000 - 0xFFFFFFFF80100000

Getting network interfaces online

In theory, the networking should automatically initialise but I never found this to be the case!
modprobe nae to start the networking:

XLP-Linux login: root
login[1054]: root login on 'ttyS0'


BusyBox v1.19.3 (2013-03-07 19:19:38 IST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # modprobe nae
 27:<4>hal_interface: module license 'Proprietary' taints kernel.
 27:<4>Disabling lock debugging due to kernel taint
 27:======= Module Parameters =========
 27:num_descs_per_normalq=64 num_descs_per_jumboq=48  27:perf_mode=TCP_PERF enable_lro=0 enable_jumbo=0
 27:p2p_desc_mem_init in, dsize 256 tsize 51200
 27:number of nodes 1
 27:Successfully zapped free in fifo!
 27:Receive(Rx) Disabled
 27:Configuring ucore...
 27:UCORE MASK 0xffff
 # ...
 # Much output!
 # ...
 27:Configuring POE in bypass mode
 27:NAE configuration done!
 27:UCORE MASK 0xffff
 27:Loading ucores (mask = 0xffff)
 27:Send 256 descriptors for queue 0(vc 1000) of length 1648
 27:Send 256 descriptors for queue 4(vc 1004) of length 1648
 27:Send 256 descriptors for queue 8(vc 1008) of length 1648
 27:Send 256 descriptors for queue 12(vc 1012) of length 1648
 27:Send 52 descriptors for queue 16(vc 1016) of length 1648
 27:Send 52 descriptors for queue 17(vc 1017) of length 1648
 27:Registering nae msgring handler
 27:PCI: Enabling device 0000:00:03.0 (0000 -> 0002)
~ #

chroot to a debian rootfs

N.B. - At the time of writing this, IM have not been able to provide instructions to illustrate how to generate a rootfs specifically for the N510/N511.
I've tried using the rootfs generated by the Cavium SDK, as used with the IM N804/N805 product. See the following for information on how to generate this: Cavium - SDK Install and build Debian image

Copy the prepared rootfs to a USB drive

  • Copy the prepared rootfs to a USB drive (or build a new one directly to a USB drive)
  • Install the USB drive into a USB port of the N510/N511

Create a mount point in BusyBox

Create a mount point (by default, the BusyBox environment does not include a /mnt folder):

~ # mkdir /mnt

Mount the Debian rootfs to the /mnt directory

~ # mount /dev/sda2 /mnt
  1:<6>EXT3-fs: barriers not enabled
  1:<6>kjournald starting.  Commit interval 5 seconds
  1:<6>EXT3-fs (sda2): using internal journal
  1:<6>EXT3-fs (sda2): mounted filesystem with writeback data mode

Mount & bind the /proc directory to the /mnt/proc directory

~ # mount --bind /proc/ /mnt/proc/

chroot the rootfs

~ # chroot /mnt/
root@XLP-Linux:/#

Set up networking, ssh, etc

I created a script to do this:

#!/bin/bash

## Check the script is being run by the root user
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root"
   exit 1
fi

## Check for the correct number of arguments
EXPECTED_ARGS=4
if [ $# -ne $EXPECTED_ARGS ]
then
  echo "Usage: `basename $0` {hostname} {ip address} {gateway server ip} {dns server ip}"
  echo "Eg:    `basename $0` mexa1 172.28.254.1 172.28.0.1 172.28.0.1"
  exit 1
fi

HOSTNAME=$1
IPADDR=$2
ROUTER=$3
DNS=$4

## Set hostname
hostname ${HOSTNAME}
echo ${HOSTNAME} > /etc/hostname

## Setup mgmt0 network interface
ifconfig eth4 ${IPADDR}

## Wait 5 seconds for network to become active
echo "Wait 5 seconds for network to be active..."
sleep 5

## Define the default gateway
route add default gw ${ROUTER} eth4

## Define DNS server
echo "nameserver" ${DNS} > /etc/resolv.conf

## Start/restart SSH daemon
/etc/init.d/ssh restart

## Mount /dev/pts/
mount /dev/pts/

## Set time via NTP
ntpdate ntp.ubuntu.com

## Set root password
passwd

## Exit message
echo "You should be able to SSH into this Mexascale system now."
echo "SSH to " ${IPADDR}
echo "Use the root account and password you just created."