Auto-tools/Projects/Pandaboard Setup

From MozillaWiki
Jump to: navigation, search

Bringing up a panda board is a bit different than a Tegra machine. With the pandas we will be building our own Android OS and we will be only doing that once in a while (when a new version is released). This page contains the information on how to build that image and flash a first image to a panda as well as how to re-use that image to flash additional pandas (w/o going through the build process).

Using Linaro Pre-Built Images (WHAT WE ARE USING)

  • Locate boot partition on SD card, modify boot.txt (u-boot script) line to read:
setenv initrd_high "0xffffffff"
setenv fdt_high "0xffffffff"
setenv 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 omapdss.def_disp=dvi omapdss.hdmimode=0 omapdss.mode=dvi:640x480MR-24@60 consoleblank=0"
setenv bootandroid "echo Booting Android from SDcard; fatload mmc 0:1 0x80200000 uImage; fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80200000 0x81600000"
setenv bootpxefirst "echo Launching PXE boot... ; if usb start; then set autoload no; bootp; setenv serverip 10.12.48.27; if pxe get; then pxe boot; else run bootandroid; fi; fi"
run bootpxefirst

NOTE: to build the boot.scr without pxebooting, change 'run bootpxefirst' to 'run bootandroid'. This can be helpful for images being debugged or developed on since the pxeboot step adds a couple minutes to the boot time.

  • Still in boot partition, regenerate boot.scr:
    • mkimage -A arm -T script -O linux -C none -a 0 -e 0 -n "boot.scr" -d boot.txt boot.scr
  • Put SD card in pandaboard and boot it
  • adb shell date $(date +%s)
  • Fix DHCP on eth0 by loading Settings app on device, click "Ethernet Configuration" under "Wireless & Networks", click "Ethernet Configuration", then click on the list under "Ethernet Devices" and select "eth0". Click "Save".
  • Replace su command (from adb shell):
    • wget people.mozilla.com/~wlachance/su # https://github.com/wlach/orangutan/blob/master/su.c
    • adb remount # this is the same as: mount -o remount,rw -t ext4 /dev/block/mmcblk0p2 /system
    • adb shell cp /system/xbin/su /system/xbin/su.old
    • adb push su /system/xbin/su
    • adb shell chmod 4755 /system/xbin/su
    • adb reboot
  • To get rid of annoying live wallpaper, install http://code.google.com/p/black-npe-live-wallpaper/ (wallpaper images fail due to not enough gfx memory)
  • Install SUTAgent and Watcher (http://people.mozilla.org/~jmaher/sutagent/)
  • Start watcher by hand:
    • adb shell am start -a android.intent.action.MAIN -n com.mozilla.watcher/.WatcherMain

Building a new kernel

Making an OS Image For Distribution

Once you have a built, working androidOS on your pandaboard you will want to re-distribute it. Follow these steps (and note they may change in the future).

  1. Install SUTAgent and Watcher you want
    • These are built by the Fennec Build process, we also usually host them on people when we have an "official" version of the agent.
    • No Gainroot step is required (because if we build panda-full_eng then we are always rooted, if that changes then this may change)
    • Start Watcher by hand (hack for now on ICS only): am start -a android.intent.action.MAIN -n com.mozilla.watcher/.WatcherMain
  2. Put sdcard you flashed the OS on in the "Build and OS" section into your sdcard reader.
  3. Use mount to figure out the device name of the sdcard reader and do:
  4. dd if=<sdcarddevice> of=panda.img bs=100M
  5. Now you can use panda.img to flash other sdcards.

Flashing More SDCards

Once you have a "golden master" image you can use it to stamp out sdcards easily.

  1. Insert blank sdcard into your machine's card reader
  2. dd if=panda.img of=<sdcarddevice> bs=100M
  3. Put the flashed sdcard into a new pandaboard and plug in the power adapter.
    • Note: If you plug in both the power adapter and the USB cord at the same time, panda will go into fastboot mode, which is not what you want. Plug in power, boot, then plug in usb.

Bugs, Remaining issues

  • bug 786414 - crash while trying to update sut agent via 'updt' command.