Gentoo Linux is a special flavor of Linux that can be automatically optimized and customized for just about any application or need. Extreme performance, configurability and a top-notch user and developer community are all hallmarks of the Gentoo experience.
As a leader of Gentoo, I will provide an overview of how it works from a developer's and a user's point of view, and why you should be running it especially if you're:
- In need of an awesome development environment;
- Interested in learning what's inside the black box of Linux;
- OCD about having a perfectly configured setup; or
- Building an embedded, minimal system or a high-performance cluster.
If there's interest, I can also talk about future developments on the horizon for Gentoo, package management in general, etc.
Gentoo Linux, or Why in the World You Should Compile Everything
1. Gentoo Linux, or
Why in the World You Should
Compile Everything
Donnie Berkholz
Council Member & Sr. Developer
Gentoo Linux
dberkholz@gentoo.org
@dberkholz
6. Gentoo features
• Beautiful splash screen, console and
colorful CLI
• Fully automated software installation
• Extremely easy maintenance
• Available in most architectures and OS's
• Configuration file protection and automerge
8. Portage features
• Customization of CFLAGS, LDFLAGS
• USE flags (more on that later)
• Various optional features - choose to suit
your own need through FEATURES variable
• Protection for live system
• FEATURES sandbox, collision-protect, protect-
owned
• Compilation speeding up
• FEATURES ccache, distcc
• System trimming
• FEATURES nodoc, noman, noinfo
• INSTALL_MASK
9. Portage features
(con't)
• SMP support
• emerge --jobs=JOBS --load-average=LOAD
• MAKEOPTS='-jN', where N is number of processors
+ 1
• FEATURES parallel-fetch
• Auto resuming after failure whenever
possible
• emerge --keep-going
• Blocker automatic solving
• com_err and ss V.S. e2fsprogs-libs
• Debugging support
• Adding "-g3 -ggdb3 -gdwarf-2" to CFLAGS
• FEATURES keepwork, nostrip, splitdebug,
installsources
10. Portage features
(con't)
• Embedded system support
• Features in portage 2.2
• License filtering
• Generic package sets
• FEATURES preserve-libs
11. Portage tree
• Gentoo's software repository
• One of the largest
• Bleeding edge packages
• Branches
• Overlays
12. Ebuild file
• Defines variables and functions used to
compile and install software
• KEYWORDS
• SLOT
• DEPEND, RDEPEND, PDEPEND
• LICENSE
• SRC_URI
• Functions - src_unpack(), src_compile(),
src_install()
• Eclasses
13. USE flags
• Map onto ./configure options
• Defaults defined by profile
• Define your own in addition to defaults
• Install only what you want
• Example:
• USE="-gnome kde qt -arts -nls"
14. Init system
• OpenRC
• Named run levels (boot, default)
• Smart dependencies
• Parallel startup
• Hotplug/Coldplug
16. Gentoo Community
• Close contact with end users
• Many ebuilds submitted by users (sunrise
overlay)
• IRC
• Web forums
• Fully public bug tracking
• Developers attend FOSS events around the
world
18. Is Gentoo for me?
• If you are lazy
• If you are a perfectionist
• If you like being in control
• If you want a stable and secure system
• If you want to know how a Unix-like
system works
• If you want to make the most out of your
hardware
• If you want to make your own distribution
• If you want to install GNU/Linux on your
PS3 and have it easily, regularly updated
19. EAPI: Ebuild API
• EAPI 0: Forever...
• EAPI 1: Nov 2007
• EAPI 2: Sept 2008
• EAPI 3: Jan 2010
• EAPI 4: Jan 2011
20. EAPI: Ebuild API
• 201499: single dependency variable
• DEPENDENCIES: “run+build: dev-libs/foo”
• 174412: remove EXPORT_FUNCTIONS
• Should be automated
• 179800: always-called eclass phase
functions
• Run something at src_prepare without making
sure ebuilds call $ECLASS_src_prepare when
overriding
• 185567: function to package source code
• Creating custom tarballs from upstream, e.g.
• 186454: move DESCRIPTION to metadata.xml
• package-wide, not per-ebuild
21. EAPI: Ebuild API
• 402167: move HOMEPAGE to metadata.xml
• 399019, 399307: move unpacking logic to
eclasses
• WIP
• remove need to dep on proper unpacker
• 354219: zero or one-of for REQUIRED_USE
• many cases of REQUIRED_USE would benefit from
a zero-of-or-one-of / at-most-one-of group.
22. Gentoo Linux, or
Why in the World You Should
Compile Everything
Donnie Berkholz
Council Member & Sr. Developer
Gentoo Linux
dberkholz@gentoo.org
@dberkholz
23. <http://dev.gentoo.org/~dberkholz/IntroToGentoo.odp>
Copyright 2006–2012 Rajiv Manglani, Zhang Le, Donnie
Berkholz. Some rights reserved.
The Gentoo Linux logo is Copyright 2002 Gentoo
Foundation, used with permission.
This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike License. To
view a copy of this license, visit <
http://creativecommons.org/licenses/by-nc-sa/2.0> or
send a letter to Creative Commons, 559 Nathan Abbott
Way, Stanford, California 94305, USA.
Hinweis der Redaktion
Gentoo – the fastest swimming penguin Based either on Linux, FreeBSD, etc Source-based metadistribution Can be optimized and customized for any purpose Extremely configurable, portable, easy-to-maintain All volunteer, active developer community Is and will always be Free Software Commitment to giving back to the FOSS community
Started by Daniel Robbins with the name &quot;Enoch&quot; in 1999 Changed name to &quot;Gentoo&quot; later due to speed increase as a result of EGCS adoption Portage - the next generation ports – born after a detour to FreeBSD Gentoo Linux 1.0 released on 2002/03/31 Gentoo Foundation set up in 2004 to take care of financial issue and protect intellectual property Gentoo Council decides on global issues and policies
Beautiful splash screen, console and colorful CLI Fully automated software installation Dependency solving and fulfillment Source fetching, patching, compiling, installing Extremely easy maintenance 'system' and 'world' package set keep 'world' up-to-date with a single command versionless, seamless upgrading Available in most architectures and OS's amd64, alpha, arm, hppa, ia64, mips, ppc, sparc, x86 other Linux distros, Mac OS X, Solaris, FreeBSD, AIX, Interix Configuration file protection and automerge
Advantages of compiling from source Optimized for your own CPU DIY as soon as new software release is out Even if not released yet - live ebuilds (cvs/svn/git...) Multiple versions/implementations handling coexist along with each other peacefully switch on-the-fly mechanisms - software slots, virtual package tools - eselect , gcc-config, binutils-config, java-config Binary package support Native binary package format & repositories Alien binary package format support, e.g. rpm, deb. Upstream binary package: openoffice-bin, mozilla-firefox-bin
Embedded system support crossdev - create any arbitrary cross toolchain in one command First set CBUILD, PORTAGE_CONFIGROOT and ROOT properly Then just emerge! Features in portage 2.2 License filtering Generic package sets @live-rebuild - all live ebuilds installed on your system @module-rebuild - all out-of-tree kernel module FEATURES preserve-libs preserve old lib after lib version bump emerge @preserved-rebuild to remove old lib and link apps to new lib
Gentoo's software repository One of the largest in terms of number of packages No split packages, i.e. foo-devel, -headers Provide non-free software, e.g. adobe flash player/reader Bleeding edge packages Branches - stable, testing Defined your global choice in /etc/make.conf Tweak for each package in /etc/portage/package.keywords Overlays - a subset of tree with higher priority GNOME, KDE, toolchain, x11.... managed by &quot;layman&quot;
Defines variables and functions used to compile and install software KEYWORDS - define branch for this package SLOT - mechanism for multiple version coexistence DEPEND, RDEPEND, PDEPEND - Build time, Runtime, Post-merge dependencies LICENSE - the software license SRC_URI - where to get sources Function - src_unpack(), src_compile(), src_install() Eclass - ebuild's library
Gentoo's way to customize software components USE flags generally map onto ./configure options Defaults defined by profile /etc/make.profile Define your own in addition to defaults Global flags in /etc/make.conf Package specific flags in /etc/portage/package.use Install only what you want Example: USE=&quot;-gnome kde qt -arts -nls&quot;
OpenRC, written in C and POSIX-compliant shell script, for compatibility with Gentoo on FreeBSD and embedded systems. Named run levels (boot, default) Smart dependencies Scripts can 'use' or 'need' others. Scripts can start 'before' or 'after' others. Parallel startup option Hotplug/Coldplug services
Close contact with end users Many ebuilds submitted by users (sunrise overlay) IRC channels (irc.gentoo.org, currently an alias to freenode), #gentoo is one of the largest on the network with an average of 900+ users. Web-based forums (on forums.gentoo.org), 5,495,131 posts, 1500+ posts per day. Fully public bug tracking (bugs.gentoo.org) Developers attend FOSS events around the world