Boot to Gecko aims to create a complete, standalone operating system for the open web.
You can read more about B2G here:
https://developer.mozilla.org/en-US/docs/Mozilla/B2G_OS
Follow us on twitter: @Boot2Gecko
Join the Mozilla Platform mailing list:
http://groups.google.com/group/mozilla.dev.platform
and talk to us on Matrix:
https://chat.mozilla.org/#/room/#b2g:mozilla.org
Discuss with Developers:
Discourse: https://discourse.mozilla-community.org/c/b2g-os-participation
- Fetch the code:
REPO_INIT_FLAGS="--depth=1" ./config.sh emulator-10-x86_64 - Setup your environment to fetch the custom NDK:
export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk' - Install Gecko dependencies:
cd gecko && ./mach bootstrap, choose option 1 (Boot2Gecko). - Build:
./build.sh - Run the emulator:
source build/envsetup.sh && lunch aosp_arm-userdebug && emulator -writable-system -selinux permissive
- Fetch the code:
REPO_INIT_FLAGS="--depth=1" ./config.sh sargo. This will also download the binary blobs for the device if they are not already present. - Setup your environment to fetch the custom NDK:
export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk' - Install Gecko dependencies:
cd gecko && ./mach bootstrap, choose option 1 (Boot2Gecko). - Build:
./build.sh - Boot the Android system, go to settings, enable developer mode and enable OEM Unlock
- Reboot into fastboot mode and issue
fastboot flashing unlockfastboot flashing unlock_critical
- Flash:
./flash_sargo.sh
At boot time, you might need adb shell setenforce 0 for B2G to boot (flash_sargo.sh does it).
- Fetch the code:
REPO_INIT_FLAGS="--depth=1" ./config.sh onyx - Setup your environment to fetch the custom NDK:
export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk' - Install Gecko dependencies:
cd gecko && ./mach bootstrap, choose option 1 (Boot2Gecko). - Apply patch:
./patcher/patcher.sh - Build:
./build.sh - Boot the Android system, go to settings, enable developer mode and enable OEM Unlock
- Reboot into fastboot mode
- Flash:
fastboot erase userdatafastboot flash system $gonk_path/system.imgfastboot flash boot $gonk_path/boot.img
If need to output a zip ROM file, you can use ./build.sh dist DIST_DIR=dist_output instead of ./build.sh in step 5.
More detail of which device is supported and which type for your device.
-
Fetch the code:
REPO_INIT_FLAGS="--depth=1" ./config.sh b2g_gsi -
Setup your environment to fetch the custom NDK:
export LOCAL_NDK_BASE_URL='ftp://ftp.kaiostech.com/ndk/android-ndk' -
Install Gecko dependencies:
cd gecko && ./mach bootstrap, choose option 1 (Boot2Gecko). -
Build:
./build-gsi.sh [your_device_type_name] systemimagetype:
gsi_arm64_ab(arm64 partitionA/B)gsi_arm64_a(arm64 partitionA)gsi_arm_ab(arm partitionA/B)gsi_arm_a(arm partitionA)
-
Flash: Follow the steps from click it or use the
./create_gsi_dist.shscript to create a self-contained archive with the image and flashing tools.
Because it's using a different c++ namespace than the AOSP base, we can't use the prebuilt NDK from Google. If you can't use the one built by KaiOS, here are the steps to build your own:
- Download the ndk source:
repo init -u https://android.googlesource.com/platform/manifest -b ndk-release-r20 - change
__ndkto__inexternal/libcxx/include/__config:
-#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__ndk,_LIBCPP_ABI_VERSION)
+#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)- Build the ndk:
python ndk/checkbuild.py --no-build-tests