Dopo avere compilato "Boot to Gecko" per uno dei dispositivi supportati, puoi installare Firefox OS. Questa articolo ti guiderà nel processo.
Installare ADB
Su OSX
Se hai Homebrew :
brew install android-platform-tools
Altrimenti scarica l'Android Developer Tools e aggiungi i sorgenti al tua PATH.
Su Ubuntu
sudo apt-get install android-tools-adb
Effettuare il flash al tuo cellulare
Per effettuare il flash al tuo cellulare, semplicemente connetti il tuo dispositivo e digita:
./flash.sh
Fatto! Adesso il B2G che avevi compilato si installerà nel tuo dispositivo.
Nota che se avevi effettuato precedenti installazioni di Gaia potresti aver bisogno anche di scrivere:
cd gaia make reset-gaia
Questo cancellerà sia tutti i tuoi dati memorizzati in Gaia, sia anche le impostazioni e le preferenze obsolete di Gaia in modoo da effettuare una installazione pulita. Teoricamente ./flash.sh
dovrebbe fare tutto questo automaticamente ma per alcuni dispositivi, come hamachi, ./flash.sh
effettua il flash solo ad alcuni moduli (./flash.sh -f
farà effettuare il flash a tutto.)
Configurare le regole udev rule per il tuo dispositivo
Su Linux se ricevi questo messaggio
< waiting for device >
significa che probabilmente non hai aggiunto una udev rule per l'avvio veloce del dispositivo (che per ADB non è lo stesso), oppure significa che hai semplicemente bisogno di far partire ./flash.sh con "sudo". Puoi ottenere l'USB vendor ID con "lsusb"
, ma di solito è quello di Google: 18d1, quindi aggiungendo la riga successiva in /etc/udev/rules.d/51-android.rules
dovrebbe funzionare:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
libusb
error "-3" significa che per avere l'accesso al dispositivo USB devi essere root. Esegui di nuovo lo script usando Sudo.Note speciali per dispositivi Hamachi, Helix e Leo
Se il tuo telefono è un dispositivo hamachi, helix o leo, lo script ./flash.sh al momento eseguirà il flash solamente per gecko e gaia. It is recommended that you flash with the OEM as a base build to get the firmware and the gonk layers and then flash the gecko and gaia on top. If you want to flash using the images, there is an override flash where you can ./flash.sh -f and it will use the image files to flash your device.
Special notes for the Samsung Galaxy S2
If your phone is a Galaxy S2 and you are using heimdall 1.3.2 (the latest version; use heimdall version
to check), you may see an alarming error "FACTORYFS upload failed!" followed by "Heimdall flashing failed" and some additional information. This is actually a success condition, and you can ignore the advice.
To get rid of this strange behavior, grab a source copy of heimdall, downgrading to the 1.3.1 release ("git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06
"), then compile it according to the README
, then install that to make the error go away. However, this isn't strictly necessary.
All versions of heimdall are unable to flash a system.img larger than 100MB. Do:
ls -l ./out/target/product/galaxys2/system.img
to see how big yours is. If it's too large, ask in IRC for advice; there are ways to do it in two stages.
Added step for the Samsung Galaxy S2
If you're flashing onto the Galaxy S2, there is an additional step to follow. Gaia does not get flashed automatically by the flash.sh
script; you'll need to also do:
./flash.sh gaia
Flashing specific partitions to fastboot phones
You can flash specific partitions to fastboot phones (that is, any phone other than the Samsung Galaxy S2). For example:
./flash.sh system ./flash.sh boot ./flash.sh user
WARNING: flashing user (at least) may delete your user-specific data (contacts, etc.).
Updating specific modules
You can update specific components of B2G by specifying their names when flashing. For example:
./flash.sh gaia ./flash.sh gecko
In order to update only one application you can use BUILD_APP_NAME environment variable:
BUILD_APP_NAME=calendar ./flash.sh gaia
If your phone is not for developer (you aren't interested on test apps and/or require optimization), you can update gaia using:
VARIANT=user ./flash.sh gaia
Next steps
At this point, your phone should be running Boot to Gecko! It's time to experiment, write some code, test, or do some debugging!
Troubleshooting
Here are a some tips for what to do if your device doesn't work right after installing B2G, or updating it to a new version
If the UI doesn't start up
If you update your phone and the user interface doesn't start up, you can reset it to clear out out-of-date configuration and the like. This may bring it back to life, but note that it may also delete your user-specific data (contacts, etc.). Here's how:
cd gaia make reset-gaia
If you want change from developer to production mode
cd gaia make reset-gaia PRODUCTION=1
WARNING: reset-gaia may delete your user-specific data (contacts, etc.).
"image is too large" error message on ./flash.sh execution
It might mean that you phone needs to be rooted first before flashing it. As b2g needs to be written on root partition, your phone needs to be rooted in order to install it.