💾 Archived View for 9til.de › fqa › fqa5.gmi captured on 2024-08-18 at 19:12:17. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
FQA INDEX | FQA 4 - 9front Installation Guide | FQA 6 - Networking
FQA 4 - 9front Installation Guide
[‡ thesource]
Some reasons why you might actually wish or need to build from source:
• Updates have been committed since you performed the installation.
• Test or develop new features.
9front uses hg(1) to synchronize the system with the 9front repository:
cd /
bind -ac /dist/plan9front /
hg incoming
hg -v pull -u
which is consolidated in the command:
sysupdate
If hg refuses to update due to conflicts (e.g. if you installed something locally which was later incorporated into 9front), this is a quick workaround which discards local changes:
hg update -C --clean
After the tree is updated, recompile/build the updated programs as needed.
5.2.1.1 - hgrc
During installation, the 9front Mercurial repository is copied to /dist/plan9front/.hg, 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 add then add the following to $home/lib/hgrc :
[trusted]
users=glenda
groups=glenda
To use Mercurial with webfs(4) instead of Python’s built-in HTTP:
[extensions]
hgwebfs=
Note: The hgwebfs extension expects login credentials to be present in factotum(4), else Mercurial will abort when any attempt is made to access resources that require authentication. To add credentials to factotum :
http://man.9front.org/4/factotum
echo 'key proto=pass realm=PAIN server=code.9front.org service=http \
user=cinap_lenrek !password=FckG00gl!' >>/mnt/factotum/ctl
Note: Depending on who you are and the repository being used, your credentials may differ.
Credentials may be saved permanently and loaded into factotum at boot time using FQA 8.4.7 - secstore.
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)).
cd /
. /sys/lib/rootstub
cd /sys/src
mk install
mk clean
cd /sys/man
mk
cd /sys/doc
mk
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 5.2.2.1 - 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?
5.2.2.1 - 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:
cd /
. /sys/lib/rootstub
cd /sys/src
objtype=amd64 mk install
The 9front ISO is a livecd that also serves as install media.
Note: Currently, only the 386 architecture is built for the ISO. Read: FQA 8.9 - Bootstrapping architectures not included on the ISO for more information on booting other architectures.
bind /root /n/src9
bind -ac /dist/plan9front /n/src9
cd /sys/lib/dist
mk /tmp/9front.$objtype.iso
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.
Changes to the compilers may necessitate updating the compiler before rebuilding the rest of the system:
cd /sys/src/cmd/cc; mk install
cd /sys/src/cmd/6c; mk install
FQA INDEX | FQA 4 - 9front Installation Guide | FQA 6 - Networking