Changes

Jump to: navigation, search

Hacking b2g on Raspberry Pi

729 bytes added, 16:00, 23 October 2014
Preparing a development environment
== Preparing a development environment ==
To hack b2g on the RPi, you'll want need to set up a few thingscreate an adb connection. First, a serial console adb is strongly recommended. (A serial console the "android debug bridge" over which diagnostic output is basically required for kernel received and developmentcommands are sent.) You can purchase a serial-to-Usually an adb connection is made over USB or serial-port connector for your , but the RPi, [https://www.adafruit.com/products/954 's USB ports can't be configured for example this one from adafruit]slave mode. Some RPi kits also include one of these. The adapter shown above requires you to connect the black lead to pin 6 (ground), the white lead to pin 8 (GPIO14, UART0_TXD), On Models B and the green lead to pin 10 (GPIO15, UART0_RXDnewer.). You don't need to connect the red lead if your RPi already has a power source.
You can connect adb over TCP/IP, though. You have the option of connecting over wifi or ethernet. To connect over wifi, first join the wireless LAN that your host machine is on. <font size="5" color="red">'''WARNINGWARNING WARNING</font>: FFOS builds for the RPi are intended for DEVELOPERS. They are <font size="5" color="red">WILDLY INSECURE</font>. Don't connect your RPi to a network on which you don't mind it getting <font size="5" color="red">completely pwned</font>. Next, find your wifi card's IP address through the gaia settings app. Call this address <code>$IP</fontcode>. Finally, on your host machine, run  adb connect $IP: be very careful 5555 (5555 is the port that you the adb server on your RPi listens on.) Alternatively, to connect over ethernet, first connect the leads your RPi's ethernet cable to the correct pins! your LAN. The <em>SAME CAVEATS ABOUT SECURITY</em> apply. At least one developer has burned Next, boot up your RPi and find out its IP address on your LAN. You can do this by either looking at your network router's client table (easy), or running the following command on your RPi's serial console (a USB-little harder; see instructions below on how to-set up a serial adapter by connecting the wrong pins.console)
The b2g kernel is pre-configured to open a serial console for the RPi, so all you need to do is plug the USB cable into your host machine and start up a terminal emulator. The <code>minicom</code> program works well. On ubuntu, install minicom with the commandnetcfg
Let's call your RPi's address <code>$IP</code>. sudo apt-get install minicomConnect adb by running the following command on your host machine
Then adb connect to your RPi using the command$IP:5555
minicom -b 115200 -o -D /dev/ttyUSB0To test your adb connect, run the following command on your host
(Replacing <code>/dev/ttyUSB0</code> with the device assigned to your USB-to-serial adapter, if it's not assigned that name.) You should then see terminal output and get a shell prompt.adb logcat
Note: you must run minicom in You should see a "smart terminal"long list of diagnostic messages. minicom doesn't work when run inside an emacs shell, and it errors out with a somewhat cryptic message ("No cursor motion capability (cm)")Pressing Ctrl-c stops the logcat output.
You must create an In addition to adb connection for your RPi, a serial console is strongly recommended. adb A serial console is the "android debug bridge" over which diagnostic output is received and basically required for anyone doing networking or kernel development commands are sent. Usually an adb connection is made over You can purchase a serial-to-USBor serial-port connector for your RPi, but the [https://www.adafruit.com/products/954 for example this one from adafruit]. Some RPi's USB ports can't be configured for slave modekits also include one of these. The adapter shown above requires you to connect the black lead to pin 6 (On Models B ground), the white lead to pin 8 (GPIO14, UART0_TXD), and newerthe green lead to pin 10 (GPIO15, UART0_RXD). You don't need to connect the red lead if your RPi already has a power source.)
You can <font size="5" color="red">'''WARNING'''</font>: be very careful that you connect adb through the RPi's ethernet port, however. leads to the correct pins! To connect adb over ethernet, you need At least one developer has burned out a USB-to find out your RPi's IP address on your LAN. You can do this -serial adapter by either looking at your network router's client table, or running connecting the following command on your RPi's serial consolewrong pins.
The b2g kernel is pre-configured to open a serial console for the RPi, so all you need to do is plug the USB cable into your host machine and start up a terminal emulator. netcfgThe <code>minicom</code> program works well. On ubuntu, install minicom with the command
Once you know your RPi's IP address, connect adb by running the following command on your host machine sudo apt-get install minicom
adb Then connect $IP:5555to your RPi using the command
replacing <code>$IP< minicom -b 115200 -o -D /dev/code> with your RPi's IP address, of course. (5555 is the port that the adb server on your RPi listens on.) To test your adb connect, run the following command on your hostttyUSB0
(Replacing <code>/dev/ttyUSB0</code> with the device assigned to your USB-to-serial adapter, if it's not assigned that name.) adb logcatYou should then see terminal output and get a shell prompt.
You should Note: you must run minicom in a long list of diagnostic messages"smart terminal". Pressing Ctrl-c stops the logcat outputminicom doesn't work when run inside an emacs shell, and it errors out with a somewhat cryptic message ("No cursor motion capability (cm)").
== Rebuilding b2g and updating your RPi ==
Confirm
699
edits

Navigation menu