Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit 7771750

Browse files
authored
Merge pull request #518 from novski/patch-1
Bug 1300477 - Github mozilla-b2g/B2G readme is outdated r=gerard-majax
2 parents e4e6f8b + deb183e commit 7771750

File tree

1 file changed

+5
-200
lines changed

1 file changed

+5
-200
lines changed

README.md

Lines changed: 5 additions & 200 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Boot to Gecko aims to create a complete, standalone operating system for the ope
55
You can read more about B2G here:
66

77
http://wiki.mozilla.org/B2G
8+
https://developer.mozilla.org/en-US/docs/Mozilla/B2G_OS
89

910
follow us on twitter: @Boot2Gecko
1011

@@ -18,206 +19,10 @@ and talk to us on IRC:
1819

1920
#B2G on irc.mozilla.org
2021

21-
## Prerequisites
22+
or Telegram:
2223

23-
### Linux
24+
https://telegram.me/B2GOS
2425

25-
* A 64 bit linux distro
26-
* See http://source.android.com/source/initializing.html on configuring USB access.
27-
* 20GB of free disk space
28-
* autoconf-2.13
29-
* git
30-
* ccache
31-
* gcc/g++ __4.6.3 or older__
32-
* bison
33-
* flex
34-
* 32bit ncurses
35-
* zlib
36-
* You need both zlib1g and zlib1g-dev for both i386 and amd64. That is, for
37-
Ubuntu 12.04 Precise or older, they are zlib1g, zlib1g-dev, zlib1g:i386, and
38-
zlib1g-dev:i386; for Ubuntu 12.10 Quantal or newer, they are zlib1g:amd64,
39-
zlib1g-dev:amd64, zlib1g:i386, and zlib1g-dev:i386.
40-
* make
41-
42-
Additionally, if you're building the emulator, you probably need the the Mesa
43-
implementation of OpenGL. On Ubuntu, this is the __libgl1-mesa-dev__ package.
44-
45-
Ubuntu 12.10 ships with gcc 4.7 by default, which causes build errors pretty
46-
early in the process. To use gcc 4.6, edit .userconfig and add
47-
48-
export CC=gcc-4.6
49-
export CXX=g++-4.6
50-
51-
Of course, you'll need the g++-4.6 package installed.
52-
53-
On Ubuntu 13.04, for example, you might find `apt-get install zlib1g{,-dev}:i386`
54-
is going to do something seriously wrong like removing all your toolchain
55-
packages. You may execute either `apt-get install --no-install-recommends <packages>`
56-
to explicitly disallow installing recommended packages, or `aptitude` to
57-
interactively select the very necessary packages you need.
58-
59-
For full lists of minimum required packages that build B2G emulator on all
60-
recent Ubuntu releases, see https://bugzilla.mozilla.org/show_bug.cgi?id=866489 .
61-
62-
### OSX
63-
64-
* XCode
65-
* 20GB of free space
66-
* homebrew
67-
* git (if not using XCode 4)
68-
* gpg
69-
* ccache
70-
* autoconf-2.13 - brew install https://raw.github.com/Homebrew/homebrew-versions/master/autoconf213.rb
71-
72-
#### Note: Builds for some devices require case-sensitive file systems
73-
74-
Some B2G subrepositories contain files whose names differ only in case.
75-
This causes build failures when building for some target phones (such as the
76-
Hamachi) if you're on a case-insensitive FS (the default on Mac). You'll see
77-
an error like the following during the ./build.sh step:
78-
79-
> [entering kernel]
80-
> ERROR: You have uncommited changes in kernel
81-
> You may force overwriting these changes
82-
> with |source build/envsetup.sh force|
83-
>
84-
> ERROR: Patching of kernel/ failed.
85-
86-
If you hit this error, the easiest way around it is to build on a
87-
case-sensitive file-system. Doing so doesn't require any re-partitioning; you
88-
can simply create a disk image and build within it using the following
89-
commands.
90-
91-
hdiutil create -volname 'firefoxos' -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/firefoxos.sparseimage
92-
open ~/firefoxos.sparseimage
93-
cd /Volumes/firefoxos/
94-
95-
See https://bugzilla.mozilla.org/show_bug.cgi?id=867259 for details.
96-
97-
#### Note: Linker OOM with noopt builds
98-
99-
If you build with B2G_NOOPT=1 on MacOS, your linker may run out of memory and
100-
crash.
101-
102-
The solution, if you really want a noopt build, is to use a 64-bit linker.
103-
Follow these steps:
104-
105-
1. Clone this repository somewhere
106-
107-
$ git://github.com/jld/b2g-toolchain-prebuilt.git
108-
109-
2. In .userconfig, add the following line.
110-
111-
export TARGET_TOOLS_PREFIX=/path/to/b2g-toolchain-prebuilt/toolchain-4.4.3/x86_64-apple-darwin/bin/arm-linux-androideabi-
112-
113-
(Of course, replace /path/to/b2g-toolchain-prebuilt/ with the actual path.)
114-
115-
3. Rebuild.
116-
117-
See https://bugzilla.mozilla.org/show_bug.cgi?id=854535 for details.
118-
119-
## Configure
120-
121-
Run config.sh to get a list of supported devices:
122-
123-
./config.sh
124-
125-
And then run config.sh for the device you want to build for:
126-
127-
./config.sh [device name]
128-
129-
### Udev Permissions
130-
If you get "error: insufficient permissions for device"...
131-
132-
Obtain ID of device manufacturer (first 4 hexidecimal digits before colon):
133-
134-
$ lsusb
135-
136-
Add a line to /etc/udev/rules.d/android.rules (replacing XXXX with 4 digit ID):
137-
138-
SUBSYSTEM=="usb", ATTRS{idVendor}=="XXXX", MODE="0666"
139-
140-
Restart udev before re-plugging your device for it to be detected:
141-
142-
$ sudo service udev restart
143-
144-
Re-run configure:
145-
146-
./config.sh [device name]
147-
148-
### Building against a custom Gecko
149-
150-
It can sometimes be useful to build against a different Gecko than the one specified in the manifest, e.g. a mozilla-central checkout that has some patches applied. To do so, edit .userconfig:
151-
152-
GECKO_PATH=/path/to/mozilla-central
153-
GECKO_OBJDIR=/path/to/mozilla-central/objdir-gonk
154-
155-
Note that if you switch your userconfig's gecko path, you need to rm -rf the objdir and rebuild.
156-
157-
## Build
158-
159-
Run build.sh or bld.sh to build B2G.
160-
161-
./build.sh
162-
163-
If you want to just build gecko or some other project, just specify it:
164-
165-
./build.sh gecko
166-
167-
## Flash/Install
168-
169-
Make sure your phone is plugged in with usb debugging enabled.
170-
171-
To flash everything on your phone:
172-
173-
./flash.sh
174-
175-
To flash system/userdata/boot partitions on fastboot phones:
176-
177-
./flash.sh system
178-
./flash.sh boot
179-
./flash.sh user
180-
181-
To update gecko:
182-
183-
./flash.sh gecko
184-
185-
To update gaia:
186-
187-
./flash.sh gaia
188-
189-
## Update Repos
190-
191-
To update all repos:
192-
193-
git pull
194-
./repo sync
195-
196-
To update a specific repo (eg, gaia):
197-
198-
./repo sync gaia
199-
200-
## Debug
201-
202-
To restart B2G and run B2G under gdb:
203-
204-
./run-gdb.sh
205-
206-
To attach gdb to a running B2G process:
207-
208-
./run-gdb.sh attach <PID>
209-
210-
## Test
211-
212-
To run the Marionette test suite on the emulator:
213-
214-
./test.sh
215-
216-
To run specific tests (individual files, directories, or ini files):
217-
218-
./test.sh gecko/dom/sms gecko/dom/battery/test/marionette/test_battery.py
219-
220-
Specify the full path if you're using a different Gecko repo:
221-
222-
./test.sh /path/to/mozilla-central/dom/battery/test/marionette/test_battery.py
26+
Discuss with Developers:
22327

28+
Discourse: https://discourse.mozilla-community.org/c/b2g-os-participation

0 commit comments

Comments
 (0)