Bienvenido a Root4ever!
En Root4ever no usamos publicidad agresiva!
No nos gusta molestar a los usuarios, pero agradeceríamos mucho que nos incluyeras en la lista de paginas permitidas en tu Adblock o lo desactivaras en nuestro sitio, así nos ayudarás a mantener la página operativa. :-)
Al igual que a nosotros, no nos gusta que nos obliguen a algo queriendo nosotros elegir, por este motivo puedes cerrar la ventana en la parte superior izquierda para disfrutar del contenido.
Solo te irá saliendo este aviso, puedes cerrarlo tantas veces como necesites.
Una vez añadidos no volverá a aparecer este aviso.

Gracias por visitarnos!



Comparte en Google+ que te gusta esto!!  Comparte en FaceBook que te gusta esto!!  Twittea que te gusta esto!
Translate!   Traduce esta página al Español!!   Translate this page into English!  
Enviar respuesta 
Tutorial Compilar Firefox OS para los dispositivos soportados.
15-07-2013, 06:16 AM
Mensaje: #1

El 95% de los archivos necesarios publicados en las guías de Root4ever se encuentran en nuestros discos duros!
Este aporte no está completo?
REPORTARLO HACIENDO CLIC AQUÍ! Tan pronto podamos re-subiremos los archivos necesarios!!
Mejoremos entre todos! Hagamos de Root4ever una comunidad mejor! :-)

Compilar Firefox OS para los dispositivos soportados.
Atención, este tutorial es tal cual esta en su pagina web oficial y esta en inglés, se irá traduciendo poco a poco cuando vaya teniendo ratos. Guiño


Solo colocaré la información para compilar con Linux.



Requirements for Linux

To build on Linux, you'll need to have a system configured with:
  • An installed 64 bit GNU/Linux distribution (we recommend Ubuntu 12.04).
  • At least 4 GB of RAM/swap space.
  • At least 20 GB of available hard disk space.

This is more than the bare minimum, but sometimes building fails just because it's missing resources.

You will also need the following tools installed:
  • autoconf 2.13
  • bison
  • bzip2
  • ccache
  • curl
  • flex
  • gawk
  • git
  • gcc / g++ / g++-multilib
  • make
  • OpenGL headers
  • patch
  • X11 headers
  • 32-bit ncurses
  • 32-bit zlib

64 bit install examples:

Ubuntu 12.04 / Linux Mint 13 / Debian 6

$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip

When building on 64-bit Ubuntu, you may find that you need to add symlinks for the 32-bit versions of libX11.so and libGL.so:

$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Ubuntu 12.10

$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip

In addition to the steps above needed to fix issues with the 32-bit versions of the libX11.so and libGL.so libraries, you will need to specify GCC 4.6 as the default host compiler after having retrieved the sources, see here how to do it.

In a fresh Ubuntu 12.10 install, you'll get an error about unmet dependencies for ia32-libs. The following steps fix it.

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install ia32-libs

Ubuntu 13.04

$ sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip

All other instructions from the previous version apply.

Fedora 17/18:

$ sudo yum install autoconf213 bison bzip2 ccache curl flex gawk gcc-c++ git glibc-devel glibc-static libstdc++-static libX11-devel make mesa-libGL-devel ncurses-devel patch zlib-devel ncurses-devel.i686 readline-devel.i686 zlib-devel.i686 libX11-devel.i686 mesa-libGL-devel.i686 glibc-devel.i686 libstdc++.i686 libXrandr.i686 zip perl-Digest-SHA

In addition to the above you will need GCC 4.4 in order to compile the project. You can find a pre-compiled version here. Download it and install it to /opt with the following command:

$ wget http://people.mozilla.org/~gsvelto/gcc-4.4.7-bin.tar.xz
$ sudo tar -x -a -C /opt -f gcc-4.4.7-bin.tar.xz

You will need to specify this compiler as the default host compiler after having retrieved the sources, see here how to do it.

Fedora 19:

You can follow the instructions for Fedora 17/18 and in addition to the packages you will need an older version of GCC in order to compile the project. Due to a change in libraries the GCC 4.4 compiler provided above does not work on Fedora 19. Instead you can find a pre-compiled version of GCC 4.6.4 here. Download it and install it to /opt with the following command:

$ wget http://people.mozilla.org/~gsvelto/gcc-4.6.4-bin.tar.xz
$ sudo tar -x -a -C /opt -f gcc-4.6.4-bin.tar.xz

You will need to specify this compiler as the default host compiler after having retrieved the sources, see here how to do it.

Arch Linux:

$ sudo pacman -S --needed alsa-lib autoconf2.13 bison ccache curl firefox flex gcc-multilib git gperf libnotify libxt libx11 mesa multilib-devel wget wireless_tools yasm zip lib32-mesa lib32-mesa-libgl lib32-ncurses lib32-readline lib32-zlib

By default, Arch Linux uses Python3. You'll have to force it to use the old python2:

$ cd /usr/bin

$ sudo ln -fs python2 python


Notas de interés sobre el Galaxy S2:

Samsung Galaxy S2

If you plan to build for the Samsung Galaxy S2, you will also need to install heimdall. See Installing heimdall for details. This is not done for you by the bootstrap script!

Note: If you have installed the Samsung Kies tool, which is used to manage the contents of many Samsung phones, you will have to remove it before you can flash Firefox OS onto your device. You can use the standard application removal process on Windows; on Mac, the Kies install disk image has a utility to fully remove Kies from your system. Flashing will not work if you have Kies installed. If you forget to remove Kies, the build system will detect it and remind you to uninstall it. Note also that the uninstall tool does not correctly remove the folder ~/Library/Application Support/.FUS, and leaves a reference to a utility there in your user startup items list. You will want to remove these manually.


Otros paquetes necesarios:

Fix libmpc dependency if broken

gcc 4.6 was built with libmpc 0.9; if you then use homebrew to update packages, libmpc gets updated to version 1.0, but homebrew doesn't rebuild gcc 4.6 after the library version changes. So you need to create a symlink to make things work again, like this:

cd /usr/local/lib/
ln -s libmpc.3.dylib libmpc.2.dylib

Optional: Install HAX

Intel provides a special driver that lets the B2G emulator run its code natively on your Mac instead of being emulated, when you're using the x86 emulator. If you wish to use this, you can download and install it. It's not required, but it can improve emulation performance and stability.

Before you install HAX you will need to install the Android SDK.

Install adb

The build process needs to pull binary blobs from the Android installation on the phone before building B2G (unless you're building the emulator, of course). For this, you will need adb, the Android Debug Bridge.

To get this, you'll need to install the Android SDK starter package for your platform (you'll want the ADT Bundle, not the SDK Tools Only option). Then run their package manager, $SDK_HOME/tools/android, and use the GUI to install "Android SDK Platform-tools".

adb will be installed to $SDK_HOME/platform-tools. Be sure to add this directory to your PATH. This can be done by adding the line

PATH=$SDK_HOME/platform-tools:$PATH

replacing $SDK_HOME with the location of the android sdk, to your ~/.bashrc or equivalent.

Install heimdall

Heimdall is a utility for flashing the Samsung Galaxy S2. It's used by the Boot to Gecko flash utility to replace the contents of the phone with Firefox OS, as well as to flash updated versions of B2G and Gaia onto the device. You'll need it if you want to install Firefox OS on a Galaxy S2; it is not needed for any other device. For other devices, we build and use the fastboot utility instead.

Note: Again, it's important to note that this is only required for installing Firefox OS on the Samsung Galaxy S2.

There are two ways to install heimdall:

Configure ccache

The default cache size for ccache is 1GB; the B2G build easily saturates this. You can configure your cache size as follows:

$ ccache --max-size 3GB

Configure the udev rule for your phone

You can get the USB vendor ID by running lsusb now, but typically it's Google's 18d1, Samsung's 04e8, ZTE's 19d2, Qualcomm's 05c6 so adding this line in your /etc/udev/rules.d/android.rules (create the file if it doesn't exist, replace XXXX with the ID) would work:

SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", MODE="0666", GROUP="plugdev"

Take ZTE for example, the content in android.rules will be

SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"

Once you've saved the file, and closed it, make the file readable:

$ sudo chmod a+r /etc/udev/rules.d/android.rules

Then you can check if you can list device via adb command:

$ adb devices
List of devices attached
123456          device

If the device did not list as expect, check the file name and the script are all correct, then restart the computer and retype the command again. Note also that if your device uses fastboot, the bootloader may identify itself with a different vendor ID than the one you see when the device boots normally.

Set the phone to developer mode

Before you plug your phone into your USB port, put it USB developer mode. This allows to debug and flash the phone. To enable developer mode: Settings app -> Device information -> Mode Information -> Developer -> (enable) Developer mode

Backup the phone system partition

It is recommended to back up the entire Android system partition on your phone. You can use this copy of the binary blobs for Android in case you later delete your B2G tree. To do this, run:

adb pull /system <backup target dir>/system

Depending on the phone, you may also need to pull the /data and/or /vendor directories:

adb pull /data <backup target dir>/data
adb pull /vendor <backup target dir>/vendor

If the pull commands fail with "insufficient permission" message, try the following:
  • stop and restart the adb server, or if that fails,
  • double-check that you have granted root permissions to the 'adb' tool within your custom ROM (eg. under CyanogenMod, change 'Settings > System > Developer Options > Root Access' to 'Apps and ADB' or 'ADB only').
  • Verify that you have set up the udev rule correctly (see Configure the udev rule for your phone.



On to the next step

En este punto, usted debe estar listo para ir a buscar el código de Firefox OS!

Clone B2G repository

The first step, before you can start your first build, is to clone the B2G repository. This will not fetch everything! Instead, it will fetch the B2G build system and setup utilities. Most of the actual B2G code is in the main Mozilla Mercurial repository.

To clone the repository, use git:

git clone git://github.com/mozilla-b2g/B2G.git

After cloning (which should only take a minute with a fast connection), cd into the B2G directory:

cd B2G

Copying your B2G tree to a new machine

If you've gotten a new computer (lucky you!), you'll find your life will be much easier if you simply migrate your entire B2G tree from one computer to another.

To do that, mount your old computer's drive onto your new computer, then do this:

rsync -a source/ dest/

Where source is the full path (including the trailing slash) of the source tree, and dest is where you want to put it (the trailing slash is also important!).

Note: If you copy the files from a computer with another platform ensure to run './build.sh clean' before you start the build process. If you don't do this you might encounter compilation issues.

If you do this, you can skip all of the rest of this article and move right on to building.

Updating your B2G tree

The ./sync command does not update your B2G tree. When you need to update your B2G tree at some future point, you'd run:

git fetch origin
git checkout origin/master

You can check that this worked correctly by running:

git show HEAD

and checking that the commit shown matches the latest commit shown at: https://github.com/mozilla-b2g/B2G/commits/master

Configuring B2G for your device

Important: Remember that only devices running Android 4 (aka Ice Cream Sandwich) are supported. Please check that your phone is actually running ICS, otherwise this step will most likely fail since some drivers are pulled from non-Nexus devices. Also, if you have to flash your device with ICS, keep in mind that some USB hubs don't work well with flashing tools, so you may have to connect your device to a built-in USB port..

Once you've retrieved the core B2G build system, you need to configure it for the device on which you plan to install it. To get a list of supported devices, you can use the config.sh utility, as follows:

./config.sh

This will display a list of the supported devices; for example:

Usage: ./config.sh (device name)

Valid devices to configure are:
- galaxy-s2
- galaxy-nexus
- nexus-4
- nexus-s
- nexus-s-4g
- otoro
- unagi
- inari
- keon
- peak
- leo
- hamachi
- helix
- tara
- pandaboard
- emulator
- emulator-jb
- emulator-x86

If your device isn't listed, you should stop right now and either help port B2G to your device or wait until someone else does it. We'd prefer it if you help out!

Note: If for any reason you want to build against a specific version of Gecko, see Building against a custom Gecko before you proceed. If you want to build a branch other than the trunk (for example, to build a specific version of B2G), see Building a branch.

Configuring for a mobile device

First, connect your device; the configure process will need to access it.

If your device is listed, you can start the configure process by running config.sh again, this time specifying your device's name. For example, to build for the Samsung Google Nexus S, you would type:

Note: If you get an error message like "fatal: manifest 'nexus-s.xml' not available", chances are that you simply have to specify the branch you want to use. See Building a branch for details.

Near the start of the configuration you might need to set the option for color usage, after this the process continues. This would be a good time for a coffee break, since at this point, you'll be doing your first pull of all the code needed to build Boot to Gecko.

If your phone no longer has Android on and your B2G tree doesn't have the binary blobs in it, and you wisely made a backup of the /system partition like an earlier page told you to, you can use it like this:

ANDROIDFS_DIR=<absolute path to parent dir of system dir> ./config.sh <target>

Configuring to build an emulator

If you want to build one of the emulators, you can specify "emulator" to get the ARM device emulator, or "emulator-x86" to build the x86 emulator. The latter is faster but not as accurate a representation of an actual mobile device.

So, for example, to build the ARM emulator, you would configure like this:

./config.sh emulator

Near the start of the configuration you might need to set the option for color usage, after this the process continues. This would be a good time for a coffee break, since at this point, you'll be doing your first pull of all the code needed to build Boot to Gecko.

Note: ./config.sh may take more time / network resources than you were prepared for. You may stop it with Ctrl-C and restart it at a later time. If you think some part of the process may have been terminated without completing, run './repo sync' to repair any possible problems.

Building against a custom Gecko

There may be times that you want or need to build Boot to Gecko based on a different version of Gecko than the one that's used by default (as specified in the manifest). You can do so by editing the file .userconfig. For example, if you want to build against mozilla-central:

export GECKO_PATH=/path/to/mozilla-central
export GECKO_OBJDIR=/path/to/mozilla-central/objdir-gonk

Note: if building against a custom Gecko in Mac OS X, the mozilla-central directory must be in a case sensitive file system.

Note that you can do this either before you pull the repository (i.e. before the config.sh step above) or at any later point. You can also keep multiple builds (with debugging on or not, etc) by having multiple userconfig files (with different settings--each needs a different OBJDIR, of course) and making .userconfig a symlink that points to whichever config you want to build at the moment.

Building a branch

If you want to build for a branch other than the trunk, you will need to prefix your call to config.sh with a branch name, like this:

BRANCH=branch-name ./config.sh <device>

To see the names of branches, you can cd to B2G/.repo/manifests and do "git branch -a". The branch name is the final token on the line, e.g. "v1-train" or "master". Example:

remotes/origin/master
  remotes/origin/v1-train
  remotes/origin/v1.0.0
  remotes/origin/v1.0.1

See Customization with the .userconfig file for additional customizations you can do.


Next, start the build.

Once you've set up your build system and performed your initial pull and configure of the code, you can build Boot to Gecko.

Updating your code

If this isn't your very first time building B2G, you might want to pull the latest code before you start to build. To do that, you should update both the B2G tools and the dependencies, using the following two commands:

git pull
./repo sync

You can update a specific make target's repository by specifying its name:

./repo sync gaia

The repo command has other options available that might be interesting; repo help will give you a lot of information.

Building

Note: Before building, you may want to set up a .userconfig file to customize the build. See Customization with the .userconfig file for details.

To build Boot to Gecko, simply use the build.sh tool:

cd B2G
./build.sh

Time for another coffee break, or possibly a nap (especially if this is your first build). As in the configure step on the previous page, if you are using a directory of previously-extracted Android system files, you should set ANDROIDFS_DIR before running build.sh.

Building specific modules

If you want to build just a particular module, such as Gecko, you can specify it by name:

./build.sh gecko

In order to refresh only one application, you can build only gaia module by using BUILD_APP_NAME environment variable:

BUILD_APP_NAME=calendar ./build.sh gaia

To get a list of the modules you can build, you can do:

./build.sh modules

Setting the number of processor cores to use

By default, the B2G build scripts use the number of cores your system has plus two as the number of parallel tasks to run. You can change this by specifying the -j parameter when running build.sh. This can be handy if you're using your system for other things while building in the background and need to reduce CPU load a bit. It's also handy when you're having build problems, as it can make reading error output from the build process easier if you have just one task going at a time!

For example, to build using just two parallel tasks:

./build.sh -j2

The most common use case for this, however, is to prevent builds from running in parallel at all. This makes the output of the process much easier to read, making it easier to sort out build problems. To do this:

./build.sh -j1

Building multilocale

To create a multilocale build, do the following:

Gaia
  • Determine which Gaia languages file to use. We're currently using locales/languages_dev.json and locales/languages_all.json as our Gaia languages files.
  • Clone the appropriate locales from http://hg.mozilla.org/gaia-l10n into a directory; we use gaia-l10n/ . You'll need to clone a repo for each locale listed in the languages file.
  • In your environment, set LOCALE_BASEDIR to the absolute path of the directory in step 2. Set LOCALES_FILE to the absolute path of the file in step 1.

For instance,

export LOCALE_BASEDIR=$PWD/gaia-l10n
export LOCALES_FILE=$PWD/gecko/gaia/shared/resources/languages-dev.json

Gecko

  1. Determine which Gecko languages file to use. We're currently using b2g/locales/all-locales as our Gecko languages file.
  2. Clone the appropriate locales into a directory; this can be gecko-l10n/ .
  3. Clone compare-locales.
  4. In your environment, set L10NBASEDIR to the absolute path of the directory in step 2. Set MOZ_CHROME_MULTILOCALE to a string of space-delimited locales from step 1.

Add the compare-locales/scripts dir to your PATH, and compare-locales/lib to your PYTHONPATH.

For instance,

export L10NBASEDIR=$PWD/gecko-l10n
export MOZ_CHROME_MULTILOCALE="ja zh-TW"
export PATH="$PATH:$PWD/compare-locales/scripts"
export PYTHONPATH="$PWD/compare-locales/lib"

Once you have the above set up, you can run build.sh .

It looks like you can use .userconfig as well.

These instructions may change as we smooth things out.


Known errors

KeyedVector.h:193:31: error: indexOfKey was not declared in this scope

This error appears when your gcc version is too recent. Install gcc/g++/g++-multilib 4.6.x versions.

See Customizing with the .userconfig file for more information.

Community Note: It is possible to use gcc 4.7.x with slight modifications to the B2G code (gcc will guide you) but you won't get any help! Neither with modifying the code nor with bugs you encounter.

arm-linux-androideabi-g++: Internal error: Killed (program cc1plus)

If you see this message, it most likely means that are lacking of free memory. Ensure having enough free memory before running ./build.sh. It should run fine if you system has 4GB of ram.

If you get build errors while the build system is running tests

Sometimes (especially after build tool or operating system updates) you'll get weird errors like this when the build system runs its post-build tests:

Generating permissions.sqlite...
test -d profile || mkdir -p profile
run-js-command  permissions
WARNING: permission unknown:offline-app
WARNING: permission unknown:indexedDB-unlimited
build/permissions.js:122: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPermissionManager.add]
make[1]: *** [permissions] Error 3
make: *** [gaia/profile.tar.gz] Error 2

In this situation, try deleting the gaia/xulrunner-sdk directory and re-pulling the code:

rm -r gaia/xulrunner-sdk

This deletes the downloaded, precompiled copy of XULRunner that the build system retrieves automatically; on your next build, a new copy of XULRunner will be automatically retrieved.



Fuente.

FIN!Gran sonrisa

Firma de Root
La mejor forma de agradecer, es compartir lo aprendido. ¡COMPARTE CON NOSOTROS!
Cita este mensaje en tu respuesta
[-] Los siguientes usuarios dan las gracias por este este post:
, chujalt
Publicidad.

Enviar respuesta 


Salto de foro:


Usuario(s) navegando en este tema: 1 invitado(s)









Sobre Root4ever

Licencia de Creative Commons
Root4ever está bajo licencia Creative Commons Reconocimiento 4.0 Internacional License, podrá reproducir libremente el contenido de este sitio mencionando el AUTOR, la FUENTE y URL original.

  • © Root4ever - 2017