153
edits
(removing long lines) |
(Correction in a command line) |
||
| (21 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
== State of the project == | |||
<font color="red">'''READ FIRST'''</font> | |||
This project is officially on HOLD. It will be active again after transition branch is completely merged. If you want to know more details about this project and next steps, please check this [http://gioyik.com/p/raspberrypi-final-state blog post] | |||
== About The Project == | == About The Project == | ||
[[File:Fxpi.png|250px|thumbnail|right]] | |||
We are looking to demonstrate that Firefox OS can be a viable and valuable operating system for a range of development boards and hardware related to IoT | We are looking to demonstrate that Firefox OS can be a viable and valuable operating system for a range of development boards and hardware related to IoT | ||
| Line 6: | Line 12: | ||
<font color="red">'''WARNING'''</font>: this guide is specific for the <font color="green">'''Raspberry PI B+ 2'''</font>, older models have a different chipset and newest model have not been tested. | <font color="red">'''WARNING'''</font>: this guide is specific for the <font color="green">'''Raspberry PI B+ 2'''</font>, older models have a different chipset and newest model have not been tested. | ||
The initial goal is release a downloadable and flashable version of Firefox OS for Raspberry Pi B+ 2 board and a step by step guide to let everybody create their our roms using the B2G build system. | The initial goal is release a downloadable and flashable version of Firefox OS for Raspberry Pi B+ 2 board and a step by step guide to let everybody create their our roms using the B2G build system. The meta bug for this project is [https://bugzilla.mozilla.org/show_bug.cgi?id=1225139 bug 1225139] | ||
== Project Management Team == | == Project Management Team == | ||
| Line 26: | Line 32: | ||
== What We'd Like To See Happen == | == What We'd Like To See Happen == | ||
* Start the path of the new strategy '''Connected Devices''' with this port | |||
* Let the community be part of the success in this project. | |||
* Bring RPi users more options (operating systems) for their next project | |||
* Push the Web of things forward | |||
* Enable programmers (via DOM/CSS) to develop robotics and other IoT projects | |||
== Limitations == | == Limitations == | ||
| Line 32: | Line 43: | ||
* VC4 driver is still on development | * VC4 driver is still on development | ||
* Sometimes slow and buggy | * Sometimes slow and buggy | ||
* Not all device capabilities are exposed through Web APIs | |||
* Small/integrated display not planned to support soon | |||
== Development Sprints == | == Development Sprints == | ||
| Line 50: | Line 60: | ||
* '''Android devices files for RP2''' <font color="green">'''[DONE]'''</font> | * '''Android devices files for RP2''' <font color="green">'''[DONE]'''</font> | ||
** B2G build system uses AOSP that requires a repo with device configuration. Folder and files like AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_rpi2.mk, recovery.fstab, and more will be created or adapted to RPI 2 architecture | ** B2G build system uses AOSP that requires a repo with device configuration. Folder and files like AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_rpi2.mk, recovery.fstab, and more will be created or adapted to RPI 2 architecture | ||
* '''Make RPI 2 kernel build from source''' <font color=" | * '''Make RPI 2 kernel build from source''' <font color="green">'''[DONE]'''</font> | ||
** Create a sync configuration for BoardConfig.mk file to build the kernel and any required kernel modules automatically. | ** Create a sync configuration for BoardConfig.mk file to build the kernel and any required kernel modules automatically. | ||
* '''Create manifest file for RPI 2''' <font color="green">'''[DONE]'''</font> | * '''Create manifest file for RPI 2''' <font color="green">'''[DONE]'''</font> | ||
| Line 56: | Line 66: | ||
==== Phase 2 ==== | ==== Phase 2 ==== | ||
* '''Add libraries''' | * '''Add libraries''' <font color="green">'''[DONE]'''</font> | ||
** In the device specific files during compilation process there are necessary includes to specific libraries | ** In the device specific files during compilation process there are necessary includes to specific libraries | ||
* '''Configure modules''' | * '''Configure modules''' <font color="green">'''[DONE]'''</font> | ||
** In the device specific files is necessary to add external modules/files to be compiled and binary generated | ** In the device specific files is necessary to add external modules/files to be compiled and binary generated | ||
* '''Kernel configuration for RPI 2''' <font color="green">'''[DONE]'''</font> | * '''Kernel configuration for RPI 2''' <font color="green">'''[DONE]'''</font> | ||
| Line 68: | Line 78: | ||
* '''Automated Android builds server''' <font color="orange">'''[WORKING]'''</font> | * '''Automated Android builds server''' <font color="orange">'''[WORKING]'''</font> | ||
** Jenkins or TaskCluster running to make automated builds of Android for the RPI 2. | ** Jenkins or TaskCluster running to make automated builds of Android for the RPI 2. | ||
* '''Update documentation''' <font color="green">'''[DONE]'''</font> | |||
* '''Update documentation''' <font color=" | |||
** Update building steps and requirements with new ones for Raspberry PI 2 | ** Update building steps and requirements with new ones for Raspberry PI 2 | ||
| Line 80: | Line 88: | ||
* '''Gecko Port''' <font color="green">'''[DONE]'''</font> | * '''Gecko Port''' <font color="green">'''[DONE]'''</font> | ||
** Having a basic Android base system the next priority is get Gecko working. This will help to identify easily more problems in the final ROM | ** Having a basic Android base system the next priority is get Gecko working. This will help to identify easily more problems in the final ROM | ||
* '''Graphics support''' | * '''Graphics support''' <font color="green">'''[DONE]'''</font> | ||
** In this project there is a challenge, and that’s the correct graphics support. RPI 2 has a VideoCore with a Broadcom BCM2739 that changed a lot in this latest version of the RPI 2. Will be necessary take a look of Broadcom reference guides | ** Use hardware default renderer. | ||
* '''Update documentation''' | ** In this project there is a challenge, and that’s the correct graphics support. RPI 2 has a VideoCore with a Broadcom BCM2739 that changed a lot in this latest version of the RPI 2. Will be necessary take a look of Broadcom reference guides | ||
* '''Update documentation''' <font color="green">'''[DONE]'''</font> | |||
** Create page about Firefox OS architecture on the Raspberry PI 2 | ** Create page about Firefox OS architecture on the Raspberry PI 2 | ||
==== Phase 2 ==== | ==== Phase 2 ==== | ||
* '''Input support''' | * '''Input support''' <font color="blue">'''[PARTIAL DONE]'''</font> | ||
** Keyboard and mouse support is one of the P1 for Raspberry PI port. The basic support for Keyboard would be on early stages of Android building. | ** Keyboard and mouse support is one of the P1 for Raspberry PI port. The basic support for Keyboard would be on early stages of Android building. | ||
* '''Storage support''' | ** Mouse support: https://bugzilla.mozilla.org/show_bug.cgi?id=1082892 | ||
* '''Storage support''' <font color="green">'''[DONE]'''</font> | |||
** Add support to SD Card recognition and USB storage devices | ** Add support to SD Card recognition and USB storage devices | ||
* '''Connection support''' | * '''Connection support''' <font color="blue">'''[PARTIAL DONE]'''</font> | ||
** Work on WiFi and Ethernet support and add listeners for every time you plug or unplug it to the board. Usually it recognizes Ethernet connection if is connected before booting. | ** Work on WiFi and Ethernet support and add listeners for every time you plug or unplug it to the board. Usually it recognizes Ethernet connection if is connected before booting. | ||
* '''ADB Push''' <font color="green">'''[DONE]'''</font> | |||
** Enable support to push apps by ADB connection | |||
==== Phase 3 ==== | ==== Phase 3 ==== | ||
* '''Generate complete/stable/usable Firefox OS build''' | * '''Generate complete/stable/usable Firefox OS build''' <font color="green">'''[DONE]'''</font> | ||
** After all the base system is working and running, I will create builds to distribute and | ** After all the base system is working and running, I will create builds to distribute and publish them. | ||
* '''Flashing files''' | * '''Flashing files''' <font color="green">'''[DONE]'''</font> | ||
** The Raspberry PI could not be flashed correctly with common Fastboot method, is necessary to create a filesystem that will be copied to the SD card | ** The Raspberry PI could not be flashed correctly with common Fastboot method, is necessary to create a filesystem that will be copied to the SD card | ||
* ''' | * '''Update documentation''' <font color="green">'''[DONE]'''</font> | ||
** Update flashing guide with steps for Raspberry PI 2 | ** Update flashing guide with steps for Raspberry PI 2 | ||
==== Phase 4 ==== | ==== Phase 4 ==== | ||
* '''Gaia Port''' | * '''Gaia Port''' <font color="green">'''[DONE]'''</font> | ||
** The Gaia port will be ready only when the graphics support is done, added to this, maybe will be some display/resolution limitations if the graphic support is not fully implemented or there are missing parts. | ** The Gaia port will be ready only when the graphics support is done, added to this, maybe will be some display/resolution limitations if the graphic support is not fully implemented or there are missing parts. | ||
* '''Remove unnecessary apps''' | * '''Remove unnecessary apps''' | ||
** Apps like Radio, Dialer, Messages and others are not necessary due Raspberry PI 2 itself doesn’t have hardware components to be used with those apps. | ** Apps like Radio, Dialer, Messages and others are not necessary due Raspberry PI 2 itself doesn’t have hardware components to be used with those apps. | ||
* ''' | * '''NOOBS installer''' <font color="green">'''[DONE]'''</font> | ||
** | ** Add support to install B2G using NOOBs installer | ||
* '''Update documentation''' <font color="orange">'''[WORKING]'''</font> | |||
* ''' | ** Blog post on Hacks Blog | ||
** | |||
== Build From Source == | == Build From Source == | ||
| Line 128: | Line 129: | ||
Be sure of have those libraries installed to avoid compiling problems. On Ubuntu would be: | Be sure of have those libraries installed to avoid compiling problems. On Ubuntu would be: | ||
sudo apt-get install libfontconfig1 libXrender1 libXcomposite1 | sudo apt-get install libfontconfig1 libXrender1 libXcomposite1 libgtk2.0-0 libxt6 unzip python-pip gettext libasound2 | ||
Installing pip dependencies for LibMesa: | |||
pip install Mako --upgrade | |||
To build b2g for your Raspberry Pi B+ 2, first download the b2g helper scripts | To build b2g for your Raspberry Pi B+ 2, first download the b2g helper scripts | ||
| Line 137: | Line 142: | ||
cd B2G | cd B2G | ||
./config.sh | ./config.sh rpi2b-l | ||
The config.sh step can take quite a while, because it downloads a large amount of data. Finally, build b2g | The config.sh step can take quite a while, because it downloads a large amount of data. Finally, build b2g | ||
| Line 145: | Line 150: | ||
This step also takes some time, because it's building an entire operating system. When your build finishes, it's time to flash it onto an SD card for your RPi. | This step also takes some time, because it's building an entire operating system. When your build finishes, it's time to flash it onto an SD card for your RPi. | ||
== | == Prepare To Flash == | ||
<font color="red">'''WARNING'''</font>: The process described here will erase all the data in your SD card. Be sure of not lose sensitive data inside the card. | |||
You need a 4Gb SD card at least, if has more space better. Then create partitions and copy the files to let the Raspberry PI boot Firefox OS. | |||
=== Configure UDEV rules for the SD card === | |||
By configuring udev rules for the specific SD card you are going to use for B2G, you will avoid the need to pass via root access (e.g., '''sudo dd''') to be able to copy data. This also limits the risks of doing '''dd''' to the wrong device and mess with everything. This is documented for use with a sd card integrated reader, but this should be able to work elsewhere. | |||
First, plug your sdcard and identify its serial: | |||
$ udisksctl status | |||
MODEL REVISION SERIAL DEVICE | |||
-------------------------------------------------------------------------- | |||
[...] | |||
SL08G 0xa0442a9f mmcblk0 | |||
So in this case, '''/dev/mmcblk0''' has serial number '''0xa0442a9f'''. You can now unplug the card for now. | |||
The populate a file in '''/etc/udev/rules.d/''', let be its name '''52-mmcblk.rules'''. And put the following content: | |||
# µSD B2G | |||
SUBSYSTEM=="block", SUBSYSTEMS=="mmc", DRIVERS=="mmcblk", ATTRS{serial}=="0xa0442a9f", MODE="0666", GROUP="plugdev" | |||
Make sure you have '''ATTRS{serial}=="0xa0442a9f"'''. Rule will match any '''mmcblk''' exposed device whose attribute serial is 0xa0442a9f. If it matches, then it will set permissions 0666 and group plugdev. Save this file, and issue a udev reload: | |||
# udevadm control --reload | |||
Now, if you replug the sdcard, it should be set with the proper permissions in /dev. | |||
=== Partitions for the SD card === | === Partitions for the SD card === | ||
| Line 192: | Line 183: | ||
Create 4 partitions in next order and be careful with the sized of each one. | Create 4 partitions in next order and be careful with the sized of each one. | ||
boot (Partition 1) = Size [ | boot (Partition 1) = Size [48MB] = Format as fat32, tag bootable flag | ||
system (Partition 2) = Size [537MB] = Format as new primary partition or ext4 | system (Partition 2) = Size [537MB] = Format as new primary partition or ext4 | ||
cache (Partition 3) = Size [512MB] = format as ext4 | cache (Partition 3) = Size [512MB] = format as ext4 | ||
data (Partition 4) = Size [Rest of free space] = format as ext4 | data (Partition 4) = Size [Rest of free space] = format as ext4 | ||
=== | === Installing on the SD card === | ||
For a first time installation, you will have to flash all partitions. Images have been produced in the '''out/target/product/rpi2b''' directory and you should flash: | |||
# boot.img to Partition 1 | |||
# system.img to Partition 2 | |||
# cache.img to Partition 3 | |||
# userdata.img to Partition 4 | |||
Please proceed with the '''dd''' command (and replace '''file''' with the proper file name): | |||
dd if=file of=/dev/XpY bs=1m | |||
Be sure of check that everything is copied successfully on the partition. For this port we create a ''userdebug'' build, so, everything is inside system image. Usually, '''X''' will be the name of your device and '''pY''' should be replaced by the partition number. For example, a SD card reader might expose this as: '''/dev/mmcblk0p1''' for boot partition (Partition 1). | |||
Remember to NOT flash cache and/or userdata images if you are just '''updating''' your system, except if you are sure or instructed to do so. Doing this will result in your data being erased. | |||
=== Faster flashing === | |||
You can also make use of '''bmaptool''' to flash faster than with '''dd'''. [http://git.infradead.org/users/dedekind/bmap-tools.git bmaptool repo]. | |||
==== Produce bmap files ==== | |||
Once you have built the system, produce bmap files: | |||
$ bmaptool create -o out/target/product/rpi2b/PARTITION.bmap out/target/product/rpi2b/PARTITION.img | |||
You can do this for each '''PARTITION''' that we have: boot, system, cache and userdata. | |||
==== Flashing with bmaptool ==== | |||
Then flash using bmaptool (here only boot partition): | |||
$ sudo bmaptool copy out/target/product/rpi2b/boot.img /dev/mmcblk0p1 | |||
bmaptool: info: discovered bmap file 'out/target/product/rpi2b/boot.bmap' | |||
bmaptool: info: block map format version 2.0 | |||
bmaptool: info: 12288 blocks of size 4096 (48.0 MiB), mapped 2358 blocks (9.2 MiB or 19.2%) | |||
bmaptool: info: copying image 'boot.img' to block device '/dev/mmcblk0p1' using bmap file 'boot.bmap' | |||
bmaptool: info: 100% copied | |||
bmaptool: info: synchronizing '/dev/mmcblk0p1' | |||
bmaptool: info: copying time: 0.6s, copying speed 16.1 MiB/sec | |||
Using '''dd''' on the same partition reports a write speed of 5.0MiB/s. | |||
== Debugging == | == Debugging == | ||
| Line 290: | Line 302: | ||
The Console lead has four female connections that can be plugged directly onto the GPIO header of the Raspberry Pi. The Adafruit USB console cable has 3.3V logic, so its safe to use with your Pi. | The Console lead has four female connections that can be plugged directly onto the GPIO header of the Raspberry Pi. The Adafruit USB console cable has 3.3V logic, so its safe to use with your Pi. | ||
[[File: | [[File:RPi2B_Debug_Kit.jpg|300px]] | ||
For this experiment, the serial lead is going to power the Raspberry Pi. So, DO NOT attach the Pi's USB power adapter. If you would rather power the Pi from your USB power adapter then leave the Red lead from the Serial lead un attached. | For this experiment, the serial lead is going to power the Raspberry Pi. So, DO NOT attach the Pi's USB power adapter. If you would rather power the Pi from your USB power adapter then leave the Red lead from the Serial lead un attached. | ||
| Line 298: | Line 310: | ||
Attach the leads as shown below: | Attach the leads as shown below: | ||
[[File: | [[File:Rpi2-serial-cable-connection.jpg|250px]] | ||
The connections are to the outside pin connections of the GPIO header. | The connections are to the outside pin connections of the GPIO header. | ||
| Line 307: | Line 319: | ||
* The <font color="green">'''green'''</font> lead to RXD. | * The <font color="green">'''green'''</font> lead to RXD. | ||
Now plug in the USB lead and you will see the Pi's power LED should light. | Now plug in the USB lead and you will see the Pi's power LED should light. | ||
===Boot messages=== | ===Boot messages=== | ||
| Line 323: | Line 335: | ||
and so on. Eventually, you should see a login prompt: | and so on. Eventually, you should see a login prompt: | ||
shell@ | shell@rpi2b:/ $ | ||
You can then log in as you would with a keyboard and screen. | You can then log in as you would with a keyboard and screen. | ||
| Line 335: | Line 347: | ||
== Need Help? == | == Need Help? == | ||
* IRC channel '''#fxos''' (Ping '''Gioyik''') | |||
* Fill a bug on bugzilla | |||
* Send an email to '''fxos''' mailing list | |||
[[Category:Firefox OS]] | [[Category:Firefox OS]] | ||
[[Category:Raspberry Pi]] | [[Category:Raspberry Pi]] | ||
edits