- Slides: 23
Introduction to Gentoo Linux Rajiv Aaron Manglani Gentoo Linux Developer January 17, 2006 rajiv@alum. mit. edu rajiv@gentoo. org
Gentoo Linux • Started in 1999 by Daniel Robbins. • Source-based meta distribution. x 86, AMD 64, Power. PC, 32 -bit and 64 -bit Sparc, Alpha, IA 64, S/390, HPPA, ARM, and MIPS. • Active all-volunteer developer community. • Social contract • • GPL-2, LGPL, or other OSI-approved license. • Will never depend on non-free software. • Will remain freely available. • Submit bugs and patches upstream. • Open development and bug process. • Gentoo council, arch teams, herds.
Philosophy • Most distributions have tools that manage the entire • • system. Do you work their way, or do they work for you? Design tools and systems that allow a user to do their work efficiently as possible, as they see fit. Appreciate the richness and flexibility of the Linux and Free Software community. Only possible when the tool is designed to reflect and transmit the will of the user. If the tool forces the user to do things a particular way, then the tool is working against, rather than for, the user.
How I came to Gentoo • UNIX user since 1999. • Su. SE, Mandrake, Red Hat, Slackware. • Switched to Gentoo in the winter of 2002. • Portable is an Asus Eee. PC 630 MHz, 1 gb RAM, 4 gb solid-state disk. • Workstation is a dual-core Opteron 165, 2 gb RAM, 2 x 400 gb disks. • Running Gentoo on multiple machines: Dual-core Opteron, Linksys NSLU 2, Soekris Net. Board.
Binary distros • Old versions of software, fixes back-ported. • No package management for non-RPM files. • No package management for programs installed from source. • How do you install Ubuntu on a 486 PC 104? • Why install security updates for packages you have never even heard of? • Do you reinstall each time a new version of Fedora, Ubuntu, or Su. SE comes out?
Gentoo features • glibc 2. 3, gcc 3. 4, ext 3, Reiser. FS, XFS, JFS, AFS, • • ALSA, pcmcia-cs, USB. Hardened: SELinux, Pa. X/Grsecurity. XOrg 7. 3, Open. GL, n. Vidia, ATI, KDE 4, Gnome 2. 20, My. SQL 5, PHP 5, Apache 2. 2. udev, GRUB, lilo, milo, silo, yaboot. Multiple kernel possibilities • Vanilla 2. 4. 36, 2. 6. 25, gentoo-, git-, mm-, hardened-, rsbac-, suspend 2 -, uclinux-, xbox-, xen- sources. • Gentoo kernels with preempt, low latency, EVMS. • Prelinking, ccache, distcc.
Portage features • We provide scripts which download, patch, compile, and install packages. • Modeled on the ports-based BSD distributions. • Dependency checking, extreme customization. • Original source tarballs are downloaded. • No need to wait for someone to make a binary package for your distribution. • The user specifies what they want, and the system is built to their specifications. • Compiles are optimized for your specific hardware. • E. g. Altivec on 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="-gnome kde qt arts -nls python perl oggvorbis • • opengl sdl -postgres jpeg png truetype dvd avi aalib mpeg encode fbcon mmx" Each one defines specific functionality for each package to support. USE flags generally map onto --configure options. Install only what you want. No need to trim down a default installation. “Opt-in” versus “opt-out”.
Package-specific flags • USE flag customization for each package • /etc/portage/package. use • media-video/mplayer -X aalib • Allow portage to use unstable package versions • /etc/portage/package. keywords • app-emulation/wine ~x 86 • Mask package versions that break things • /etc/portage/package. mask • >sys-kernel/gentoo-sources-2. 6. 23 -r 1
Ebuild scripts • Easy to read format, clear separation of phases. • KEYWORDS, DEPEND, PDEPEND, RDEPEND. • LICENSE, HOMEPAGE. • Stable versus testing. • CPAN/Portage integration. • Install and manage modules via Portage. • Package management for perl modules (including uninstall). • Ebuilds are automatically created for CPAN packages.
Installation • Doesn’t it take a long time to install packages? • Designed for modern hardware. • Will run on a Pentium or PPC G 3 with 64 mb RAM. • Built-in ccache, distcc support. • Net connection recommended. • “Secure” by default. • Because nothing is installed by default. • Packages are installed into a “staging” directory, then merged. • Virtual packages.
Portage demo • Package searching. • Updating repositories. • Updating, installation, cleaning, removal. • Metapackages • Ebuild command for developers. • etc-update • CONFIG_PROTECT • /var/db/pkg/
Binary packages • Build your own, distribute packages to your machines. • emerge --buildpkg • FEATURES="buildpkg” • BINHOST • Binary packages are portable between systems with the same CHOST, CFLAGS, and USE. • Or use Gentoo Catalyst.
Installation process • Limited graphical installer. • Problems with non-standard environments • Just follow the detailed install documents. • Boot from CD, setup networking, partition. • Unpack stage tarball. • Chroot, configure profile, USE. • Compile kernel, syslogger. • Setup fstab, bootloader. • Unmount, reboot.
Stage tarballs • For specific customization requirements, no longer recommended. • 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 ‘need’ others. • Scripts can start ‘before’ or ‘after’ others. • Start / Stop / Pause. • /etc/runlevels/default/
Try out Gentoo Linux • Download from www. gentoo. org. • 50 -600 mb iso images, plus 10 -85 mb stage files. • Install CD does not touch your hard drive. • Live CDs for x 86, PPC 64, Alpha, AMD 64, HPPA, Sparc, ARM, MIPS. • All install CDs are also rescue CDs.
Documentation • Gentoo Handbook. • Rated second favorite by Linux. Journal November 2005. • Installation, FAQs. • Portage user manual. • USE flags, ENV. D, Security guide. • Desktop configuration guide, Gnome, KDE, rc-scripts, ALSA, DRI, power management, Java. • AFS, Diskless/LTSP, Printing, IPv 6, Virtual Mailhost, mutt, udev, SHOUTCast. • Developer documentation • Ebuild creation, eclass. • Documentation guide (XML syntax).
Gentoo Community • Close contact with end users. • Most ebuild scripts are submitted by users. • IRC channels (on irc. freenode. net). #gentoo is the • • largest on the network with 900+ users. Web-based forums (on forums. gentoo. org), 1000+ posts per day, 100, 000+ topics. Fully-public bug tracking (bugs. gentoo. org), 20, 000+ hits per day. “Gentoo Bug Day. ” Developers attend Linux conventions around the world.
Staying informed • News on www. gentoo. org. • Gentoo Linux Security Announcements (GLSA). • RDF feeds of news, GLSA, package updates. • Multiple mailing lists (each architecture, documentation, security). • Gentoo Monthly News (GMN).
Advanced topics • Gentoo Catalyst. • equery, genlop, esearch. • eselect, module-rebuild. • webapp-config. • /etc/portage/ • Embedded systems using uclibc. • Keychain. • Bash completion. • This room, Thursday, January 19, 8 PM.
Introduction to Gentoo Linux Rajiv Aaron Manglani Available for consulting and part- or full-time contracts. rajiv@alum. mit. edu rajiv@gentoo. org
<http: //dev. gentoo. org/~rajiv/Intro. To. Gentoo/> Copyright 2006 Rajiv Aaron Manglani. 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. Non. Commercial-Share. Alike 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. Please contact Rajiv Manglani <rajiv@alum. mit. edu> for commercial uses of this work.