Intro to Gentoo

download Intro to Gentoo

of 20

Transcript of Intro to Gentoo

  • 8/13/2019 Intro to Gentoo

    1/20

    Introduction to

    Gentoo Linux

    Zhang, Le

    Gentoo Linux Developer

    January 11, 2009

    [email protected] [email protected]

  • 8/13/2019 Intro to Gentoo

    2/20

    Me in Gentoo

    http://zhangle.is-a-geek.org

    http://www.gentoo-cn.org

    Gentoo Chinese Documentation

    Gentoo Monthly Newsletter Chinese version Gentoo-china google group

    Gentoo-china and Loongson overlay

    #gentoo-cn on irc.gentoo.org

    http://www.linuxsir.org/bbs/forum59.html

    http://forums.gentoo.org/viewforum-f-50.html

    http://tinyurl.com/loongson-gentoo

  • 8/13/2019 Intro to Gentoo

    3/20

    How I came to Gentoo

    GNU/Linux user since 2002

    Regular GNU/Linux user since 2004

    RedHat 7.3 in the spring of 2002 for "hacking"

    Switched to Gentoo in the summer of 2004. All my machines running/will run Gentoo

    HP zt3000 notebook (~x86, regular work)

    Loongson 2E box (~mipsel, hosting gentoo-cn.org)

    Loongson 2F box (~mipsel, mips n32 ABI dev machine)

    PS3 (~ppc)

    Yeelong Laptop (~mipsel, will arrive soon)

  • 8/13/2019 Intro to Gentoo

    4/20

    Overview

    Gentoo

    the fastest swimming penguin

    Base 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

  • 8/13/2019 Intro to Gentoo

    5/20

    History

    Started by Daniel Robbins with the name "Enoch" in 1999

    Changed name to "Gentoo" later due to speed increase as aresult of EGCS adoption

    Portage - the next generation ports

    borned after a detour toFreeBSD

    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 decises on global issues and policies

  • 8/13/2019 Intro to Gentoo

    6/20

    Gentoo features

    Beautiful splash screen, console and colorful CLI Fully automated software installation

    Automatic dependency solving and fulfillment

    Automatic 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 almost all architectures and OS's amd64, alpha, hppa, ia64, mips, ppc, ppc64(cell), s390, sh4,

    sparc64, x86

    other Linux distros, Mac OS X, Solaris, FreeBSD, AIX, Interix

    Configuration file protection and automerge

  • 8/13/2019 Intro to Gentoo

    7/20

  • 8/13/2019 Intro to Gentoo

    8/20

    Portage features

    Customization of CFLAGS, LDFLAGS

    USE flags (more on that later)

    Various optional features - choose to suit your own needthrough 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

  • 8/13/2019 Intro to Gentoo

    9/20

    Portage features (con't)

    SMP support emerge --jobs=JOBSload-average=LOAD

    MAKEOPTS='-jN', where N is number of processors + 1

    FEATURES parallel-fetch

    Auto resuming after failure whenever possible emergekeep-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

  • 8/13/2019 Intro to Gentoo

    10/20

    Portage features (con't)

    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 newlib

  • 8/13/2019 Intro to Gentoo

    11/20

    Portage tree

    Gentoo's software repository

    One of the largest in terms of number of packages No package split, i.e. no package like foo-devel

    Provide non-free software, e.g. adobe flash player/reader

    Numerous overlays

    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 gentoo-china, loongson, KDE, LXDE, toolchain, x11....

    managed by "layman"

  • 8/13/2019 Intro to Gentoo

    12/20

    Ebuild file

    Gentoo's package format

    Defines variables and functions used to automatecompilation and installation of software

    KEYWORDS - define branch for this package

    SLOT - mechanism for multiple version coexistence

    DEPEND, RDEPEND, PDEPEND - Build time, Runtime,Post-merge dependencies

    LICENSE

    the license the software is released under SRC_URI - where to get sources

    Function - src_unpack(), src_compile(), src_install()

    Eclass - ebuild's library

  • 8/13/2019 Intro to Gentoo

    13/20

    USE flags

    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="-gnome kde qt -arts -nls"

  • 8/13/2019 Intro to Gentoo

    14/20

    Init system

    OpenRC, written in C and POSIX-compliant shellscript, for compatibility with Gentoo on FreeBSD andembedded 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

  • 8/13/2019 Intro to Gentoo

    15/20

    Documentation

    Gentoo Handbook (install, embedded, security...)

    Desktop docs (X, nVidia/ATI, GNOME, KDE, fluxbox,xfce, alsa, DRI, power management...)

    Upgrade Guide (kernel, gcc, apache, MySQL, PHP...)

    System admin (security handbook, localization, cron,sudo, kernel, prelink, distcc, mail server, database, webserver, virtualization...)

    Developer documentation (dev handbook, devmanual)

    Project documentation (Gentoo projects operation)

  • 8/13/2019 Intro to Gentoo

    16/20

    Gentoo Community

    Close contact with end users

    Many ebuilds submitted by users (sunrise overlay)

    IRC channels (irc.gentoo.org, currently an alias tofreenode), #gentoo is one of the largest on thenetwork with an average of 900+ users.

    Web-based forums (on forums.gentoo.org), 4,685,232topics as of today, 1800+ posts per day.

    Fully public bug tracking (bugs.gentoo.org)

    "Gentoo Bug Day" - First saturday of each month

    Developers attend FOSS events around the world

  • 8/13/2019 Intro to Gentoo

    17/20

    Stay informed

    Main page - http://www.gentoo.org

    Gentoo planet - http://planet.gentoo.org

    Gentoo forums - http://forums.gentoo.org

    Gentoo Monthly Newsletter (GMN)

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

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

    Gentoo mailing lists http://www.gentoo.org/main/en/lists.xml

    Gentoo packages - http://packages.gentoo.org

    Gentoo Linux Security Announcements (GLSA)

  • 8/13/2019 Intro to Gentoo

    18/20

    Is Gentoo for me?

    If you are lazy

    If you are a perfectionist

    If you like being in control of everything

    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 haveit easily, regularly updated

    If you want a fully functioning modern GNU/Linuxsystem on a new CPU in a short period of time

  • 8/13/2019 Intro to Gentoo

    19/20

    Introduction to

    Gentoo Linux

    Zhang, Le

    Gentoo Linux Developer

    January 11, 2009

    [email protected] [email protected]

  • 8/13/2019 Intro to Gentoo

    20/20

    Copyright 2008 Zhang Le. Some rights reserved.

    The Gentoo Linux logo is Copyright 2002 Gentoo Technologies, Inc.,

    used with permission.

    This work is licensed under the Creative Commons Attribution-

    NonCommercial-ShareAlike License. To view a copy of this license,

    visit or send aletter to Creative Commons, 559 Nathan Abbott Way, Stanford,

    California 94305, USA.

    Please contact Zhang Le

    for commercial uses of this work.

    http://creativecommons.org/licenses/by-nc-sa/2.0http://creativecommons.org/licenses/by-nc-sa/2.0http://creativecommons.org/licenses/by-nc-sa/2.0http://creativecommons.org/licenses/by-nc-sa/2.0http://creativecommons.org/licenses/by-nc-sa/2.0http://creativecommons.org/licenses/by-nc-sa/2.0