This is documented elsewhere, but only in bits and pieces and in various languages. Basically, instead of using the flash utility that comes with B2G, we want to build a zip file that we can flash from multirom.
- Set up your build environment. Note that you're going to need plenty of disk space here. On my linux machine, it currently takes up close to 20GB.
- Pull from git and configure for your device. This will take a little time. The only sticky point for me was that i needed an old version of make (3.81-8.2 for an ubuntu derivative).
- Build. For me, this was as simple as running build.sh, no options. Your results may vary.
Above we're copying our built boot image and system and data directories.
mkdir rom cd rom rsync -rL ../out/target/product/hammerhead/system . rsync -rL ../out/target/product/hammerhead/data . cp ../out/target/product/hammerhead/boot.img .
Above we're borrowing the updater script from bluish coder and setting up the META-INF path that recovery will look for when trying to flash. For the next step, we're going to use signapk.jar. If you already have this setup, this should be straight forward. If not, you can read a how-to guide here.
mkdir -p META-INF/com/google/android/ cp ../tools/update-tools/bin/gonk/update-binary META-INF/com/google/android/ curl http://bluishcoder.co.nz/b2g/updater-script >META-INF/com/google/android/updater-script
Now our signed_b2g.zip is ready to copy to our phone and flash with TWRP. Yay!
zip -r9 b2g.zip * java -jar ../prebuilts/sdk/tools/lib/signapk.jar ../build/target/product/security/testkey.x509.pem ../build/target/product/security/testkey.pk8 b2g.zip signed_b2g.zip