Introduction to
Gentoo Linux

Rajiv Manglani
Gentoo Linux PPC Developer

rajiv@alum.mit.edu	rajiv@gentoo.org

utterly minor additions: Dan Barrett <nullpointer@pobox.com>

Gentoo Linux

Started 5 years ago by Daniel Robbins.

Source-based meta distribution.

x86, PPC, 32-bit or 64-bit Sparc, Alpha

Active developer community.

All developers are volunteers.

GPL-2, LGPL, or other OSI-approved license.

Bug-fixes and patches submitted upstream.

How We Came to Gentoo

UNIX experience

Linux experience

Gear at home

RedHat annoyances

config.rpmnew.

OpenSSH privilege separation.

PHP 4.2.x and xslt.

wget 1.8 ?

qmail ?

No package management for non-rpm files.

Gentoo features

We provide scripts which download, compile, and install packages.

glibc, gcc, ext3, ReiserFS, XFS, ALSA, pcmcia-cs, Xfree86 OpenGL, KDE, Gnome

devfs, GRUB, lilo, yaboot, BootX.

Multiple kernel possibilities

Vanilla 2.4.20, aa-, ac-, acpi-, openmosix-, ppc-, redhat-sources, preempt, low latency, EVMS.

Prelinking, ccache.

genkernel tool for one-step kernel build

Portage features

Modeled on the ports-based BSD distributions.

Dependency checking, extreme customization.

No predefined set of optimization levels or configure options.

Original source tarballs are downloaded.

System is built to user specifications.

Compiles are optimized for your specific hardware.

E.g. Altivec on G4 PPC chips, Pentium versus Athlon.

Specify settings once, and all packages are built to those options.

USE flags

Globally defined list of features.

Configure yours in /etc/make.conf.

USE flags

Each one defines specific functionality for each package to support.

USE flags generally map onto --configure options.

“Opt-in” versus “opt-out”.

Install only what you want. No need to trim down a default installation.

Sample USE flags

Sample /etc/make.conf

# Build-time functionality

USE="X xv mmx arts odbc cups lame slang readline berkdb gdbm tcpd pam libwww ssl alsa nls mitshm perl gif sdl vorbis ogg gtk qt kde motif opengl mozilla objprelink"

# Host Setting

CHOST="i686-pc-linux-gnu"

# Host and optimization settings

#CFLAGS="-mcpu=athlon-xp -O3 -pipe"

#CFLAGS="-march=pentium3 -O3 -pipe"

CXXFLAGS="${CFLAGS}"

GENTOO_MIRRORS="<your_mirror_here> http://www.ibiblio.org/pub/Linux/distributions/gentoo"

Sample /etc/make.conf

# Portage Directories

PORTAGE_TMPDIR=/var/tmp

PORTDIR=/usr/portage

DISTDIR=${PORTDIR}/distfiles

PKGDIR=${PORTDIR}/packages

PORT_LOGDIR=/var/log/emerge/

# Fetching files

FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"

RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"

# FETCHCOMMAND='/usr/bin/proz --no-getch -s ${URI} -P ${DISTDIR}'

# Advanced Features

MAKEOPTS="-j2"

AUTOCLEAN="yes"

FEATURES="sandbox ccache buildpkg"

RSYNC_RETRIES="3"

ALSA_CARDS="emu10k1"

Portage demo

rsync

Package searching, installation, cleaning, removal

--pretend

--deep

Other options

Ebuild command for developers.

etc-update

CONFIG_PROTECT

/var/db/pkg

/usr/portage/distfiles

Ebuild scripts

Easy to read format, clear separation of phases.

KEYWORDS, DEPEND.

Stable versus testing.

Ebuild scripts in detail

Naming convention

Package_name-version:	blu-2.8

Release indicators after underscore: linux-2.4.20_pre10

File format

Variables

Dependencies

Standard functions

pkg_setup()

src_unpack()

src_compile()

src_install()

Sample Ebuild: deps

#

# My ebuild script (gentooZealot@cubefarm.aq

#

SAFE_VERSION="2.09"

SRC_URI="ftp://ftp.perl.org/pub/CPAN/src/${MY_P}.tar.gz

ftp://ftp.perl.org/pub/CPAN/modules/by-module/DB_File/DB_File-${DB_FILE_VERSION}.tar.gz

ftp://ftp.perl.org/pub/CPAN/modules/by-module/Safe/Safe-${SAFE_VERSION}.tar.gz"

HOMEPAGE="http://www.perl.org/"

SLOT="0"

KEYWORDS="x86 amd64 sparc ppc alpha mips hppa ia64"

IUSE="berkdb doc gdbm threads"

DEPEND="sys-apps/groff

berkdb? ( sys-libs/db )

gdbm? ( >=sys-libs/gdbm-1.8.0 )

>=sys-apps/portage-2.0.48-r4

=sys-devel/libperl-${PV}*

!<dev-perl/ExtUtils-MakeMaker-6.05-r6

!<dev-perl/File-Spec-0.84-r1

!<dev-perl/Test-Simple-0.47-r1”

Sample Ebuild: std. funcs

pkg_setup() {

if [ -n "`use threads`" ]

then

ewarn "Threading? Uh oh!"

rm -rf /

reboot

else

ewarn ""

ewarn "PLEASE NOTE: If you want to compile perl-5.8 with"

ewarn "threading enabled , you must restart this emerge"

ewarn "with USE=threads emerge...."

ewarn ""

fi

if [ ! -f /usr/lib/${LIBPERL} ]

then

# Make sure we have libperl installed ...

eerror "Cannot find /usr/lib/${LIBPERL}! Make sure that you"

eerror "have sys-libs/libperl installed properly ..."

die "Cannot find /usr/lib/${LIBPERL}!"

fi

}

Binary packages

Build your own, distribute packages to your machines.

emerge --buildpkg

GRP (Gentoo Reference Platform)

Pre-built binary packages using default options.

Gnome2, KDE, openoffice.

Installation

Doesn’t it take a long time to install packages?

Designed for modern hardware.

Will run on a Pentium or PPC 603 with 64mb RAM.

Net connection required.

Secure by default because nothing is installed by default.

Packages are installed into a “staging” directory, then merged.

Virtual packages.

Installation process

Currently no graphical installer.

Just follow the detailed install documents.

Boot from CD, setup networking, partition.

Unpack stage 1, stage 2, or stage 3.

Chroot, bootstrap or emerge system.

Compile kernel, syslogger.

Setup bootloader.

Stage tarballs

Stage 1 install

Bare-bones. Need to bootstrap, compile gcc, glibc, system (make, perl, etc), kernel, and user environment.

Stage 2 install

Already bootstrapped. Compile system, kernel, and user environment.

Stage 3 install

Base system included. Compile kernel and boot manager.

Init scripts

Named (not numbered) run levels.

Smart dependencies.

Scripts can ‘use’ or ‘depend’ on others.

Start / Stop / Pause.

/etc/runlevels/default/.

Coming soon

distcc, a distributed C compiler.

CPAN/Portage integration.

Install and manage dependencies via Portage.

Package management for perl modules (including uninstall).

CD-based installers.

Port to S/390, ARM, embedded devices.

cvsup instead of rsync.

Try out Gentoo Linux

Download from www.gentoo.org.

16-230mb iso images, plus 10-85mb stage files.

Unreal Tournament 2003 demo for x86/NVIDIA.

Does not touch your hard drive.

Live CDs for x86, PPC (NewWorld and OldWorld).

All live CDs are also install and rescue CDs.

Documentation

Installation, FAQs.

Portage user manual.

USE flags, ENV.D, Security guide, AFS.

Desktop configuration guide, rc-scripts, ALSA.

Developer documentation

Ebuild creation, eclass.

User-Mode Linux.

Documentation guide (XML syntax).

Gentoo Community

Close contact with end users.

Most ebuild scripts are submitted by users.

Multiple mailing lists (each architecture, documentation, security).

IRC channels (on irc.freenode.net).

Web-based forums (on forums.gentoo.org).

Fully-public bug tracking (bugs.gentoo.org).

Linux World Expo this week.

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/1.0 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

The Gentoo Linux logo is Copyright 2002 Gentoo Technologies, Inc., used with permission.

PowerPoint Presentation - Introduction to Gentoo Linux

Rajiv Manglani

2003-01-19T20:45:53