2.0 KiB
2.0 KiB
General Setup
Follow the Gentoo Handbook for installing Gentoo
Generally, you can just use the amd64 version of Gentoo, as most servers now are 64-bit compatible
-
When getting the two tarballs for stage3 and portage, I recommend first retrieving the tarball, then retrieving portage, before extracting either. This way you only have to use links once.
- run
links http://www.gentoo.org/main/en/mirrors.xml
- Go to releases -> amd64 -> autobuilds and select an appropriate stage3. Hardened is recommended for a server.
- Go up until you reach the first mirror directory. Go to the
snapshots
folder and downloadportage-latest.tar.bz2
- Extract the stage3 tarball :
tar xvjpf stage3-*.tar.bz2
- Extract portage
tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr
- run
-
In your
/etc/make.conf
file, I recommend the following for compile options:CFLAGS="-0s -pipe -march=native -pthread""
- Set the MAKEOPTS property to 2x the number of processors/cores, eg, dual core would be
MAKEOPTS="-j4"
-
Set your profile to a server profile, optionally, set it to a hardened server profile.
-
Compile the kernel using genkernel, as it's less involved than manually configuring everything for the kernel.
Install LLVM/Clang (Optional)
Clang is a faster compiler than the default GCC. It produces binary as fast, or faster than GCC. To set up clang,
run `emerge llvm clang`
and add these to lines to the top of your `/etc/make.conf` file
CC=/usr/bin/clang
CXX=/usr/bin/clang++
If a package fails to compile with clang, you can comment out those lines, and recompile the package with GCC.