Configuring Netconsole on Pogoplug V2

Sometimes we need to troubleshoot the boot process of Pogoplug V2, especially if we have installed custom firmware (e.g. ArchLinux, Debian). The best option is to have a physical serial connection. But if this is not available, we can take advantage of what’s called Netconsole.

Netconsole is a feature of uBoot that allows us to view boot messages as if we are connected over serial port. It works by sending boot messages as UDP packets to any client listening on that UDP port. This is very similar to Linux netconsole module that shows kernel boot messages.

As far as I know, netconsole is not available in the stock uBoot that comes installed on Pogoplug V2. So you need to update uBoot to Jeff Doozan version. Check this article for more details.

To use netconsole we need to configure uBoot environment variables, as well as a client program to receive boot messages.

Configuring uBoot Environment Variables

We need to assign an IP to uBoot during boot process that’s not used by any other device on the network. I’ve used because I’ve already reserved that IP for Pogoplug.

We also need to identify the IP of Desktop/Laptop that will act as a client for netconsole. Here I assume it’s

Then we need to run the following commands while connected as root to Pogoplug (after substituting IP addresses with the ones used in your network)

# fw_setenv serverip
# fw_setenv ipaddr
# fw_setenv if_netconsole 'ping $serverip'
# fw_setenv start_netconsole 'setenv ncip $serverip; setenv bootdelay 10; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;'
# fw_setenv preboot 'run if_netconsole start_netconsole'

Configuring netconsole Client

The client program is simply nc (netcat) command, used for arbitrary tcp/udp connections, which serves us well in this case.

all we need to do is to run the utility to listen on udp port 6666

Here is the command on Mac and Linux

nc -ul 6666

I’ve not tried that on window, but I know there is a port of netcat on windows that can be used similarly.

Once we have netcat (nc) listening, we reboot Pogoplug, and we should start seeing boot messages as in the example below …

$ nc -lu 6666

U-Boot 2010.09 (Oct 23 2010 - 11:51:16)
Marvell-PinkPogo by Jeff Doozan
Hit any key to stop autoboot:  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
** File not found /rescueme
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000008000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            91 MiB
UBI: number of good PEBs:        726
UBI: number of bad PEBs:         2
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             715
UBI: total number of reserved PEBs: 11
UBI: number of PEBs reserved for bad PEB handling: 7
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
1 bytes read
Found bootable drive on usb 0:1
Loading file "/boot/uImage" from usb device 0:1 (usbda1)
2860432 bytes read
Loading file "/boot/uInitrd" from usb device 0:1 (usbda1)
** File not found /boot/uInitrd
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-3.1.10-6-ARCH
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2860368 Bytes = 2.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

Hope this helps you better troubleshoot boot problems in your Pogoplug.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s