B2G/Porting: Difference between revisions

From MozillaWiki
< B2G
Jump to navigation Jump to search
(Turned the page as a project management one : (as) the porting guide is (more up-to-date) on MDN)
Line 1: Line 1:
= B2G porting guide for new build system =
This page is for porting projects management. It should help you to setup a porting project and make it successful.
It then list all porting projects by device and progress.


This is a guide to support new device to [https://github.com/mozilla-b2g/B2G new B2G build system].
If you are looking for a guide to support a new device, you should check the MDN page [https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS/Porting Porting Firefox OS].
The actual porting details might differ a lot between different devices.


== Clone B2G repo ==
= Setting up a new porting project =


<pre>
== Announce your project ==
$ git clone https://github.com/mozilla-b2g/B2G.git
</pre>


== Create local backup of the original Android system ==
The first thing to do is to get in touch with a mozillan responsible for porting, device or that already has port a device. You can do that over IRC channel [irc://irc.mozilla.org/b2g #b2g] and ask for Dietrich Ayala (:dietrich).


<pre>
== Build your project's tools ==
$ mkdir my_device_backup
$ cd my_device_backup
$ adb pull /system system
</pre>


== Add new device in config.sh ==
You can then start by building your device porting project management wiki page as a sub page of the [https://wiki.mozilla.org/FirefoxOS/ Firefox OS one].
You can use the [https://wiki.mozilla.org/FirefoxOS/Fairphone Fairphone] one as a reference.


You may refernece "galaxy-s2" in config.sh as a template.
The proposed structure of that page is:
 
*Ignition project todo list: everything you have to do before starting porting. After building this page that could be:
== Create manifest file "default.xml" for new device ==
**Contact the device maker: coordinate and improve collaboration.
 
**Announce your project on the b2g mailing-list.
Add all required repos to manifest file for the new device.
*Device targeted: make it clear which one it is, especially if there are different versions, releases, editions.
You can reference https://github.com/mozilla-b2g/b2g-manifest as a template,  
*Resources:
there are different branches for each device.
**Project coordinator & evangelist: give your name and ways to contact you.
The [https://github.com/mozilla-b2g/b2g-manifest/blob/master/galaxy-s2.xml  Galaxy-S2] branch can be used as a reference.
**Technical lead: if that's not you tell who.
 
**Wiki page: link here the page you are creating
== Create configuration tree for new device ==
**IRC channel: link here any specific IRC relevant channel. You can find any relevant information on the [https://wiki.mozilla.org/IRC IRC wiki page].
 
**Mozillian group: if you are a [https://mozillians.org/ mozillian] (or became one) you can join/setup a group about this device.
You need to create a new configration tree for new device at device/<manufacturer>/<device_id>
**Meta/tracking bug: Open a bug in [https://bugzilla.mozilla.org/enter_bug.cgi bmo] with Product=Firefox OS & Component=General.
 
**Porting community page: link to any porting page like XDA-Forums.
The tree should include at least:
**Sumo thread: if there is one started, list it here.
* AndroidBoard.mk
*Contributing: Tell others that want to get involved in the project how to.
* AndroidProducts.mk
*Progress:
* BoardConfig.mk
**Starting point: tell the state of the porting or give info about anything that give a root to your porting project.
* extract-files.sh
**Bug table: add a bugzilla table to give an overview of the bugs. Adapt the following code and add it to you wiki page:
* full_<device_id>.mk
* idc files for touchscreen
* init files (init.rc, init.<target>.rc, uevent.rc...)
 
The content might differ a lot between devices, especially "BoardConfig.mk" and "extract-files.sh".
It requires some hacking/testing/debugging to know which binary blobs should be extracted.
If you can find some existing reference on [http://www.cyanogenmod.com CyanogenMod] for the device, it will speed up the porting progress.
The [http://forum.xda-developers.com XDA Forum] is also a good place to discuss and check for resource.
 
== The need to rebuild boot.img ==
 
Basically no change is required for kernel, the purpose to rebuild boot.img is for required init.rc change.
 
=== Required change on init.rc ===
The init.rc is '''not''' the one provided by b2g, it has to be pulled from the phone.
 
Main things to modify on init.rc:
* Import init.b2g.rc
<pre>
on early-init
    start ueventd
    import /init.b2g.rc
</pre>
 
* chmod 755 on /system/b2g/b2g, /system/b2g/updater, /system/b2g/plugin-container (put these after mounting system read/write)
<pre>
<pre>
chmod 0755 /system/b2g/b2g
$<bugzilla>
chmod 0755 /system/b2g/updater
$    {
chmod 0755 /system/b2g/plugin-container
$        "blocks": "1_your_bug_number_2",
$        "include_fields": "id, summary, status, blocks, whiteboard, cf_blocking_b2g"
$    }
$</bugzilla>
</pre>
</pre>
*Other ports: Link to Android, Cyanogen, Ubuntu... ports that could be an helping resource or give the state about porting for this device.
*Additional information: add here links to related pages that can't enter other items.


You might want to modify from init.rc of new device, instead of using the init.rc provided by the
== Contributing ==
build system.  In this case, you need to set TARGET_PROVIDES_INIT_RC in BoardConfig.mk.
Be welcome if you want to improve this starting guide.
 
=== Prebuilt kernel vs building kernel from source ===
 
A prebuilt kernel can be used, or you may also build kernel from source by the build system.
To build kernel by build system, add AndroidKernel.mk and kernel config in device configuration tree.
 
The [https://github.com/andreasgal/B2G/tree/master/glue/gonk/device/toro/maguro maguro] on old build system is an example that builds kernel from source.
 
== Add new device in flash.sh ==
 
Add the new device, depending on what flash tool required by new device.
 
== Config/build/flash for new device ==


<pre>
= Start porting =
$ ANDROIDFS_DIR=my_device_backup ./config.sh <device_id> default.xml
$ ./build.sh
$ ./flash.sh
</pre>


== Test and debug ==
To start doing the technical work, you can follow the guide to support a new device on MDN page [https://developer.mozilla.org/en-US/Firefox_OS/Developing_Firefox_OS/Porting Porting Firefox OS].


Have fun!
= Porting projects =


= Frequency asked questions =
== Under work project ==


To be added.
*[https://wiki.mozilla.org/FirefoxOS/Fairphone Fairphone]

Revision as of 19:39, 16 April 2015

This page is for porting projects management. It should help you to setup a porting project and make it successful. It then list all porting projects by device and progress.

If you are looking for a guide to support a new device, you should check the MDN page Porting Firefox OS.

Setting up a new porting project

Announce your project

The first thing to do is to get in touch with a mozillan responsible for porting, device or that already has port a device. You can do that over IRC channel #b2g and ask for Dietrich Ayala (:dietrich).

Build your project's tools

You can then start by building your device porting project management wiki page as a sub page of the Firefox OS one. You can use the Fairphone one as a reference.

The proposed structure of that page is:

  • Ignition project todo list: everything you have to do before starting porting. After building this page that could be:
    • Contact the device maker: coordinate and improve collaboration.
    • Announce your project on the b2g mailing-list.
  • Device targeted: make it clear which one it is, especially if there are different versions, releases, editions.
  • Resources:
    • Project coordinator & evangelist: give your name and ways to contact you.
    • Technical lead: if that's not you tell who.
    • Wiki page: link here the page you are creating
    • IRC channel: link here any specific IRC relevant channel. You can find any relevant information on the IRC wiki page.
    • Mozillian group: if you are a mozillian (or became one) you can join/setup a group about this device.
    • Meta/tracking bug: Open a bug in bmo with Product=Firefox OS & Component=General.
    • Porting community page: link to any porting page like XDA-Forums.
    • Sumo thread: if there is one started, list it here.
  • Contributing: Tell others that want to get involved in the project how to.
  • Progress:
    • Starting point: tell the state of the porting or give info about anything that give a root to your porting project.
    • Bug table: add a bugzilla table to give an overview of the bugs. Adapt the following code and add it to you wiki page:
$<bugzilla>
$    {
$        "blocks": "1_your_bug_number_2",
$        "include_fields": "id, summary, status, blocks, whiteboard, cf_blocking_b2g"
$    }
$</bugzilla>
  • Other ports: Link to Android, Cyanogen, Ubuntu... ports that could be an helping resource or give the state about porting for this device.
  • Additional information: add here links to related pages that can't enter other items.

Contributing

Be welcome if you want to improve this starting guide.

Start porting

To start doing the technical work, you can follow the guide to support a new device on MDN page Porting Firefox OS.

Porting projects

Under work project