This HOW-TO will help you set up a PogoPlug to run NetBSD. When you're done, your PogoPlug will still be able to be booted into Linux but will automatically boot into NetBSD using the SD card slot as the root filesystem. 

You can choose to use a serial port, if you haven't activated ssh on the Linux install. If you won't be using a serial port, skip the next part.

Pins on the PogoPlug (Mobile and Series 4) are numbered one through four immediately behind the SD card (where behind means towards the rear where the plugs are). One is farthest back and four is closest to the SD card slot. TxD is really transmit and RxD, receive. Connect at 115200 baud.

1: power (3.3 volts)
2: TxD
3: RxD
4: ground

If you're not using a serial connection, you'll have to have created an account at http://my.pogoplug.com/, activated the device, then enabled ssh for your PogoPlug. Since the company is now dead, this is no longer an option.

Connect ethernet to a network where the PogoPlug can get a DHCP lease and access to the Internet. Either with a serial console or via ssh (see below if your ssh is too new), you're at a root prompt. Paste in these lines to get tools and the NetBSD kernel.

cd /tmp
wget http://ftp.netbsd.org/pub/NetBSD/misc/jklos/nandwrite
wget http://ftp.netbsd.org/pub/NetBSD/misc/jklos/flash_erase
chmod +x nandwrite flash_erase
wget http://ftp.netbsd.org/pub/NetBSD/misc/jklos/netbsd.pogo.ub

If you like, you can get nanddump (via wget http://ftp.netbsd.org/pub/NetBSD/misc/jklos/nanddump) and back up mtd3 before overwriting and scp it somewhere else. Something like this would work:

./nanddump -f pogov4mtd3.dump -o /dev/mtd3

Now we flash the actual NetBSD kernel. mtd3 is labeled "failsafe" in the mtd map and is 8 megs from the start of flash and 8 megs long. The block size on the PogoPlug is 131072 bytes, so 64 blocks of 128k each works out to 8 megs. The "-p" option of nandwrite is to pad the kernel to fit whole blocks.

Note that at this point we begin running commands which write to the internal flash. A mistake here could brick your PogoPlug, so proceed with caution!

./flash_erase /dev/mtd3 0 64
./nandwrite -p /dev/mtd3 netbsd.pogo.ub

Next, we write the environment variable bootcmd. Note that the mw commands in init_mmc are necessary so that NetBSD can use the SD card slot (many thanks to Lwazi for that). Enter the following as continuous lines (keep spaces where it wraps):

/usr/local/cloudengines/bin/blparam bootcmd='if ping 192.168.58.254; then run boot_nand; fi; run boot_bsd'
/usr/local/cloudengines/bin/blparam boot_bsd='run init_mmc; nand read.e 0x800000 0x800000 0x800000; bootm 0x800000'
/usr/local/cloudengines/bin/blparam init_mmc='mw f1010004 11113311; mw f1010008 551111'

For PogoPlug Pink, the beginning of mtd3 is 0x2500000, so use:

/usr/local/cloudengines/bin/blparam bootcmd='if ping 192.168.58.254; then run boot_nand; fi; nand read.e 0x800000 0x2500000 0x800000; bootm 0x800000'

We decide whether to boot NetBSD or Linux based on whether the PogoPlug can ping a machine on the local network. This gives us the option to flash a new kernel using Linux, if we like, without a serial console. In order to have the PogoPlug boot into Linux, create an IP alias at address 192.168.58.254 on any other machine on the same network. An example would be:

ifconfig usmsc0 inet 192.168.58.254/24 alias

Once back in Linux, you can rerun the above but with a new kernel or your own custom kernel. Just copy and paste the wget of nandwrite and flash_erase, chmod them, wget or scp your own kernel, then flash_erase and nandwrite your kernel.

If you're using the serial console and would like to enable sshd so you won't need the serial in the future, do this while booted in to Linux:

echo "/usr/sbin/dropbear" >> /etc/init.d/rcS 

The default password for root is "ceadmin". Change this while in Linux, if you like.

Note that if your ssh is too new and you get an error when trying...

Read more »