This write up details who to netboot an Android kernel using PXE. This is super useful if you recompile the kernel a lot because you won't have to unplug, program and replug in an SD card every time the kernel changes.

You will need

  • Serial to USB cable (more than likely)
  • SD card (get a 16 GB class 10 from Samsung, they're pretty good)
  • 4430 or 4460 Pandaboard
  • USB mouse
  • USB keyboard
  • HDMI cable
  • HDMI monitor
  • Ethernet cable
  • DHCP router
  • Host computer connected to the internet via the DHCP router thats running ubuntu 12.04 LTS (64-bit, Intel® Core™ i7-2760QM CPU @ 2.40GHz × 8, 30 Mbps download, 5 Mbps upload)

Initial Steps

Go to https://android-build.linaro.org/builds/~linaro-android/panda-ics-gcc47-tilt-tracking-blob/. Download and run linaro_android_build_cmds.sh to create an Android build for Panda.

Follow the directions on https://android-build.linaro.org/builds/~linaro-android/panda-ics-gcc47-tilt-tracking-blob/ to program an SD card.

Set up a 4430 or 4460 Pandaboard from TI. Connect the serial port to your host computer. Connect Ethernet to a DHCP capable router (like a Linksys WRT54GL). Connect an HDMI monitor to the HDMI 1080p port, a USB keyboard and USB mouse to the USB ports and a 5V, 2A power supply.

On the host computer start minicom

minicom -D /dev/ttyUSB0 -w -C minicom.txt

Connect the SD card you just programmed and turn the system on to make sure it boots. During boot make a note of the bootargs:

console=ttyO2,115200n8 rootwait ro earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000 init=/init androidboot.console=ttyO2

Get the tftp running on the Host

Install xinetd, tftpd and tftp:

sudo apt-get install xinetd tftpd tftp

Edit the config:

sudo emacs /etc/xinetd.d/tftp

Copy this in and save the file:

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = /tftpboot
disable         = no
}

Create /tftpboot on the host and make sureit has the right permissions

sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot

Start xinetd

sudo start xinetd

Get your IP Address (look at the eth0 entry)

ifconfig

Test you tftp using the test on http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in-ubuntu/.

Do a Test PXE Boot (this will fail)

Boot the unit and interrupt it while its in u-boot

Enter (replace 192.168.1.106 with what you got from ifconfig above)

setenv serverip 192.168.1.106
setenv pxecfg_ram 0x88000000
setenv kernel_ram 0x80000000
setenv initrd_ram 0x81600000
setenv autoload no
usb start
bootp
setenv serverip 192.168.1.106
pxe get

The pxe get will fail with output like:

Retrieving file: pxelinux.cfg/C0A80172

Note this

Create a file called /tftpboot/pxelinux.cfg/C0A80172 with

default panda-linaro
prompt 0
timeout 3

label panda-linaro
kernel /tftpboot/pxelinux.cfg/uImage
append console=ttyO2,115200n8 rootwait ro earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000 init=/init androidboot.console=ttyO2
initrd /tftpboot/pxelinux.cfg/uInitrd

Note what comes after "append."

Copy the uImage and uInitrd from the build to /tftpboot/pxelinux.cfg/

cd out/target/product/pandaboard
cp uImage /tftpboot/pxelinux.cfg
cp uInitrd /tftpboot/pxelinux.cfg

You'll do this every time when you recompile the kernel

Now boot the unit and interrupt the boot. Type

setenv serverip 192.168.1.106
setenv pxecfg_ram 0x88000000
setenv kernel_ram 0x80000000
setenv initrd_ram 0x81600000
setenv autoload no
usb start
bootp
setenv serverip 192.168.1.106
pxe get
pxe boot

...and you should be good to go.

Thank You's and Attributions

Thank you to Ricardo Salveti's for his blog post: http://rsalveti.wordpress.com/2011/07/11/net-booting-with-tftp-and-pxe-with-pandaboard/

Thank you to John Rigby for telling me about it and "usb start"

and thank you to http://www.davidsudjiman.info/2006/03/27/installing-and-setting-tftpd-in-ubuntu/

Platform/Android/NetbootAndroidKernel (last modified 2013-08-12 07:27:31)