Translation(s): none

PXELinux Style Netboot for Dream Plug

These notes assume you already have a dhcp and tftp server installed on your network. If you do not you will need to read other documentation.

If you have a dhcp and tftp server on your network you can eaisly have a pxelinux style netboot setup for your dreamplug through the use of u-boot script files.

U-boot setup

Make a netboot macro in the environment:

setenv netboot 'dhcp 0x800000;source 0x800000'
saveenv

Run it with:

run netboot

For network flashing of u-boot also add this macro:

setenv netflash 'dhcp 0x800000; tftpboot 0x800000 dreamplug/flash.scr ; source 0x800000'
saveenv

Run it with:

run netflash

dhcp config

Set the bootfile to be "dreamplug.scr" (much like you would set the bootfile to be pxelinux.0 for an i386 PC). Set the next-server to be your tftp server

tftpserver config

Ensure you have the mkimage command available  apt-get install u-boot-tools 

dreamplug.scr

In the root of your tftp tree place the following text file:

#mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "dreamplug" -d dreamplug.txt dreamplug.scr
tftpboot 0x900000 dreamplug/${ethaddr}.scr
source 0x900000
tftpboot 0x900000 dreamplug/${ipaddr}.scr
source 0x900000
tftpboot 0x900000 dreamplug/default.scr 
source 0x900000

And then compile up to the .scr file with the command in the commented first line:

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "dreamplug" -d dreamplug.txt dreamplug.scr

This script will try to load and run "dreamplug/${ipaddr}.scr" fom your tftp server and if that fails "dreamplug/default.scr"

So we need to put a default.scr in place.

dreamplug/default.scr

In the root of your tftp tree create a "dreamplug" directory and in that directory create:

#mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "default" -d default.txt default.scr

tftpboot 0x00800000 dreamplug/uImage
tftpboot 0x01100000 dreamplug/uInitrd
setenv bootargs console=ttyS0,115200
bootm 0x00800000 0x01100000 

And again compile it thus:

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "default" -d default.txt default.scr

Assuming you want the default.scr to boot the debian installer then you will want to download the installer images. so in the dreamplug subdirectory run:

wget http://http.debian.net/debian/dists/wheezy/main/installer-armel/current/images/kirkwood/netboot/marvell/dreamplug/uImage
wget http://http.debian.net/debian/dists/wheezy/main/installer-armel/current/images/kirkwood/netboot/marvell/dreamplug/uInitrd

dreamplug/auto.scr

Now you may want to automate the debian installer with preseeding so considder creating an auto.txt file based on this:

#mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "auto" -d auto.txt auto.scr

tftpboot 0x00800000 dreamplug/uImage
tftpboot 0x01100000 dreamplug/uInitrd
setenv bootargs auto=true interface=eth0 netcfg/dhcp_timeout=90 url=mybootserver priority=critical classes=partition/hand -- ipv6.disable_ipv6=1 console=ttyS0,115200
bootm 0x00800000 0x01100000 

And compiling it with:

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "auto" -d auto.txt auto.scr

Now (assuming you have staticaly assigned dhcp config) you can make a specific machine with IP 192.168.123.456 netboot the auto installer by placing a symlink:

ln -s auto.scr 192.168.123.456.scr

I can never remember IP addresses so I use a 2 level sym-link indirection to help my memory:

ln -s myhostname 192.168.123.456.scr
ln -s auto.scr myhostname

dreamplug/flash.scr

If you want to be able to flash u-boot over the network then you may want this script in you dreamplug subrirectory.

flash.txt

echo ethaddr ${ethaddr} ; echo eth1addr ${eth1addr} 
tftpboot 0x6400000 dreamplug/u-boot.kwb
sf probe 0
echo ERASING FLASH
sf erase 0x0 0x100000
echo FLASHING UPDATE
sf write 0x6400000 0x0 0x${filesize}
echo FLASH COMPLETE
echo Now \"reset\" and  \"setenv ethaddr ${ethaddr} \; setenv eth1addr ${eth1addr} \; saveenv\"

compile up with:

mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "flash" -d flash.txt flash.scr

The u-boot.kwb can be extracted from the armel deb

cd /var/tmp/
# Download the u-boot package from the Debian repository.
wget http://http.debian.net/debian/pool/main/u/u-boot/u-boot_2012.04.01-2_armel.deb 
#Unpack deb
dpkg-deb -x u-boot_2012.04.01-2_armel.deb u-boot_2012.04.01-2_armel 
#copy to dreamplug dir under tftp root.
cp u-boot_2012.04.01-2_armel/usr/lib/u-boot/dreamplug/u-boot.kwb /tftpboot/dreamplug/ 

Resources

Attachments

Some configuration files and sample outputs.

Credits