The Gentoo Distribution

http://www.gentoo.org/




Joshua Sled

http://asynchronous.org/jsled

http://asynchronous.org/preso/vague/gentoo

The Gentoo Distribution

  • Overview
  • Features
  • Philosophy
  • Structure
  • Packages / Portage
  • Support

Overview

  • Source-based "meta-distribution".
  • Started in 1999 by Daniel Robbins.
  • x86, AMD64, PowerPC, 32-bit and 64-bit Sparc, Alpha, IA64, S/390, HPPA, ARM, and MIPS
  • Active, all-volunteer developer community.

Features

  • recent glibc, gcc, ext3/ReiserFS/XFS/JFS, ALSA, pcmcia-cs, USB.
  • SELinux, PaX/Grsecurity, Propolice
  • Xfree86, XOrg, KDE, Gnome
  • qmail++, postfix, exim.
  • devfs, udev, GRUB, lilo/milo/silo, yaboot, BootX.
  • Multiple kernel possibilities
    • Vanilla 2.4, 2.6, aa-, ac-, ck-, gentoo-, mm-, openmosix-, ppc-, rsbac-, uclinux-, xbox- sources.
    • Gentoo kernels with preempt, low latency, EVMS.
  • Prelinking, ccache, distcc.

Philosophy and Social Contract

Philosophy

  • The user has work to do: let them do it.
  • Allow user to express will about their system, not tool-author's or package-maintainer's.

Social Contract

  • OSI-approved licenses: GPL-2 and LGPL especially.
  • Never depend on non-free software (but not excluded – the user might want that).
  • Always freely available.
  • Open development and bug process, upstream submission.

Structure

  • Top-Level Projects
    • apache, council, forums, java, portage, base, desktop, devrel, documentation, eselect, gentoo-alt, hardened, infrastructure, kernel, metastructure, pr, qa, releng, security
  • council - Elected, makes project-wide decisions; slacker rules.
  • metastructure - Concerned with the structure of the Projects.
    • GELP - Gentoo Linux Enhancement Proposals
      • e.g. GELP 42: Critical News Reporting — A mechanism for ebuilds to record persistent news items, and a tool for reviewing them.
  • security - Gentoo Linux Security Announcements (GLSA)
    • In-development glsa-check util.

Portage

  • Soul of Gentoo.
  • BSD ports-inspired.
  • Written in bash + shell-utils and python.
  • Framework for shell-scripts describing package building.
  • Synchronized against Gentoo-provided copy.

Portage Features

  • download sources, patch, configure, build, install
  • ebuild files specify dependency requirements, package-specific config/build behavior.
  • Virtuals (virtual/java)
  • USE flags: conditional feature selection
    • Generally map to ./configure options.
    • Global (USE="-gnome kde qt arts -nls python perl oggvorbis opengl sdl -postgres jpeg png truetype dvd avi aalib mpeg encode fbcon mmx")
    • Local (gencertdaily for qmail)
  • Masking: stable vs. unstable flag, per-platform.
  • Slotting: multiple versions of the same package, side-by-side.
  • Overlay trees.

Basic ebuild.

# /usr/portage/sys-apps/coreutils/coreutils-5.2.1-r6.ebuild
PATCH_VER=0.11
PATCHDIR="${WORKDIR}/patch"

DESCRIPTION="Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...)"
HOMEPAGE="http://www.gnu.org/software/coreutils/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2
	mirror://gentoo/${P}.tar.bz2
	mirror://gentoo/${P}-patches-${PATCH_VER}.tar.bz2
	http://dev.gentoo.org/~vapier/dist/${P}-patches-${PATCH_VER}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86"
IUSE="acl build nls selinux static"

RDEPEND="selinux? ( sys-libs/libselinux )
	acl? ( sys-apps/acl sys-apps/attr )
	nls? ( sys-devel/gettext )
	>=sys-libs/ncurses-5.3-r5"
DEPEND="${RDEPEND}
	>=sys-apps/portage-2.0.49
	=sys-devel/automake-1.8*
	>=sys-devel/autoconf-2.58
	>=sys-devel/m4-1.4-r1
	sys-apps/help2man"

src_unpack() {
	unpack ${A}
	cd "${S}"
  

Overrides

  • /etc/portage/package.use
    # 2005.05.04; compilation triggers GCC bugs in ASM... :(
    # See http://bugs.gentoo.org/buglist.cgi?[...]
    media-video/ffmpeg -mmx
  • /etc/portage/package.mask
    # 2005.08.19 -- kernel recompile needed
    =x11-base/x11-drm-20050502
  • /etc/portage/package.unmask
    # 2005.06.08, jsled, adventure!
    =dev-java/sun-jdk-1.5.0*
    =dev-java/java-sdk-docs-1.5.0*
  • /etc/portage/package.keywords
    # 2005.10.18 -- evo 2.4.x
    =mail-client/evolution-2.4.1 ~x86
    =gnome-extra/evolution-data-server-1.4.1 ~x86
    =gnome-extra/libgtkhtml-3.8.1 ~x86
    
    # 2005-11-10 -- openoffice 2.0
    =app-office/openoffice-bin-2.0.0 ~x86

Portage Usage

  • emerge, ebuild, equery
  • emerge --sync \
    && emerge --update world
    — keeps whole system up to date.
    • Weekly? Monthly?
    • 1 year = 1 weekend (3-year-old Athlon XP+)
    • Periodic "profile" changes
  • etc-update — interactive config file update merging.
  • revdep-rebuild — reverse-dependency check
  • emerge --binpkg — creates binary package from locally-built

Installer

  • No graphical installer; detailed manual install instructions.
  • Gentoo Reference Platform pre-compiled binaries.
  • Install Stages...
    • Stage 1: Nothing. Bootstrap; compile gcc, glibc, system, kernel, user environment.
    • Stage 2: Bootstrapped. Compile system, kernel and user environment.
    • Stage 3: Base system. Compile kernel, boot manager.
    • ... as of Mon (2005-11-14), the install guide encourages Stage 3 with optional Stage 1/2.
  • ISOs and LiveCDs available most arches.

Support/Community

  • Large, active community.
  • irc://irc.freenode.net/gentoo - very busy...
  • #gentoo-{x86,sparc,...,
          java,python,...,
          hardened,security,...,
          web,mythtv,laptop,kde,...}:
    119 channels
  • http://forums.gentoo.org, http://packages.gentoo.org, http://bugs.gentoo.org
  • Easy to create ebuilds -> lots of user-submitted ebuilds (plus overlay trees).
  • Documentation
    • Gentoo Handbook
    • Lots of HOWTOs, FAQs
    • Ebuild/Portage docs

Gentoo Linux

  • Source-based distribution.
  • Building from source
    • flexibility
    • time, energy
  • Active support infrastructure.


(fin)