-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Building Firefox in a chroot | ||
|
||
Something I don't like is project with tons of build dependencies. They tend to stay and pollute the system. Something I don't like even more are containers. | ||
|
||
Let's work with old school chroot. | ||
|
||
## Installing dependencies | ||
|
||
``` | ||
sudo aptitude install debootstrap schroot | ||
``` | ||
|
||
## Installing an image | ||
|
||
A recent version of Ubuntu is enough. | ||
|
||
``` | ||
sudo debootstrap --variant=buildd arch=amd64 artful /srv/chroot/firefox-chroot http://archive.ubuntu.com/ubuntu/ | ||
``` | ||
|
||
## Configuring and starting the chroot | ||
|
||
``` | ||
cat <<EOF > /etc/schroot/chroot.d/firefox.conf | ||
[firefox] | ||
description=Firefox | ||
directory=/srv/chroot/firefox-chroot | ||
users=user1 | ||
root-users=user1 | ||
type=directory | ||
EOF | ||
``` | ||
|
||
We need to enable write access to shared memory, else the build configuration tool will fail. | ||
|
||
``` | ||
cat <<EOF >> /etc/schroot/default/fstab | ||
/dev/shm /dev/shm none rw,bind 0 0 | ||
EOF | ||
``` | ||
|
||
## Configuring the image | ||
|
||
The list of sources is missing some lines, so we must add them before installing dependencies. Moreover, the Firefox bootstrap forget to install Clang. | ||
|
||
``` | ||
cat <<EOF >> /srv/chroot/firefox-chroot/etc/apt/sources.list | ||
deb http://fr.archive.ubuntu.com/ubuntu/ artful-updates main restricted | ||
deb http://fr.archive.ubuntu.com/ubuntu/ artful universe | ||
deb http://fr.archive.ubuntu.com/ubuntu/ artful-updates universe | ||
EOF | ||
sudo schroot -c firefox | ||
apt-get update | ||
apt-get install python clang | ||
exit | ||
``` | ||
|
||
## Starting the chroot | ||
|
||
``` | ||
schroot -c firefox | ||
``` | ||
|
||
Now you can follow the [official build steps](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation). |