FQA INDEX | FQA 4 - 9front Installation Guide | FQA 6 - Networking

FQA 5 - Building the System from Source

html | pdf | troff

5.1 - Why should I build my system from source?

Some reasons why you might actually wish or need to build from source:

5.2 - Building 9front from source

5.2.1 - Update sources

9front uses git(1) to synchronize the system with the 9front repository:

cd /

bind -ac /dist/plan9front /

git/pull -u gits://git.9front.org/plan9front/plan9front

which is consolidated in the command:


After the tree is updated, recompile/build the updated programs as needed. - hgrc - git

During installation, the 9front git repository is copied to /dist/plan9front/.git, is chmod 775, and is owned by user glenda and group sys. To update the repository when logged in as a user other than glenda, add that user to group sys.

5.2.2 - Building from source

Note: A minimum of 512MB RAM is needed to link some programs. If less than 512MB is available, be sure to turn on swap before building (Read: swap(8)).

# create any missing directories needed for the build

cd /

. /sys/lib/rootstub

# build everything

cd /sys/src

mk install

mk clean

# build manpage indices

cd /sys/man


# build the papers and html (optional)

cd /sys/doc


mk html

Note: Before cross compiling a kernel, the compiler, assembler, linker, and paqfs(4) for the target architecture need to be built and installed (Read FQA - Cross compiling).

Build the kernel for 386:

cd /sys/src/9/pc

mk install

Build the kernel for amd64:

cd /sys/src/9/pc64

mk install

Build the kernel for arm / Raspberry Pi:

cd /sys/src/9/bcm

mk ’CONF=pi’ install

mk ’CONF=pi2’ install

Build the kernel for arm64 / Raspberry Pi 3:

cd /sys/src/9/bcm64

mk install

Read: FQA 7.2.5 - How do I install a new kernel? - Cross compiling

To cross compile, simply set the objtype environment variable prior to running the build. For example, to build all the amd64 binaries on a 386 system:

# create any missing directories needed for the build

cd /

. /sys/lib/rootstub

cd /sys/src

objtype=amd64 mk install

5.3 - Building an ISO

The 9front ISO is a livecd that also serves as install media.

Note: Currently, only the 386 and amd64 architectures have downloadable ISOs (rpi has a bootable image). Read: FQA 8.9 - Bootstrapping architectures not included on the ISO for more information on booting other architectures.

# put your root file system into /n/src9

bind /root /n/src9

# put your hg repository there

bind -ac /dist/plan9front /n/src9

# build the iso

cd /sys/lib/dist

mk /tmp/9front.$objtype.iso

5.4 - Common Problems when Compiling and Building

Most of the time problems in the build process are caused by not following the above directions carefully.

People who complained about this section of the FQA have so far not submitted anything better.

Good luck.

5.4.1 - Updating compilers

Changes to the compilers may necessitate updating the compiler before rebuilding the rest of the system:

cd /sys/src/cmd/cc; mk install

# choose the appropriate compiler for your architecture

cd /sys/src/cmd/6c; mk install

FQA INDEX | FQA 4 - 9front Installation Guide | FQA 6 - Networking