23
Gentoo Linux, or Why in the World You Should Compile Everything Donnie Berkholz Council Member & Sr. Developer Gentoo Linux [email protected] @dberkholz

Gentoo Linux, or Why in the World You Should Compile Everything

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: Gentoo Linux, or Why in the World You Should Compile Everything

Gentoo Linux, orWhy in the World You Should

Compile Everything

Donnie BerkholzCouncil Member & Sr. Developer

Gentoo Linux

[email protected]

@dberkholz

Page 2: Gentoo Linux, or Why in the World You Should Compile Everything

Me in Gentoo

Page 3: Gentoo Linux, or Why in the World You Should Compile Everything

How I came to Gentoo

Page 4: Gentoo Linux, or Why in the World You Should Compile Everything

Overview

Page 5: Gentoo Linux, or Why in the World You Should Compile Everything

History

Page 6: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 7: Gentoo Linux, or Why in the World You Should Compile Everything

Gentoo features(con't)

• Advantages of compiling from source• Multiple versions/implementations handling• Binary package support

Page 8: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 9: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 10: Gentoo Linux, or Why in the World You Should Compile Everything

Portage features (con't)

• Embedded system support• Features in portage 2.2

• License filtering• Generic package sets• FEATURES preserve-libs

Page 11: Gentoo Linux, or Why in the World You Should Compile Everything

Portage tree

• Gentoo's software repository• One of the largest• Bleeding edge packages• Branches• Overlays

Page 12: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 13: Gentoo Linux, or Why in the World You Should Compile Everything

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"

Page 14: Gentoo Linux, or Why in the World You Should Compile Everything

Init system

• OpenRC• Named run levels (boot, default)• Smart dependencies• Parallel startup• Hotplug/Coldplug

Page 15: Gentoo Linux, or Why in the World You Should Compile Everything

Documentation

• Gentoo Handbook• Desktop docs• Upgrade guides• System admin• Developer docs• Project docs

Page 16: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 17: Gentoo Linux, or Why in the World You Should Compile Everything

Stay informed

• Main page - http://www.gentoo.org• Planet - http://planet.gentoo.org • Forums - http://forums.gentoo.org• Gentoo Monthly Newsletter (GMN)

• http://www.gentoo.org/news/zh_cn/gmn/

• IRC channels• http://www.gentoo.org/main/en/irc.xml

• Mailing lists• http://www.gentoo.org/main/en/lists.xml

• Packages - http://packages.gentoo.org• Gentoo Linux Security Announcements (GLSA)

Page 18: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 19: Gentoo Linux, or Why in the World You Should Compile Everything

EAPI: Ebuild API

• EAPI 0: Forever...• EAPI 1: Nov 2007• EAPI 2: Sept 2008• EAPI 3: Jan 2010• EAPI 4: Jan 2011

Page 20: Gentoo Linux, or Why in the World You Should Compile Everything

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

Page 21: Gentoo Linux, or Why in the World You Should Compile Everything

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.

Page 22: Gentoo Linux, or Why in the World You Should Compile Everything

Gentoo Linux, orWhy in the World You Should

Compile Everything

Donnie BerkholzCouncil Member & Sr. Developer

Gentoo Linux

[email protected]

@dberkholz

Page 23: Gentoo Linux, or Why in the World You Should Compile Everything

<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.