Beyond Linux From Scratch

Version 5.0-PRE1

BLFS Development Team

This book follows on from the Linux From Scratch book. It introduces and guides the reader through additions to the system including networking, X support, sound support and printer and scanner support.

Copyright (c) 2001-2003, BLFS Development Team

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions in any form must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Neither the name of "Linux From Scratch" nor the names of its contributors may be used to endorse or promote products derived from this material without specific prior written permission.

  • Any material derived from Linux From Scratch must contain a reference to the "Linux From Scratch" project.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



Dedication

This book is dedicated to the LFS community

Table of Contents
Preface
Foreword
Who would want to read this book
Organization
Part I - Introduction
Part II - Post LFS Configuration and Extra Software
Part III - General Libraries and Utilities
Part IV - Connecting to a Network
Part V - Basic Networking
Part VI - Server Networking
Part VII - Content Serving
Part VIII - X + Window Managers
Part IX - KDE
Part X - GNOME
Part XI - X Software
Part XII - Multimedia
Part XIII - Printing, Scanning and Typesetting
Appendices
I. Introduction
1. Welcome to BLFS
Acknowledgments
Credits
Which sections of the book do I want?
Conventions used in this book
Book version
Mirror sites
Change Log
Mailing lists
News server
Asking for help and the FAQ
Contact information
2. Important Information
Getting and unpacking the software
The /usr versus /usr/local debate
Optional Patches
Using BLFS Boot Scripts
Going Beyond BLFS
II. Post LFS Configuration and Extra Software
3. After LFS Configuration Issues
Creating a Custom Boot Disk
Configuring for Adding Users
/etc/inputrc
The Bash Shell Startup Files
/etc/vimrc, ~/.vimrc
/etc/issue (Customizing your logon)
Random number generation
Compressing man and info pages
4. Security
Linux-PAM-0.77
Shadow-4.0.3
iptables-1.2.8
Setting up a network firewall
GnuPG-1.2.3
Tripwire-2.3.1-2
5. File Systems
Ext3
ReiserFS-3.6.11
XFS-2.5.6
6. Editors
Vim-6.2
Emacs-21.3
nano-1.2.2
JOE-2.9.8
7. Shells
ASH-0.4.0
Tcsh-6.12.00
ZSH-4.1.1
III. General Libraries and Utilities
8. General Libraries
OpenSSL-0.9.7c
pcre-4.3
popt-1.7
slang-1.4.9
FAM-2.6.10
libxml-1.8.17
libxml2-2.5.11
libxslt-1.0.33
readline-4.3
GMP-4.1.2
GDBM-1.8.3
GLib-1.2.10
GLib-2.2.3
expat-1.95.6
libesmtp-1.0
aspell-0.50.3
ispell-3.2.06.epa6
Guile-1.6.4
slib-2d6
G-Wrap-1.3.4
LZO-1.08
9. Graphics Libraries
lcms-1.11
libjpeg-6b
libpng-1.2.5
libtiff-3.5.7
libungif-4.1.0b1
libmng-1.0.5
Imlib-1.9.14
AAlib-1.4rc5
SVGAlib-1.4.3
DirectFB-0.9.19
Imlib2-1.1.0
10. General Utilities
bc-1.06
rep-gtk-0.18
Compface-1.4
11. System Utilities
GPM-1.20.1
Fcron-2.9.3
hdparm-5.4
which-2.14 and alternatives
UnZip-5.50
Zip-2.3
PCI Utilities-2.1.11
pkgconfig-0.15.0
cpio-2.5
MC-4.6.0
12. Programming
Python-2.3.2
Perl modules
librep-0.16.2
J2SDK-1.4.1
Ruby-1.8.0
GCC-3.3.1
Tcl-8.4.4
Tk-8.4.4
GCC-2.95.3
NASM-0.98.38
IV. Connecting to a Network
13. Dial-up networking
PPP-2.4.1
WvDial-1.53
14. DHCP Clients
Configuring the LFS bootscripts to support DHCP clients
DHCP-3.0pl2
dhcpcd-1.3.22-pl4
15. Other Connections
RP-PPPoE-3.5
V. Basic Networking
16. Networking Libraries
cURL-7.10.7
WvStreams-3.70
GNet-2.0.4
libsoup-1.99.23
17. Text Web Browsers
Links-2.1pre11
Lynx-2.8.4
w3m-0.4.1
18. Basic Networking Programs
NcFTP-3.1.6
OpenSSH-3.7.1p2 client
rsync-2.5.6 client
CVS-1.11.6
Wget-1.8.2
tcpwrappers-7.6
portmap-5
Inetutils-1.4.2
NCPFS-2.2.3
NTP-4.1.2
19. Basic Networking Utilities
Traceroute-1.4a12
Nmap-3.30
Whois-4.6.7
BIND Utilities-9.2.2
20. Mail/News Clients
Nail-10.5
Procmail-3.22
Fetchmail-6.2.3
Mutt-1.4.1i
Pine-4.56
slrn-0.9.7.4
Other Mail and News programs
21. D.J. Bernstein's Utilities
daemontools-0.76
daemontools-man-0.76
ucspi-tcp-0.88
VI. Server Networking
22. Mail Server Software
Postfix-2.0.16
qmail-1.03
Sendmail-8.12.10
Exim-4.24
Qpopper-4.0.5
Courier-0.43.2
23. Other Server Software
BIND-9.2.2
Running a CVS server
DHCP-3.0pl2
Leafnode-1.9.43
OpenSSH-3.7.1p2
rsync-2.5.6
OpenLDAP-2.1.22
Samba-2.2.8a
xinetd-2.3.12
VII. Content Serving
24. Databases
Berkeley DB-4.1.25
Berkeley DB-3.3.11
MySQL-4.0.15
PostgreSQL-7.3.4
25. Web serving
Apache-2.0.47
PHP-4.3.3
ProFTPD-1.2.8p
VIII. X + Window Managers
26. X Window Environment
XFree86-4.3.0.1
XFree86 Components
27. X Libraries
FreeType-2.1.5
Fontconfig-2.2.1
Qt-3.2.1
GTK+-1.2.10
Pango-1.2.5
ATK-1.2.4
GTK+-2.2.4
LessTif-0.93.46
startup-notification-0.5
28. Window Managers
sawfish-1.3
Fluxbox-0.9.5
Metacity-2.4.55
XFce-4.0.0
IX. KDE
29. KDE Core Packages
aRts-1.1.4
kdelibs-3.1.4
kdebase-3.1.4
Configuring the core KDE packages
30. KDE Additional Packages
kdemultimedia-3.1.4
kdenetwork-3.1.4
kdegraphics-3.1.4
kdepim-3.1.4
kdeadmin-3.1.4
kdegames-3.1.4
kdeutils-3.1.4
kdeedu-3.1.4
kdeartwork-3.1.4
kdetoys-3.1.4
kdeaddons-3.1.4
X. GNOME
31. GNOME Libraries
Pre-installation configuration
GTK-Doc-1.0
linc-1.0.3
libIDL-0.8.2
ORBit2-2.6.2
intltool-0.26
Bonobo Activation-2.2.2
libbonobo-2.2.3
GConf-2.2.1
GNOME MIME Data-2.2.1
GNOME Virtual File System-2.2.5
libgnome-2.2.3
libart_lgpl-2.3.11
libglade-2.0.1
libgnomecanvas-2.2.1
libbonoboui-2.2.2
GNOME Icon Theme-1.0.6
libgnomeui-2.2.2
libwnck-2.2.2
GTK Engines-2.2.0
GTK ThinIce Engine-2.0.2
GNOME Themes-2.2.2
ScrollKeeper-0.3.12
VTE-0.10.29
libgtop-2.0.2
GAIL-1.2.2
AT SPI-1.1.9
libgail-gnome-1.0.2
librsvg-2.2.5
EEL-2.2.4
libgtkhtml-2.2.4
libgsf-1.8.2
GAL-1.99.9
libgnomeprint-2.2.1.3
libgnomeprintui-2.2.1.3
GtkHTML-3.0.8
32. GNOME core
GNOME Desktop-2.2.2
GNOME Panel-2.2.2.2
GNOME Session-2.2.2
Control Center-2.2.2
33. Additional GNOME Packages
GNOME Terminal-2.2.2
GNOME System Monitor-2.0.5
GNOME Applets-2.2.2
GNOME Utilities-2.2.3
GNOME Games-2.2.1
Nautilus-2.2.4
Yelp-2.2.3
bug-buddy-2.2.106
gedit-2.2.2
EOG-2.2.2
GStreamer-0.6.2
gst-plugins-0.6.2
GNOME Media-2.2.2
Nautilus Media-0.2.2
GNOME2 User Docs-2.0.6
34. Other GNOME Packages
GConf Editor-0.4.1
GDM-2.4.1.4
35. Configuring GNOME
Configuring the core GNOME packages
36. GNOME 1.4 Libraries
Pre-installation configuration
ORBit-0.5.17
OAF-0.6.10
GNOME Libraries-1.4.2
GDK Pixel Buffer-0.22.0
GNOME Print-0.37
Bonobo-1.0.22
GConf-1.0.9
GNOME Virtual File System-1.0.5
libglade-0.17
GAL-0.24
Guppi-0.40.3
libcapplet-1.5.11
Soup-0.7.11
GtkHTML-1.1.7
libghttp-1.0.9
XI. X Software
37. Individual Office Programs
AbiWord-2.0.0
Gnumeric-1.2.0
GnuCash-1.8.7
GIMP-1.2.5
Evolution-1.4.4
38. Office Suites
KOffice-1.2.1
OpenOffice-1.1.0
39. Graphical Web Browsers
Mozilla-1.4
Galeon-1.3.7
Konqueror-3.1.4
Dillo-0.7.3
40. Other X-based Internet Programs
Pan-0.14.2
Balsa-2.0.14
XII. Multimedia
41. Multimedia Libraries and Drivers
ALSA-0.9.6
ALSA Driver-0.9.6
ALSA Library-0.9.6
ALSA Utilities-0.9.6
ALSA Tools-0.9.6
ALSA OSS-0.9.6
aRts-1.1.4
Audio File-0.2.3
EsounD-0.2.30
SDL-1.2.6
libao-0.8.3
libogg-1.0
libvorbis-1.0
NAS-1.6
libmpeg3-1.5.2
libmad-0.15.0b
OpenQuicktime-1.0
libFAME-0.9.0
Speex-1.0.1
id3lib-3.8.3
FLAC-1.1.0
libdvdread-0.9.4
libdvdcss-1.2.8
libdv-0.99
liba52-0.7.4
XviD-0.9.2
xine Libraries-1-rc0a
42. Audio utilities
mpg123-0.59r
Vorbis Tools-1.0
XMMS-1.2.7
LAME-3.93.1
CDParanoia-III-9.8
43. Video utilities
FFmpeg-0.4.7
Avifile-0.7.38
MPlayer-1.0pre1
xine User Interface-0.9.22
transcode-0.6.10
44. CD-Writing utilities
Configuring your kernel for CD-Writing
Cdrtools-2.00.3
Cdrdao-1.1.7
UDFtools-1.0.0b2
XIII. Printing, Scanning and Typesetting
45. Printing
CUPS-1.1.19
LPRng-3.8.22
AFPL Ghostscript-8.11
ESP Ghostscript-7.07.1rc2
46. Scanning
SANE-1.0.12
XSane-0.91
GOCR-0.37
47. Standard Generalized Markup Language (SGML)
SGML Common-0.6.3
DocBook SGML DTD-3.1
DocBook SGML DTD-4.2
OpenSP-1.5
OpenJade-1.3.2
DocBook DSSSL Stylesheets-1.78
48. Extensible Markup Language (XML)
DocBook XML DTD-4.2
DocBook XSL Stylesheets-1.62.4
49. PostScript
a2ps-4.13b
enscript-1.6.1
PSUtils-p17
GSview-4.4
Xpdf-2.02pl1
Other PostScript programs
50. Typesetting
TeX-2.0.2
XIV. Appendices
A. List of rc?.d symlinks used in LFS/BLFS
rc0.d
rc1.d
rc2.d
rc3.d
rc4.d
rc5.d
rc6.d
B. Installing in non-default locations
Glossary
List of Tables
A-1. rc0.d symlinks
A-2. rc1.d symlinks
A-3. rc2.d symlinks
A-4. rc3.d symlinks
A-5. rc4.d symlinks
A-6. rc5.d symlinks
A-7. rc6.d symlinks

Preface

Foreword

Having helped out with Linux From Scratch for a short time, I noticed that we were getting many queries as to how to do things beyond the base LFS system. At the time, the only assistance specifically offered relating to LFS were the LFS hints (http://www.linuxfromscratch.org/hints). Most of the LFS hints are extremely good and well written but I (and others) could still see a need for more comprehensive help to go Beyond LFS - hence BLFS.

BLFS aims to be more than the LFS-hints converted to XML although much of our work is based around the hints and indeed some authors write both hints and the relevant BLFS sections. We hope that we can provide you with enough information to not only manage to build your system up to what you want, whether it be a web server or a multimedia desktop system, but also that you will learn a lot about system configuration as you go.

Thanks as ever go to everyone in the LFS/BLFS community especially those who have contributed instructions, written text, answered questions and generally shouted when things were wrong!

Finally, we encourage you to become involved in the community; ask questions on the mailing list or news gateway and join in the fun on #lfs at irc.linuxfromscratch.org. You can find more details about all of these in the Introduction section of the book.

Enjoy using BLFS.

Mark Hymers
markh@linuxfromscratch.org
BLFS Editor (July 2001 - March 2003)

I still remember how I found the BLFS project and started using the instructions that were completed at the time. I could not believe how wonderful it was to get an application up and running very quickly, with explanations as to why things were done a certain way. Unfortunately, for me, it wasn't long before I was opening applications that had nothing more than "To be done" on the page. I did what most would do, I waited for someone else to do it. It wasn't too long before I am looking through Bugzilla for something easy to do. As with any learning experience, the definition of what was easy kept changing.

We still encourage you to become involved as BLFS is never really finished. Contributing or just using, we hope you enjoy your BLFS experience.

Larry Lawrence
larry@linuxfromscratch.org
BLFS Editor (March 2003 - present)


Who would want to read this book

This book is mainly aimed at those who have built a system based on the LFS book. It will also be useful for those who are using other distributions, but for one reason or another want to manually build software and are in need of some assistance. BLFS can be used to create a range of diverse systems and so the target audience is probably nearly as wide as that of the LFS book. If you found LFS useful, you should also like this!


Organization

This book is divided into the following parts.


Part I - Introduction

This part contains information which is essential to the rest of the book.


Part II - Post LFS Configuration and Extra Software

Here we introduce basic configuration and security issues. We also discuss a range of editors, file systems and shells which aren't covered in the main LFS book.


Part III - General Libraries and Utilities

In this section we cover libraries which are often needed by the rest of the book as well as system utilities. Information on Programming (including recompiling GCC to support its full range of languages) concludes this part.


Part IV - Connecting to a Network

Here we cover how to connect to a network when you aren't using the simple static IP setup given in the main LFS book.


Part V - Basic Networking

Networking libraries and command-line networking tools make up the bulk of this part.


Part VI - Server Networking

Here we deal with setting up mail and other servers (such as SSH, CVS , etc.).


Part VII - Content Serving

In this part we deal with databases and web server software .


Part VIII - X + Window Managers

This part explains how to set up a basic XFree86 installation along with some generic X libraries and Window managers.


Part IX - KDE

For those who want to use the K Desktop Environment or some parts of it, this part covers it.


Part X - GNOME

GNOME is the main alternative to KDE in the Desktop Environment arena and we cover both GNOME-1.4 and GNOME-2.2 here.


Part XI - X Software

Office programs and graphical web browsers are important to most people. They, along with some generic X software can be found in this part of the book.


Part XII - Multimedia

Here we cover setting multimedia libraries and drivers along with some audio, video and CD-writing programs.


Part XIII - Printing, Scanning and Typesetting

The PST part of the book covers things from Ghostscript, CUPS and DocBook to installing TeX.


Appendices

The Appendices cover information which doesn't belong in the main book; they are mainly there as a reference.

I. Introduction


Chapter 1. Welcome to BLFS

The Beyond Linux From Scratch book is designed to carry on from where the LFS book leaves off. Unlike the LFS book, it isn't designed to be followed straight through. Reading the Which sections of the book? part of this chapter should help guide you through the book.

Please read most of this part of the book carefully as it explains quite a few of the conventions we use throughout the book.


Acknowledgments

We would like to thank the following people and organizations for their contributions toward the BLFS and LFS projects:

  • All those people listed on the Credits page for submitting patches, instructions and corrections to the book. The former editor would especially like to thank Bruce, Larry and Billy for their enormous inputs to the project.

  • Mark Stone <mstone@linux.com> for donating the linuxfromscratch.org servers.

  • Gerard Beekmans <gerard@linuxfromscratch.org> for starting and writing the vast majority of the LFS project.

  • Jesse Tie-Ten-Quee <highos@linuxfromscratch.org> for answering many questions on IRC, having a great deal of patience and for not killing the former editor for the joke in the original BLFS announcement!

  • DREAMWVR.COM for their ongoing sponsorship by donating various resources to the LFS and related sub projects.

  • Robert Briggs for donating the linuxfromscratch.org and linuxfromscratch.com domain names.

  • Frank Skettino <bkenoah@oswd.org> at OSWD for coming up the initial design of the LFS and BLFS websites.

  • Garrett LeSage <garrett@linux.com> for creating the LFS banner

  • Jeff Bauman (former co-editor of the book) for his assistance with getting BLFS off the ground.

  • Countless other people on the various LFS and BLFS mailing lists who are making this book happen by giving their suggestions, testing the book and submitting bug reports.


Credits

Many people have contributed both directly and indirectly to BLFS. This page lists all of those we can think of. We may well have left people out and if you feel this is the case, drop us line. Many thanks to all of the LFS community for their assistance with this project. If you are in the list and wish to have your email address included, again please drop us a line to larry@linuxfromscratch.org and we'll be happy to add it. We don't include email addresses by default so if you want it included, please state so when you contact us.


Editors

  • Editor: Larry Lawrence <larry@linuxfromscratch.org>

  • Co-Editors: Bruce Dubbs, Mark Hymers, Billy O'Connor, Tushar Teredesai and Igor Zivkovic.


Text Authors

  • Chapter 01. Based on the LFS introductory text by Gerard Beekmans, modified by Mark Hymers for BLFS.

  • Chapter 02: The /usr versus /usr/local debate: Andrew McMurry.

  • Chapter 02: Going beyond BLFS: Tushar Teredesai.

  • Chapter 03: /etc/inputrc: Chris Lynn.

  • Chapter 03: Customizing your logon & vimrc: Mark Hymers.

  • Chapter 03: Random number script Larry Lawrence .

  • Chapter 03: Creating a Custom Boot Disk Mike Bedwell and expanded by Bill Maltby.

  • Chapter 03: The Bash Shell Startup Files James Robertson.

  • Chapter 03: Compressed docs Olivier Peres.

  • Chapter 04: Firewalling: Henning Rohde with thanks to Jeff Bauman.

  • Chapter 11: Which Mark Hymers with many thanks to Seth Klein and Jesse Tie-Ten-Quee.

  • Chapter 26: XFree86 Bruce Dubbs.

  • Chapter 28: Intro to Window Managers Bruce Dubbs .

  • Chapter 29: KDE: Bruce Dubbs.

  • Chapter 32: GNOME: Larry Lawrence.


Installation Instruction Authors

  • aalib, Alsa, ffmpeg, gocr, MPlayer, opendivx, sane, transcode, xvid and xsane: Alex Kloss

  • AbiWord, at-spi, ATK, audiofile, avifile, bc, bonobo-activation, bug-buddy, cdrdao, cdrtools, cpio, curl, dhcp, enlightenment, eog, esound, fcron, fluxbox, FNLIB, gail, galeon, gconf-editor, gdbm, gedit, gimp, GLib2, gmp, gnet, gnome-applets, gnome-desktop, gnome-games, gnome-icon-theme, gnome-libs, gnome-media, gnome-mime-data, gnome-panel, gnome-session, gnome-system-monitor, gnome-terminal, gnome-themes, gnome-utils, gnome-vfs, gnome2-user-docs, gnumeric, GTK+2, gtk-doc, gtk-engines, gtk-thinice-engine, eel, imlib, intltool, lame, libao, libart_lgpl, libbonobo, libbonoboui, libgail-gnome, libglade2, libgnome, libgnomecanvas, libgnomeprint, libgnomeprintui, libgnomeui, libgsf, libgtkhtml, libgtop, libIDL, libogg, librep, librsvg, libvorbis, libwnck, libxml2, libxslt, linc, LPRng, Linux_PAM, metacity, MPlayer, mutt, nautilus, nautilus-media, oaf, OpenJade, OpenSP, OpenSSH, ORBit, ORBit2, pan, Pango, pccts, pcre, pkgconfig, postfix, procmail, Python, QT, rep-gtk, ruby, sawfish, scrollkeeper, sgml-common, sgml-dtd, shadow, startup-notification, unzip, vorbis-tools, vte, wget, XFce, xine, xml-dtd, yelp and zip: Larry Lawrence

  • CDParanoia, mpg123, SDL and XMMS: Jeroen Coumans

  • alsa, cvs, dhcpcd, gpm, hdparm, libjpeg, libmng, libpng, libtiff, libungif, links, lynx, openssl, tcsh, which, zsch, zlib: Mark Hymers

  • daemontools, traceroute and ucspi-tcp: Jeff Bauman

  • db and lcms: Jeremy Jones and Mark Hymers

  • aspell, balsa, bind, bonobo, bonobo-conf, cvs server, db-3.3.11, db-3.1.17, emacs, evolution, exim, expat, gal, gnome-print, GnuCash, gtkhtml, guppi, guile, guppi, g-wrap, leafnode, lesstif, libcapplet, libesmtp, libfam, libghttp, libglade, pine, portmap, PostgreSQL, pspell, qmail, qpopper, readline, reiserfs, Samba, sendmail, slib, slrn, soup, tex, tcp-wrappers, and xinetd: Billy O'Connor

  • ProFTPD and rsync: Daniel Baumann

  • ESP Ghostscript: Matt Rogers

  • PHP: Jeremy Utley

  • fetchmail and wvdial: Paul Campbell

  • udftools: Richard Downing

  • compface, DirectFB, FLAC, id3lib, Imlib2, liba52, libdv, libdvdcss, libdvdread, libFAME, libmad, libmpeg3, LZO, MC, NASM, OpenQuicktime, Speex and SVGAlib: Igor Zivkovic

  • tripwire : Manfred Glombowski

  • alsa-oss, inetutils, gdk, GLib, GTK+, libxml and vim: James Iwanek

  • iptables: Henning Rohde

  • joe, nano, nmap, slang, w3m and whois: Timothy Bauscher

  • MySQL: Jesse Tie-Ten-Quee

  • fontconfig, gcc, gcc2, j2sdk, mozilla, nas, openoffice, ispell, nail, STLport, tcl, tk and bind-utils: Tushar Teredesai

  • ncpfs and RP-PPPoE: DJ Lucas

  • ntp: Eric Konopka


General Acknowledgments

  • Gerard Beekmans for generally putting up with us and for running the whole LFS project.

  • Bruce Dubbs for writing the kde.txt hint from which we gathered much useful information.

  • Lee Harris for writing the gpm.txt hint on which our gpm instructions are based.

  • Marc Heerdink for writing the gpm2.txt hint on which our gpm instruction are based.

  • Jeremy Jones (otherwise known as mca) for hacking Makefiles and general assistance.

  • J_Man for submitting a gpm-1.19.3.diff file on which our gpm instructions are based.

  • Scot Mc Pherson for writing the gnome-1.4.txt hint from which was gathered useful information and for warning us that GNOME Version 2.0 may not be ready to put in the book.

  • Tushar Teredesai for writing the Compiling Java 2 SDK from Scratch hint on which j2sdk is based and for writing the docbook hint used throughout the typesetting chapter.

  • Oliver Brakmann for developing the dhcpcd patch for FHS compliance.

  • DJ Lucas for contributing to dhcpcd patch and many contributions while DHCP section was being developed.

  • Billy O'Connor for building GNOME 2.0 so many times and being very helpful with his comments on that section.

  • Ted Riley for writing the Linux-PAM + CrackLib + Shadow hint on which reinstalling shadow to use PAM is based.

  • Fernando Arbeiza for doing great quality assurance on Shadow utilizing PAM. The machine access he saved may have been yours.

  • Jim Harris for writing the dig-nslookup-host.txt hint on which the bind-utils instructions are based.

  • Eric Konopka for writing the ntp.txt hint on which the ntp section is based.


Which sections of the book do I want?

Unlike the Linux From Scratch book, BLFS isn't designed to be followed in a linear manner. This is because LFS provides instructions on how to create a base system which is capable of turning into anything from a web server to a multimedia desktop system. BLFS is where we try to guide you through going from the base system to your intended destination and so choice is very much involved.

Everyone who reads the book will want to read certain sections. The Introduction part - which you are currently reading - contains generic information. Especially take note of the information in Important Information (Chapter 2), as this contains comments about how to unpack software and various other aspects which apply throughout the book.

The part on Post LFS Configuration and Extra Software is where most people will want to turn next. This deals with not just configuration but also Security (Chapter 4), File Systems (Chapter 5), Editors (Chapter 6) and Shells (Chapter 7). Indeed, you may wish to reference certain parts of this chapter (especially the sections on Editors and File Systems) while building your LFS system.

Following these basic items, most people will want to at least browse through the General Libraries and Utilities part of the book. This part contains information on many items which are prerequisites for other sections of the book as well as some items (such as Programming (Chapter 12) which are useful in their own right. Note that you don't have to install all of these libraries and packages found in this part to start with, each BLFS install procedure tells you which packages it depends upon so you can choose the program you want to install and see what it needs.

Likewise, most people will probably want to look at the Connecting to a Network and Basic Networking parts. The first of these deals with connecting to the Internet or your LAN using a variety of methods such as DHCP (Chapter 14) and Dial-Up Connections (Chapter 13). The second of these parts deals with items such as Networking Libraries (Chapter 16) and various basic networking programs and utilities.

Once you have dealt with these basics, you may wish to configure more advanced network services. These are dealt with in the Server Networking and Content Serving parts of the book. Those wanting to build servers should find enough information to give them a good starting point here. Note that Content Serving also contains information on various database packages.

The next parts of the book principally deal with desktop systems. We start with a part talking about X and Window Managers. This part also deals with some generic X-based libraries (Chapter 27). After this, KDE and gnome are given their own parts which are followed by one on X Software.

We then move on to deal with Multimedia packages. Note that many people may want to use the ALSA-0.9.6 instructions from this chapter quite near the start of their BLFS journey; they are placed here simply because it is the most logical place for them.

The final part of the main BLFS book deals with Printing, Scanning and Typesetting. This is useful for most people with desktop systems and even those who are creating mainly server systems will find it useful.

Finally, the Appendix contain various pieces of useful information which you may need to use as a reference.

We hope you enjoy using BLFS and find it useful.


Conventions used in this book

To make things easy to follow, there are a number of conventions used throughout the book. Following are some examples:

./configure --prefix=/usr

This form of text is designed to be typed exactly as seen unless otherwise noted in the surrounding text. It is also used in the explanation sections to identify which of the commands is being referred to.

install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir'

This form of text (fixed width text) is showing screen output, probably as the result of commands issued and is also used to show filenames such as /etc/lilo.conf

Emphasis

This form of text is used for several purposes in the book but mainly to emphasize important points or to give examples as to what to type.

http://www.linuxfromscratch.org/

This form of text is used for hypertext links, both within the book and to external pages such as HowTo's, download locations, websites, etc.

cat > $LFS/etc/group << "EOF">
	root:x:0:
	bin:x:1:
	......
EOF

This type of section is used mainly when creating configuration files. The first command (in bold) tells the system to create the file $LFS/etc/group from whatever is typed on the following lines until the sequence EOF is encountered. Therefore, this whole section is generally typed as seen.


Book version

This is BLFS-BOOK version 5.0-PRE1 dated October 8th, 2003. If this version is older than a month a newer version is probably already available for download. Check one of the mirror sites below for updated versions.


Mirror sites

The BLFS project has a number of mirrors setup world-wide to make it easier and more convenient for you to access the website. Please visit the http://www.linuxfromscratch.org/blfs website for the list of current mirrors.


Change Log

Please note that the change log only lists which editor was responsible for putting the changes into CVS; please read the Credits page in Chapter 1 for details on who wrote what.

5.0-PRE1 - October 8th, 2003

  • October 7th, 2003 [igor]: Added missing http/ftp links (part VI).

  • October 7th, 2003 [tushar]: Add patch and modify tripwire instructions for gcc3 compilation.

  • October 7th, 2003 [larry]: courier patch submitted by Jim Gifford

  • October 7th, 2003 [igor]: Added missing http/ftp links (part V).

  • October 6th, 2003 [larry]: undated to openssh-3.7.1p2.

  • October 6th, 2003 [igor]: Added missing http/ftp links (part IV).

  • October 5th, 2003 [tushar]: Added libungif patch. Matched vim instructions with LFS.

  • October 5th, 2003 [tushar]: Added ash-0.4.0.

  • October 5th, 2003 [tushar]: Added tiff and nas patches.

  • October 5th, 2003 [bdubbs]: Updated kde-multimedia instructions. Removed kdoc and kde-other section.

  • October 5th, 2003 [larry]: Updated to Docbook XSL Stylesheets-1.62.4.

  • October 5th, 2003 [igor]: Updated to NASM-0.98.38 and Python-2.3.2.

  • October 5th, 2003 [igor]: Added missing http/ftp links (part III).

  • October 4th, 2003 [larry]: General: updated to OpenSSL-0.9.7c and FAM-2.6.10.

  • October 4th, 2003 [tushar]: Added a page on Optional Patches that refers to the Patches Project.

  • October 4th, 2003 [igor]: Added missing http/ftp links (part XIII).

  • October 4th, 2003 [tushar]: Patches reorganization, Section IV.

  • October 3rd, 2003 [tushar]: Updated OpenOffice to 1.1.0.

  • October 3rd, 2003 [tushar]: Add two unzip patches.

  • October 3rd, 2003 [tushar]: Patches reorganization (Part II).

  • October 3rd, 2003 [igor]: Added missing http/ftp links (part XII).

  • October 3rd, 2003 [tushar]: Patches reogranization.

  • October 2nd, 2003 [larry]: Many edits it Part X to put application's proper names in and class filename tags.

  • October 2nd, 2003 [igor]: Modified Evolution instructions.

  • October 2nd, 2003 [bdubbs]: Removed libpng from Qt requirement list. Its required in XFree86.

  • October 2nd, 2003 [bdubbs]: Updated Qt to version 3.2.1.

  • October 2nd, 2003 [igor]: Added missing http/ftp links (part XI).

  • October 2nd, 2003 [bdubbs]: Updated XFree86 instructions to clarify DRI implementation and XF86Config modifications.

  • September 29th, 2003 [igor]: Added missing http/ftp links (part II).

  • September 29th, 2003 [larry]: added gocr to Scanning.

  • September 28th, 2003 [tushar]: Added ntp to Networking Programs.

  • Sepember 27th, 2003 [larry]: updated to xfce-4.0.0.

  • September 27th, 2003 [tushar]: Updated Mozilla instructions for gcc-3.3.1. Added notes for building Firebird and Thunderbird.

  • September 27th, 2003 [larry] updated to xfs patch for 2.4.22 kernel.

  • September 26th, 2003 [igor] Added MC-4.6.0 and updated to ProFTPD-1.2.8p.

  • September 26th, 2003 [larry] applied patch for compressdocs submitted by Yann Morin.

  • September 25th, 2003 [igor]: Updated to sendmail-8.12.10 and python-2.3.1.

  • September 25th, 2003 [igor]: Added PHP-4.3.3 submitted by Jeremy Utley.

  • September 24th, 2003 [larry]: Updated to xine-ui-0.9.22.

  • September 24th, 2003 [larry]: Tagging Acronyms, building Glossary, tagging filename extensions (not using identifier as that is not compatible with 4.1.2). Checking Capitalization against web sites or GNU database or sourceforge.

  • September 23rd, 2003 [igor]: Updated to OpenLDAP-2.1.22 and gsview-4.4.

  • September 22nd, 2003 [igor]: Updated to exim-4.24.

  • September 22nd, 2003 [larry]: Added a Glossary.

  • September 22nd, 2003 [igor]: Updated to leafnode-1.9.43.

  • September 21st, 2003 [tushar]: Moved STLport to Appendix C.

  • September 21st, 2003 [tushar]: Updated to OpenOffice 1.1rc4.

  • September 21st, 2003 [igor]: Added libdvdread-0.9.4, libdvdcss-1.2.8, libdv-0.99 and liba52-0.7.4.

  • September 21st, 2003 [larry]: Updated to lcms-1.11.

  • September 21st, 2003 [igor]: update to transcode-0.6.10.

  • September 21st, 2003 [tushar]: Added tcl-8.4.4 and tk-8.4.4.

  • September 20th, 2003 [tushar]: Added nail-10.5.

  • September 20th, 2003 [tushar]: Synchronized gcc-2.95.3 with LFS instructions.

  • September 20th, 2003 [larry]: updated bootdisk for non-devfs usage and two-disk option.

  • September 20th, 2003 [tushar]: Updated to j2sdk-1.4.2_01 (precompiled).

  • September 20th, 2003 [tushar]: Added ispell-3.2.06.epa6 to General Libraries.

  • September 20th, 2003 [igor]: added FLAC-1.1.0 and id3lib-3.8.3.

  • September 20th, 2003 [larry]: updated to sane-1.0.12 and xsane-0.91.

  • September 20th, 2003 [bdubbs] : Updated XFree86 instructions to use kernel compiler for kernel modules.

  • September 19th, 2003 [igor] : updated ALSA packages intro, modified Apache instructions.

  • September 19th, 2003 [larry]: updated to LPRng-3.8.22.

  • September 19th, 2003 [larry]: updated to fluxbox-0.9.5, as stable will not compile with gcc-3.3.1.

  • September 19th, 2003 [igor]: added Speex-1.0.1, update to postfix-2.0.16 and whois-4.6.7.

  • September 18th, 2003 [larry]: update to soup-0.7.11.

  • September 18th, 2003 [igor]: updated instructions for fcron-2.9.3.

  • September 18th, 2003 [larry]: updated to gal-0.24.

  • September 18th, 2003 [igor]: added libFAME-0.9.0, update to xine-lib-1-rc0a.

  • September 18th, 2003 [larry]: updated to openssh-3.7.1p1.

  • September 18th, 2003 [larry]: added compress doc page to postlfs.

  • September 17th, 2003 [igor]: update to xinetd-2.3.12.

  • September 17th, 2003 [larry]: updated to ncftp-3.1.6.

  • September 16th, 2003 [larry]: added libgsf-1.8.2.

  • September 16th, 2003 [igor]: update to KDE-3.1.4 (incomplete - left for Bruce to review and finish).

  • September 16th, 2003 [larry]: update to OpenSSH--3.7p1, gtkhtml-3.0.8, libsoup-1.99.23, evolution-1.4.4, gnumeric-1.2.0, abiword-2.0.0, PDL-2.4.0, Astro-FITS-Header-2.7.1 and gimp-1.2.5.

  • September 15th, 2003 [larry]: update to postfix-2.0.15 and added gal-1.99.9.

  • September 15th, 2003 [igor]: update to ffmpeg-0.4.7 and xvid-0.9.2.

  • September 14th, 2003 [larry]: added patch to SVGAlib for gcc-3.3.1 compile error. Bug 346.

  • September 14th, 2003 [igor]: update to cups-1.1.19.

  • September 14th, 2003 [igor]: changed installation instructions for ESP Ghostscript.

  • September 14th, 2003 [larry]: general: updated to guile-1.6.4, slib-2d6 and aalib-1.4rc5.

  • September 13th, 2003 [larry]: general: updated to rep-gtk-0.18.

  • September 13th, 2003 [larry]: general: updated to libxml2-2.5.11 and libxslt-1.0.33.

  • September 13th, 2003 [igor]: update to PostgreSQL-7.3.4.

  • September 12th, 2003 [igor]: update to MySQL-4.0.15 and freetype-2.1.5.

  • September 12th, 2003 [larry]: update to xfsprogs-2.5.6 and reiserfsprogs-3.6.11.

  • September 12th, 2003 [igor]: update to Apache-2.0.47.

  • September 11th, 2003 [larry]: Arranged Part I-Introduction to follow LFS order and, of course, tagged.

  • September 11th, 2003 [larry]: added imlib2 and openquicktime submitted by Igor.

  • September 11th, 2003 [larry]: edited firewalling to conform to the rest of book. Used 'screen' for kernel settings instead of 'table'. Changed from 'orderlist' to 'itemizedlist'. Converted footnotes to inline notation, except kernel which was inconsistent with the rest of the book.

  • September 9th, 2003 [larry]: update to esp ghostcript-7.07.1rc2, AFPL Ghostscript-8.11 and w3m-0.4.1 submitted by Igor.

  • September 8th, 2003 [tushar]: added bind-utils section for users that only need the client apps from bind.

  • September 7th, 2003 [larry]: updated intro to tex.

  • September 7th, 2003 [larry]: update to MySQL-4.0.14, nano-1.2.2, GTK2+-2.2.5 and pciutils-2.1.11, all submitted by Igor.

  • September 6th, 2003 [larry]: gnome: updated to nautilus-media-0.2.2, gconf-editor-0.4.1 and gdm-2.4.1.4.

  • September 5th, 2003 [larry]: gnome: updated to gnome-system-moniter-2.0.5, gnome-applets-2.2.2, gnome-utils-2.2.3, gnome-games-2.2.1, nautilus-2.2.4, yelp-2.2.3, bug-buddy-2.2.106, gedit-2.2.2, eog-2.2.2, gstreamer-0.6.2, gst-plugins-0.6.2 and gnome-media-2.2.2.

  • September 4th, 2003 [larry]: gnome: updated to control-center-2.2.2 and gnome-terminal-2.2.2.

  • September 4th, 2003 [larry]: multimedia: updated avifile and mplayer submitted by Igor.

  • September 4th, 2003 [larry]: basicnet: applied DJ's correction patch to ncpfs.

  • September 4th, 2003 [larry]: x: updated to metacity-2.4.55 and gnome-session-2.2.2.

  • September 4th, 2003 [larry]: xsoft: updated to pan-0.14.2 and gnet-2.0.4.

  • September 3rd, 2003 [larry]: xsoft: updated to AbiWord-1.99.6, gnumeric-1.1.20, gnome-desktop-2.2.2 and gnome-panel-2.2.2.2.

  • September 3rd, 2003 [larry]: postlfs: added gnupg-1.2.3.

  • September 3rd, 2003 [larry]: update to libgnomeprint-2.2.1.3, libgnomeprintui-2.2.1.4 and balsa-2.0.14.

  • September 2nd, 2003 [larry]: updated to libesmtp-1.0, eel-2.2.4 and libgtkhtml-2.2.4.

  • September 2nd, 2003 [larry]: Edit submission by DJ, added NASM, directFB, libMPEG3 and updated SDL by Igor.

  • September 1st, 2003 [larry]: updated intro to gtk-engines, gtk-thinice-engine and libgail-gnome. Removed png-support-3.1.dtd from gtk-doc and sgml-dtd-3.

  • September 1st, 2003 [larry]: gnome: updated to libbonoboui-2.2.2, gnome-icon-theme-1.0.6, libgnomeui-2.2.2, gnome-themes-2.2.2 scrollkeeper-0.3.12, libwnck-2.2.2, vte-0.10.29, libgtop-2.0.2, gail-1.2.2, at-spi-1.1.9, librsvg-2.2.5 and galeon-1.3.7.

  • August 31st, 2003 [larry]: gnome: updated to GConf-2.2.1, gnome-mime-data-2.2.1, gnome-vfs-2.2.5, libgnome-2.2.3 and libgnomecanvas-2.2.1.

  • August 31st, 2003 [larry]: updated into of wvdial and wvstreams submitted by Igor.

  • August 31st, 2003 [larry]: server: added rsync-2.5.6 submitted by Daniel Baumann.

  • August 31st, 2003 [larry]: multimedia: update to cdrtools-2.00.3 submitted by Igor.

  • August 30th, 2003 [larry]: postlfs: update intro section of tcsh, zsh, joe, nano and emacs.

  • August 30th, 2003 [larry]: general: update to gcc-3.3.1 and gnat-3.15p.

  • August 29th, 2003 [larry]: pst: updated intro to sgml-dtd V3.1 and V4.2.

  • August 29th, 2003 [larry]: Xsoft: updated to dillo-0.7.3.

  • August 29th, 2003 [larry]: Basicnet: updated to curl 7.10.7 submitted by Igor Zivkovic.

  • August 29th, 2003 [larry]: Gnome: updated intro for orbit2 and updated to bonobo-activation-2.2.3.

  • August 28th, 2003 [larry]: updated to GLib-2.2.3, Pango-1.2.5, ATK-1.2.4 and GTK+-2.2.3.

  • August 28th, 2003 [larry]: updated to intro of gtk-doc and openjade. Typos.

  • August 28th, 2003 [larry]: updated to ruby-1.8.0

  • August 26th, 2003 [larry]: added patch to OpenSP.

  • August 26th, 2003 [larry]: added SVGAlib and updated Links to add graphical option

  • August 26th, 2003 [larry]: updated intro for PAM, added link to cracklib, modified cvs download.

  • August 26th, 2003 [tushar]: Added dependencies for fontconfig.

  • August 25th, 2003 [larry]: Applied update patches submitted by Igor Zivkovic for cvs-1.11.6 and hdparm-5.4.

  • August 24th, 2003 [larry]: updated intro for vim, docbook and docbook-dsssl. Removed placeholder for alsa-oss.

  • August 24th, 2003 [larry]:; SBU updates for glib-1, gtk-1,

  • August 24th, 2003 [larry]: Tag edits on Bill's submission.

  • August 22nd, 2003 [tushar]: Updated libfam to fix libtool-1.5 related bug.

  • August 21st, 2003 [larry]: Changed SBU's for aspell, pan, zip, libidl, which, mozilla, and vim.

  • August 19th, 2003 [larry]: Basicnet: updated to gnet-1.1.9. Changed SBU's for pkgconfig, GLib-2, Pango, ATK, GTK-2, intltool, gnet.

  • August 18th, 2003 [larry]: PST: removed -enable xml message from Opensp install instructions. Changed SBU's for OpenSP, openjade, sgml-common, libxml2, libxslt, libmng, qt, lesstif and fluxbox to reflect new scale.

  • August 17th, 2003 [bdubbs]: XFree86: change bunzip2 to gunzip.

  • August 16th, 2003 [bdubbs]: Updated fontconfig configuration instructions.

  • August 16th, 2003 [tushar]: Synchronized shadow instructions to match those in LFS-CVS.

  • August 15th, 2003 [bdubbs]: Updated XFree86 instructions and added patch file.

  • August 15th, 2003 [bdubbs]: Updated fontconfig config instructions and moved to X library chapter.

  • August 13th, 2003 [tushar]: Fixed nas typo.

  • August 8th, 2003 [tushar]: Added fontconfig and made it a dependency for X.

  • August 4th, 2003 [larry]: modified intro to GLib.

  • August 4th, 2003 [larry]: multimedia: update to esound-0.2.30.

  • August 3rd, 2003 [larry]: basicnet: updated to nmap-3.30.

  • August 3rd, 2003 [larry]: modified intro to qt, gtk+, startup-notification, slrn, popt and slang.

  • August 3rd, 2003 [larry]: basicnet: updated to pine-4.56.

  • August 3rd, 2003 [larry]: basicnet: updated to fetchmail-6.2.3.

  • August 2nd, 2003 [larry]: pst: updated to docbook-xsl-1.61.3.

  • August 2nd, 2003 [larry]: X: updated to lesstif-0.93.46.

  • July 31st, 2003 [larry]: general: added patches to gpm-1.20.1.

  • July 30th, 2003 [larry]: content: added proftpd-1.2.8.

  • July 30th, 2003 [larry]: general: updated to Python-2.3.

  • July 24th, 2003 [tushar]: updated to mozilla-1.4

  • July 17th, 2003 [larry]: gnome: update to linc-1.0.3, libIDL-0.8.2, intltool-0.26 and bonobo-activation-2.2.2.

  • July 7th, 2003 [larry]: server: updated to postfix-2.0.13.

  • July 7th, 2003 [larry]: general: updated to libxml2-2.5.8 and libxslt-1.0.31.

  • July 2nd, 2003 [larry]: server: removed the creation of mount.smbs as current version creates this file in the /sbin directory. Reported by Eagle.

  • July 1st, 2003 [larry]: general: updated to Python-2.2.3.

  • July 01st, 2003 [larry]: general: updated to pcre-4.3.

  • July 01st, 2003 [larry]: server: update to openssh-3.6.1p2.

  • June 29th, 2003 [larry]: multimedia: Added udftools to cdwriting section contributed by Richard Downing.

  • June 27th, 2003 [larry]: server: updated to postfix-2.0.12.

  • June 27th 2003 [larry]: basicnet: updated to whois-4.6.6.

  • June 27th, 2003 [larry]: basicnet: removed inetutils- now in LFS.

  • June 17th, 2003 [larry]: general: updated intro for expat.

  • June 17th, 2003 [larry]: server: Added a configure switch to BIND. rndc was looking for its config file in /usr/etc.

  • June 17th, 2003 [larry]: general; disclosed patent issues with openssl.

  • June 13th, 2003 [larry]: general: updated intro on libjpeg and libtiff.

  • June 12th, 2003 [larry]: general: Updated intro on pkgconfig and atk.

  • June 12th, 2003 [larry]: x: updated to Pango-1.2.3 and GTK+-2.2.2.

  • June 12th, 2003 [larry]: general: updated to glib-2.2.2.

  • June 10th, 2003 [larry]: pst: modified xpdfrc as pointed out by Andre Kalus.

  • June 3rd, 2003 [tushar]: alsa: updated to 0.9.4 (submitted by James Iwanek).

  • May 14th, 2003 [larry]: x: updated to freetype-2.1.4.

  • May 14th, 2003 [larry]: intro and markup change to docbook-xsl, freetype2, libpng.

  • May 13th, 2003 [larry]: intro and markup change to db, procmail, fetchmail, mutt, GLib-2.0, libxslt.

  • May 12th, 2003 [larry]: xsoft: updated to pan-0.14.0.

  • May 12th, 2003 [larry]: intro and markup change to sgml-common and opensp.

  • May 5th, 2003 [larry]: postlfs: updated to iptables-1.2.8.

  • May 5th, 2003 [larry]: multimedia: updated to transcode-0.6.3.

  • May 4th, 2003 [larry]: multimedia: updated to xine-ui-0.9.20.

  • May 3rd, 2003 [larry]: basicnet: updated to pine-4.55.

  • May 1st, 2003 [larry]: multimedia: update to xine-lib-1-beta11.

  • May 1st, 2003 [larry]: server: updated to postfix-2.0.9.

  • May 1st, 2003 [larry]: general: after reviewing lcms, it appeared to be a good candidate for the newer LFS installation format. See what you think.

  • April 30th, 2003 [larry]: general: updated to lcms-1.10.

  • April 30th, 2003 [larry]: xsoft: updated to dillo-0.7.2.

  • April 29th, 2003 [larry]: general: updated to libxml2-2.5.7.

  • April 28th, 2003 [larry]: applied dillo patch.

  • April 28th, 2003 [larry]: template: modified template for new intro format.

  • April 28th, 2003 [larry]: general: updated to openssl-0.9.7b and pcre-4.2.

  • April 27th, 2003 [larry]: introduction: fixed url for ESR article. general: fixed aalib package size.

1.0 - April 25th, 2003


Mailing lists

The linuxfromscratch.org server is hosting a number of mailing lists that are used for the development of the BLFS. These lists include, among others, the main development and support lists.

For more information regarding which lists are available, how to subscribe to them, archive locations, etc. visit http://www.linuxfromscratch.org/mailinglists.


News server

All the mailing lists hosted at linuxfromscratch.org are also accessible via the NNTP server. All messages posted to a mailing list will be copied to its correspondent newsgroup, and vice versa.

The news server can be reached at news.linuxfromscratch.org.


Asking for help and the FAQ

If you encounter a problem while using this book, and your problem is not listed in the FAQ (http://www.linuxfromscratch.org/faq), you will find that most of the people on Internet Relay Chat (IRC) and on the mailing lists are willing to help you. An overview of the LFS mailing lists can be found in Mailing lists. To assist us in diagnosing and solving your problem, include as much relevant information as possible in your request for help.


Things to check prior to asking

Before asking for help, you should review the following items:

  • Is the hardware support compiled into the kernel or available as a module to the kernel. If it is a module, is it configured properly in modules.conf and has it been loaded. You should use lsmod as root to see if it's loaded. Check the sys.log or run modprobe <driver> to review any error message. If it loads properly, you may need to add the modprobe to your boot scripts.

  • Are your permissions properly set, especially for devices. LFS uses groups to make these settings easier, but it also adds the step of adding users to groups to allow access. A simple moduser -G audio <user> may be all that's necessary for that user to have access to the sound system. Any question that starts out with "It works as root, but not as ..." should review permissions thoroughly prior to asking.

  • BLFS liberally uses /opt/<package>. The main objection to this centers around the need to expand your environment variables for each package placed there (e.g. PATH=$PATH:/opt/kde/bin). In some cases, the package will walk you through the changes, but some will not. Appendix B is available to help you check.


Things to mention

Apart from a brief explanation of the problem you're having, the essential things to include in your request are:

  • the version of the book you are using (being 5.0-PRE1),

  • the package or section giving you problems,

  • the exact error message or symptom you are receiving,

  • whether you have deviated from the book or LFS at all.

(Note that saying that you've deviated from the book doesn't mean that we won't help you. It'll just help us to see other possible causes of your problem.)

Expect guidance instead of specific instructions. If you are instructed to read something, please do so, it generally implies that the answer was way too obvious and that the question would not have been asked if a little research was done prior to asking. The volunteers in the mailing list prefer not to be used as an alternative to doing reasonable research on your end. In addition, the quality of your experience with BLFS is also greatly enhanced by this research, and the quality of volunteers is enhanced because they don't feel that their time has been abused, so they are far more likely to participate.

An excellent article on asking for help on the Internet in general has been written by Eric S. Raymond. It is available online at http://www.catb.org/~esr/faqs/smart-questions.html. Read and follow the hints in that document and you are much more likely to get a response to start with and also to get the help you actually need.


Contact information

Please direct your emails to one of the BLFS mailing lists. See Mailing lists for more information on the available mailing lists.

The current BLFS maintainer is Larry Lawrence. If you need to reach Larry, send an email to larry@linuxfromscratch.org.


Chapter 2. Important Information

Getting and unpacking the software

Those people who have built a LFS system will be aware of the general principles of downloading and unpacking software. We will however repeat some of that information here for those new to building their own software.

Each set of installation instructions contains a URL from which you can download the package. We do however keep a selection of patches available via http. These are referenced as needed in the installation instructions.

While you can keep the source TAR balls anywhere you like, we assume that you have unpacked them and unzipped any required patches into /usr/src.

We can not emphasize strongly enough that you should start from a clean source tree each time. This means that if you have had an error, it's usually best to delete the source tree and re-unpack it before trying again. This obviously doesn't apply if you're an advanced user used to hacking Makefiles and C code, but if in doubt, start from a clean tree.


Unpacking the software

If a file is tar'ed and gzip'ed, it is unpacked by running one of the following two commands, depending on the filename:

tar -xvzf filename.tar.gz
tar -xvzf filename.tgz
tar -xvzf filename.tar.Z

If a file is tar'ed and bzip2'ed, it can usually be unpacked by running:

tar -jxvf filename.tar.bz2

You can also use a slightly different method:

bzcat filename.tar.bz2 | tar -xv

Finally, you need to be able to unpack patches which are generally not tar'ed. The best way to do this is to copy the patch file to /usr/src and then to run one of the following commands depending on whether the file is .gz or .bz2:

gunzip patchname.gz
bunzip2 patchname.bz2

The /usr versus /usr/local debate

Should I install XXX in /usr or /usr/local?

This is a question without an obvious answer for an LFS based system.

In traditional Unix systems, /usr usually contains files that come with the system distribution, and the /usr/local tree is free for the local administrator to add things to. The only really hard and fast rule is that Unix distributions should not touch /usr/local, except perhaps for creating the basic directories within it.

With Linux distributions, like Red Hat, Debian etc. a possible rule is that /usr is managed by the distribution's package system and /usr/local is not. This way the package manager's database knows about every file within /usr.

LFS users build their own system and so deciding where the system ends and local files begin is not straightforward. So the choice should be made in order to make things easier to administer. There are several reasons for dividing files between /usr and /usr/local.

  • On a network of several machines all running LFS , or mixed LFS and other Linux distributions, /usr/local could be used to hold packages that are common between all the computers in the network. It can be NFS mounted or mirrored from a single server. Here local indicates local to the site.

  • On a network of several computers all running an identical LFS system /usr/local could hold packages that are different between the machines. In this case local refers to the individual computers.

  • Even on a single computer /usr/local can be useful if you have several distributions installed simultaneously, and want a place to put packages that will be the same on all of them.

  • Or you might regularly rebuild your LFS, but want a place to put files that you don't want to rebuild each time. This way you can wipe the LFS file system and start from a clean partition every time without losing everything.

Some people ask why not use your own directory tree, e.g. /usr/site rather than /usr/local?

There is nothing stopping you, many sites do make their own trees, however it makes installing new software more difficult. Automatic installers often look for dependencies in /usr and /usr/local, and if the file it is looking for is in /usr/site instead, the installer will probably fail unless you specifically tell it where to look.

What is the BLFS position on this?

All of the BLFS instructions install programs in /usr unless specifically stated otherwise. There are examples where some files are placed in the /usr/local hierarchy but these are documented and are generally for a good reason. These exceptions should be well documented in the book. If you think you have found one which isn't please tell us!


Optional Patches

As you follow the various sections in the book, you will observe that the book includes various patches that are required for a successful and secure installation of the packages. The general policy of the book is to include patches that fall in one of the following criteria:

  • Fixes a compilation problem.

  • Fixes a security problem.

  • Fixes a broken functionality.

In short, the book only includes patches that are either Required or Recommended. There is a Patches subproject which hosts various patches (includng the patches included in the books) to enable you to configure your LFS the way you like it:)


Using BLFS Boot Scripts

The scripts included for packages such as GPM-1.20.1 and ALSA-0.9.6 are based around the template supplied with the lfs-bootscripts package from version 3.2 and later of the LFS book. Note that this is lfs-bootscripts-1.6 and later (the old numbering changed as of LFS-3.2). The scripts won't work with versions of LFS before 3.2 because of a change in their organization with the new scripts. However, it should be trivial to adapt the scripts if needed for older LFS versions.


Going Beyond BLFS

The packages that are installed in this book are only the tip of the iceberg. We hope that the experience you gained with the LFS book and the BLFS book will give you the background needed to compile, install and configure packages that are not included in this book.

If you are in search of a package that is not in the book, the following are different ways you can search for the concerned package.

Some general hints on handling new packages:

  • Many of the newer packages follow the ./configure && make && make install dance routine. Help on the options accepted by configure can be obtained via the command ./configure --help.

  • Most of the packages contain documentation on compiling and installing the package. Some of the documents are excellent, some not so excellent. Check out the homepage of the package for any additional and updated hints for compiling and configuring the package.

  • If you are having a problem compiling the package, try searching the lfs archives at http://search.linuxfromscratch.org/ for the error or if that fails try searching google. If everything else fails, try the blfs support mailing-list/news-server.

Tip: If you have found a package that is only available in .deb or .rpm format, there are two small scripts rpm2targz and deb2targz that are available at http://www.linuxfromscratch.org/~tushar/downloads/ to convert the archives into a simple tar.gz format.

II. Post LFS Configuration and Extra Software


Chapter 3. After LFS Configuration Issues

The intention of LFS is to provide a basic system which you can build upon. There are several things, about tidying up the system, which many people wonder about once they have done the base install. We hope to cover these issues in this chapter.

Most people coming from a Windows background to Linux find the concept of text-only configuration files slightly strange. In Linux, just about all configuration is done via text files. The majority of these files can be found in the /etc hierarchy. There are often graphical configuration programs available for different subsystems but most are simply pretty front ends to the process of editing the file. The advantage of text-only configuration is that you can edit parameters using your favorite text editor, whether that be vim, emacs or anything else.

The first task is making a recovery diskette because it's the most critical need. Then the system is configured to ease addition of new users, in "Configuring for Adding Users", because this can affect the choices you make in the three subsequent topics - "/etc/inputrc", "The Bash Shell Startup Files" and "/etc/vimrc, ~/.vimrc".

The remaining topics, "/etc/issue (Customizing your logon)", "Random number generation", "Man page issues" and "Info page issues" are then addressed, in that order. They don't have much interaction with the other topics in this chapter.


Creating a Custom Boot Disk

Decent Rescue Boot Disk Needs

This section is really about creating a rescue diskette. As the name rescue implies, the host system has a problem, often lost partition information or corrupted file systems, that prevents it from booting and/or operating normally. For this reason, you must not depend on resources from the host being "rescued". To presume that any given partition or hard drive will be available is a risky presumption.

Heeding the warning, the rescue disk created here has no dependency on the host system's resources, other than basic bootability and hardware soundness. At a minimum, the most common sorts of failures requiring a rescue boot disk should be addressed by the contents of the boot disk. This would include the common loss of partitioning (master boot record is lost or corrupted), file system corruption, and the need to allow creation and editing of files that may have been lost or corrupted, possibly as an effect of the other two problems.

Additional utilities should be available to search for text or files, copy, move and remove files, and many other normal operations that might be expected to be needed when reconstructing.


This Minimal Decent Rescue Disk

The intent here is to create a "rescue boot disk" that will support the common operations listed above. These functions are provided by including selected executables from busybox and e2fsprogs. A basic editor and rudimentary disk partitioning utility may also be optionally included.

This, however, is not the limit. A minimal disk is described here, but you can add anything you can fit on the floppy. Furthermore, if one floppy is not enough to meet your needs, you can make a multi-diskette rescue set that means, essentially, the sky is the limit. This is discussed below. The number of other possible variations are just too numerous to mention here.


Build the Rescue Boot Disk

Prerequisites

You should have known-good floppy diskettes available. Some people prefer to use the fdformat command to prepare these because it also does a verification. See the man page for more details. Another good idea is to always prepare duplicates of the rescue diskette. Media does deteriorate.

These instructions presume a base LFS install using ext2/ext3 file systems.

You need to have loopback device support enabled in your host's kernel to use this procedure.

You should make a custom kernel that includes only those features needed to rescue your system, so it will have the least size. No sense in building in support for things like XFree86, DRI, etc, as most rescues are performed from the command prompt. Along the same lines, if you have GCC-2.95.3, it is known to produce smaller kernels. So you might want to use that compiler for this kernel. If you do so, don't overlook any loadable modules (which are not addressed here) you might need - they need to be compiled with same compiler used to make the kernel.

The rescue image must include support for the file system of your choice (we presume ext2/3 here), ramdisk and initial ramdisk (initrd). Disable everything that you can in the kernel configuration. You should keep support for the proc file system and tempfs file system enabled because of their general utility. The proc file system is needed for the mount to report properly.

If you install only the minimal set of components shown in this document, you will need a kernel that is 643 or fewer blocks in size. If you want the optional programs - a very basic editor, like ed, and rudimentary disk partitioning, like sfdisk - the kernel will need to be 595 or fewer blocks in size. This should not be a major problem unless your needs are fairly esoteric. On the system used to develop this version of the procedures, using only ext2 file systems and not using networking or CDs for recovery, the kernel image is only 481 blocks. And there may be more to gain - it has not been closely examined for additional gains.

This kernel image will be called "rescueimage" hereinafter. You can actually name your image anything you like and just use its name instead in any commands that include "rescueimage".

If you can not get your kernel down to the size needed to allow all you need on the ramdisk image, don't fret. You can always build a two diskette set, one boot and one root diskette. The kernel will prompt you to insert the root file system diskette. This will allow room for a compressed ramdisk image of 1440 blocks and a kernel of the same size.

The kernel size limits given above are likely to vary as local system-specific configurations change. Use them only as a guideline and not as gospel. The size of the kernel image as shown by ls -sk is only an approximation because of some "overhead". On the system used to develop this version of these procedures, that command shows 488 blocks but the actual number of blocks written is only 480 and a fraction, which means that 481 blocks are actually used.


Rescue Disk Build Process

The basic process will be:

  • make a mount point for a file system

  • make an empty file to hold the file system

  • bind the empty file to a loopback device

  • make a 4MB file system

  • mount the file system

  • add components to the file system

  • make the compressed initrd

  • join a kernel image and initrd onto a diskette

The initial ramdisk will be automatically loaded at boot time if setup is done correctly.

Make a mount point and an empty file to hold a file system

mkdir -p /mnt/loop1
dd if=/dev/zero of=/tmp/rfloppy bs=1k count=4096

Command explanations

dd: This is a generalized input-to-output copy utility that also has many transformation capabilities.

if=/dev/zero: This parameter assigns dd's input file to a device that returns an infinite stream of zeroes.

of=/tmp/rfloppy: This parameter directs dd's output to /tmp/rfloppy.

bs=1k count=4096: These parameters tell dd to read and write in "chunks" of 1024 bytes and process 4096 "chunks".

Bind the file to a loopback device, make a file system and mount it.

The reason these commands are used is that they work regardless of the version of mount (older ones don't have the -o loop option) or if /etc/mtab is symlinked to /proc (which causes mount to be unable to properly "unbind" a loop device, due to "lost" information). An alternate set of commands is provided, after these three commands, that you can use if you don't have either of these situations.

losetup /dev/loop1 /tmp/rfloppy
mke2fs -m 0 -N 504 /dev/loop1
mount -t ext2 /dev/loop1 /mnt/loop1

Command explanations

losetup /dev/loop1 /tmp/rfloppy: This command "binds" a loopback device to the empty file.

mke2fs -m 0 -N 504 /dev/loop1: This command makes an ext2 file system on the loopback device (which really means it is created in the file to which the loopback device is bound) and reserves no blocks. The -N 504 parameter causes only 504 inodes to be allocated, leaving more space for other things needed in the file system.

mount -t ext2 /dev/loop1 /mnt/loop1: This mounts the file system just created, just as if it were a real device, like a hard drive or diskette. This allows all the normal system I/O commands to operate as if a real device were present.

If your mount supports the -o loop option and your /etc/mtab is a real file, rather than a symlink to /proc, the three above commands can be replaced by these next two commands.

mke2fs -F -m 0 -N 504 /tmp/rfloppy
mount -o loop /tmp/rfloppy /mnt/loop1

Command explanations

mke2fs -F -m 0 -N 504 /tmp/rfloppy: As before, a file system is made, with only 504 inodes and no reserved blocks, that will be bound to a loopback device. The -F parameter just suppresses an irritating question issued when mke2fs realizes that you are not accessing a device.

mount -o loop /tmp/rfloppy /mnt/loop1: This command tells mount to bind the named file to a loopback device it automatically selects (the first available) and mount the device on /mnt/loop1.

Add components to the file system

A cautionary note: if you are not running in a chroot environment, be sure that you do not accidentally omit the /mnt/loop1 reference in the commands. If you do so, you might replace the equivalent components on your host with the components that are installed by these procedures. Even if you are in a chroot environment, you may need to be careful if the environment is your freshly built LFS system which you intend to use as a host in the future.

First, to have as much free space as possible, remove the lost+found directory, which is not needed because it is only used by fsck. Since fsck will never be run on this file system, it is unneeded.

rmdir /mnt/loop1/lost+found/

Now make a minimal set of directories.

mkdir /mnt/loop1/{dev,proc,etc,sbin,bin,lib,mnt,usr,var}

Add needed device files to the initrd image. If you use devfs, the following command works well, as you only have the devices you use anyway.

cp -dpR /dev/* /mnt/loop1/dev

If you used MAKEDEV to create your devices on your host, you'll want to use something similar to this longer command, to minimize wasting space with unneeded inodes.

You must modify this to suit your kernel configuration and other needs. For example, you may need SCSI devices and may not need frame buffer devices or the pseudo-terminal directory. Also, the number of hard drives and partitions that you include should be the minimal that you need. Extensive analysis has not been done on the list below, so there are more inodes and space to be gained by "fine tuning" this set.

mkdir /mnt/loop1/dev/pts
cp -a \ 
    /dev/null /dev/console \
    /dev/fb[0-7] /dev/fd /dev/fd0 /dev/fd0h1440 /dev/full \
    /dev/hda* /dev/hdb* /dev/hdc* /dev/hdd* /dev/initctl /dev/kmem \
    /dev/loop[0-3] /dev/lp0 /dev/mem /dev/port \
    /dev/psaux /dev/ram \
    /dev/ram0 /dev/ram1 /dev/ram2 /dev/ram3 /dev/random /dev/rtc \
    /dev/shm /dev/stderr /dev/stdin /dev/stdout /dev/tty \
    /dev/tty[0-9] /dev/ttyS0 /dev/ttyS1 /dev/urandom /dev/zero \
  /mnt/loop1/dev

What is needed in the /etc directory

If you choose, you can copy all or selected parts of your /etc/passwd and /etc/group files. But even if each is less than 1024 bytes, you will lose two inodes and two blocks of space on the initial ramdisk. This only really matters because of trying to squeeze everything onto a 1.44MB diskette. Every little bit helps. The strategy taken here is to create these two files as part of the rescue boot and initialization process. The commands that make the two files will be embedded inside the rcS script that linuxrc (really busybox ) invokes after the initrd is loaded. This way no more inodes or blocks are used on the diskette to carry these files.

Some might like to copy their /etc/rc* directory into the ramdisk image, but this may have no value, other than archival use, in a worst-case recovery scenario. If you want automatic initialization of the system after repair, they may have some value. But few people need or want this to happen. If the file system on the hard drives are corrupted, what good will mount scripts do? Some scripts may be useful, like access to a network to copy over backup data when the hard drive's file systems are usable again. The point is that you should copy only the parts that you can use because space is at a premium on the diskette.

Here, only the fstab will be included. This is handy because it eases mounting of partitions that may be useful and also can be examined and used as a guide as to what is available and what may need reconstruction. Because it may be larger than needed, you should edit it to remove any useless entries and minimize commentary. No other editing is needed because the boot scripts are not included and no automatic mounting will be done using the fstab. If you decide to include some boot scripts that might try to mount things, change the fstab's entries to noauto in the options field so they don't cause an attempt to mount a potentially corrupt partition. Copy it to /tmp, edit it as desired and then:

cp -a /tmp/fstab /mnt/loop1/etc

Now the initialization script will be added. As mentioned above, linuxrc is symlinked to busybox . After the kernel and initial ramdisk have been loaded, the kernel gives control to linuxrc (busybox ). It wants to run an /etc/init.d/rcS script to do any initial setup.

If you use devfsd, you will need to set up the rcS script to handle the devfsd startup. Put the following commands in /mnt/loop1/etc/init.d/rcS. You may also want to add some of the processes shown in the non-devfs version that follows.

#!/bin/sh
mount -t devfs devfs /dev
/sbin/devfsd /dev

If you don't use devfsd, but created a static /dev directory using MAKEDEV, or any similar process, the rcS script will do slightly different things. Also, don't forget that it is creating the /etc/passwd and /etc/group files, thus saving space on the diskette.

The script made next will mount /proc, turn on swap (no harm is done if it fails), make the /etc/passwd and /etc/group files, create a log directory and turn on swapping. Create the script with:

mkdir -p /mnt/loop1/etc/init.d
cat >/mnt/loop1/etc/init.d/rcS << EOD
#!/bin/sh
mount -t proc proc /proc
swapon -a

echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd

cat > /etc/group <<EOF
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
EOF
chmod 644 /etc/passwd /etc/group

mkdir /var/log

EOD
chmod u+x /mnt/loop1/etc/init.d/rcS

Unless you add a lot to this script, which is encouraged, the above should be reasonably close to what you need.

Install packages

There are two packages that must be installed. The busybox package incorporates the core functions that provide a shell and many basic utilities. A file system package, like e2fsprogs, or a package for the file system you are using will provide a minimal set of utilities for file system checking and reconstruction. The whole package will not be installed, but only certain needed components.

If you use devfsd, you will also need to install that software.

Install busybox into the initial ramdisk image. Busybox incorporates many Unix utility program functions into a single small executable file.

make &&
make PREFIX=/mnt/loop1 install &&
> /mnt/loop1/var/utmp

A var/utmp is made because busybox needs it for the reboot command to work properly. If this file doesn't exist when busybox is started, the reboot command will not work. This would be a bad thing for people that have no reset button available to them.

If you use devfs to create devices on the fly and free up precious inodes on the floppy, you'll also install devfsd to facilitate the devices that busybox expects to find. Use the following commands to do the install.

mv GNUmakefile Makefile &&
make &&
make PREFIX=/mnt/loop1 install &&

Install part of e2fsprogs

If you use the ext2 or ext3 (journaling) file system, you can use the commands below to install the minimal functionality that should allow you to get your hard drives usable again. If you use ext3, keep in mind that it is a part of the e2fsprogs package and you can get the components, which are mostly hard links, from the same places shown below. If you use some other file system, such as reiserfs, you should apply the principals you see here to install parts of that package instead.

LDFLAGS='-s'
mkdir build &&
cd build &&
../configure --prefix=/mnt/loop1/usr --with-root-prefix="" \
    --disable-swapfs --disable-debugfs \
    --enable-dynamic-e2fsck --disable-nls --disable-evms \
    --disable-rpath &&
make LDFLAGS="$LDFLAGS" &&
strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/sbin/mke2fs misc/mke2fs &&
strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/sbin/e2fsck e2fsck/e2fsck &&
chmod 555 /mnt/loop1/sbin/{mke2f,e2fsck}

Two useful utilities

There are two very useful utilities that any rescue disk should have to help in faster and more accurate recovery. The first is a partitioning utility. The sfdisk program is used here because of its small size and great power. Be warned though - it is not what is considered to be "user friendly". But the fdisk and cfdisk programs are substantially larger or require more shared objects, like ncurses .

The second utility is an editor. Most graphical editors are inherently too large and also require additional shared objects. For this reason, ed is used here. It is small, requires no additional shared objects and is a regex-based editor that is the ancestor to almost all subsequent editors that support regex-based editing, whether graphical or not. It is a "context editor" and offers powerful, but non-graphical, editing features. There are many other editors that may be suitable - feel free to use one of them instead.

Read the busybox INSTALL and README files to see how to include a vi editor. It has not been investigated here yet, so it may or may not easily fit onto a single diskette image such as is made here.

You can install these or not, but it is important for you to have some capability such as these offer. Exactly how you would install the utilities you choose will have to be determined by you.

Sfdisk and ed are installed by, essentially, copying them from your host. Strip is used, just to assure that they carry no "excess baggage", even though the base LFS install should have stripped them already. Use the following commands:

strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/sbin/sfdisk /sbin/sfdisk
strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/bin/ed /bin/ed
chmod 555 /mnt/loop1/sbin/sfdisk /mnt/loop1/bin/ed

Also, keeping in mind your space limitations, copy any other binaries and libraries you need to the image. Use the ldd command to see which libraries you will need to copy over for any executables. Don't forget to also strip them before copying them to the ramdisk image or use the strip, as above, to "copy" them.

Set up the lib directory

Once you have installed all the utilities from above and any additional ones you want, use the ldd command, as mentioned above, on those that were not listed in this document. If any additional libraries are needed, add them into the setup commands shown next.

If you installed only those things shown above, the shared objects needed will be minimal. You can add them to the ramdisk image with:

strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/lib/libc.so.6 /lib/libc-2.3.2.so &&
strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/lib/ld-linux.so.2 /lib/ld-2.3.2.so &&
strip -p --strip-unneeded --remove-section=.comment \
    -o /mnt/loop1/lib/libdl.so.2 /lib/libdl-2.3.2.so &&
chmod 555 /mnt/loop1/lib/{libc.so.6,ld-linux.so.2,libdl.so.2}

Note that the above commands change the names of the libraries, eliminating the need for the usual symlinks. If you add any additional shared objects, be alert for similar opportunities and also the pitfalls that may be present.

Make the compressed initrd

Unmount the loopback file. If you used mount's -o loop option, the "bond" between the loop device and the file will be removed when the unmount is done. Just omit the losetup -d /dev/loop1 from the following sequence. The -9 parameter is used with gzip to make the smallest possible compressed image. To make sure it will fit on the diskette, list the file's size.

umount /mnt/loop1 &&
losetup -d /dev/loop1 &&  # Omit if mount's -o loop was used
gzip -9 < /tmp/rfloppy > /tmp/rootfs.gz
ls -l /tmp/rootfs.gz

Join a kernel image and initrd onto a diskette

Now the kernel image and initial ramdisk image will be written to the boot diskette. Before doing this, calculate the number of blocks needed for the kernel and for the initrd, individually, by dividing each size by 1024 and adding one if there is any remainder. Add these two results together. They must total 1,440 or fewer blocks. If they total more than this, don't worry too much. Changes to make a two-diskette set are presented later. Of course, you could reexamine your choices and try to shrink either the kernel or the initial ramdisk image.

To make a single-floppy rescue, using devfs, use the following commands. If you use the static /dev setup, use /dev/fd0 instead of the /dev/floppy/0.

dd if=rescueimage of=/dev/floppy/0 bs=1k
rdev /dev/floppy/0 0,0
rdev -R /dev/floppy/0 0

Command explanations

rdev /dev/floppy/0 0,0: sets the root file system the kernel will use when it boots. Because it loads an initrd, it will automatically set that as the root device, initially. So, the 0,0 gives it "no value", telling the kernel to not mount any other device. Some folks give /dev/fd0 or something similar. But this has effect only when linuxrc (really busybox ) exits and the normal init processes get invoked. Since this is not being done here, and the floppy is not a valid file system, it would be useless here. A hard drive would be a better choice if you are looking to automatically bring the system up after repair. Since busybox provides the reboot command, automatic initialization is not needed.

The rdev -R /dev/floppy/0 0 will set the "root flags" to zero. They have no use in this application.

The dd from above showed some results, like

        480+1 records in
        480+1 records out

In this example the rescueimage (kernel) was 480+1 blocks in size. Make sure that this number, which may be different for you, matches your calculations from above. You need to calculate a "magic number" now that will be inserted into the kernel image. The value consists of three significant parts. Two are discussed here. The third is touched upon later.

Bits 0 - 10 will contain the size of the kernel image, in blocks, that you calculated above, and which should match the results from the dd above. Bit 14 (the 15th bit, which is 2 to the 14th power, or 16,384) is a flag that, when set to 1, tells the kernel an initial ramdisk is to be loaded. So for the single-floppy rescue diskette, the two numbers 16,384 and 481 (or whatever number is right for your kernel size) are added together to produce a decimal value, like 16865. This value is inserted into the proper place in the kernel image by the rdev command done next.

Insert the "magic number" into the kernel image and then write the root file system right after the kernel on the floppy by executing the following commands, with the proper numbers inserted. Notice that the seek parameter's number must be the size, in blocks, of your kernel image. If you use the static /dev setup, use /dev/fd0 in the commands below, instead of /dev/floppy/0.

rdev -r /dev/floppy/0 16865
dd if=/tmp/rootfs.gz of=/dev/floppy/0 bs=1k seek=481

In this command, seek was used to position to the block following the end of the kernel (480+1) and begin writing the root file system to the floppy.


A Two-diskette Rescue Setup

If you just can't live with a single-diskette rescue system, here is what to do to make a simple two-diskette system. Note that the endless possibilities presented by the availability of linuxrc and other components are not addressed here. Here you will just use the kernel's ability to prompt for a second diskette that contains the initrd image and load it.

Modify the above instructions as follows. First a different magic number is needed. The 15th bit (bit 14) still needs to be set, but the size of the kernel image, in blocks, is replaced with a zero. The third component, which was not discussed above, is now used. This is the 16th bit (bit 15) of the "magic number". When set, it tells the kernel to ask the user to insert the "root" floppy. It then loads the initrd image from that diskette. Because the size of the kernel image was replaced by zero, the kernel starts loading from the "zero'th" block (the first one) on the second diskette.

The 16th bit (bit 15) represents 2 raised to the 15th power, or 32,768. So the new magic number is 32,768 + 16384, which is 49,152. This value tells the kernel to prompt for, and then load, an initial ramdisk image from the first block on the inserted floppy. So your first modification is to the command to write the "magic number" to the kernel image on the diskette.

rdev -r /dev/floppy/0 49152

Note that the initrd image is not copied to the diskette yet. Remove the boot diskette and insert another diskette that will hold your root file system. Run this modified command (don't forget to use /dev/fd0 if you don't use devfs). Note that no seek parameter is used.

dd if=/tmp/rootfs.gz of=/dev/floppy/0 bs=1k

That's all there is to it. The possibilities from here are limited only by your imagination and tenacity in pursuing enhancements. And your willingness to research available documentation. A good starting point is the "Documentation" directory in your kernel source tree. More help may be gained at LFS Hints (please use a mirror site that is suitable) and TLDP.


Configuring for Adding Users

Together, the /usr/sbin/useradd command and /etc/skel directory (both are easy to setup and use) provide a way to assure new users are added on your LFS system with the same beginning settings for things like PATH, keyboard processing and environmental variables. Using these two facilities makes it easier to assure this initial state for each new user.

The /etc/skel directory holds copies of various initialization and other files that may be copied to the new user's home directory when the /usr/sbin/useradd program adds the new user.

Useradd

The useradd program uses a collection of default values kept in /etc/default/useradd, if it exists. If the file does not exist, then it uses some internal defaults. You can see the default values by running /usr/sbin/useradd -D.

To change these values to something new, create a base /etc/default/useradd file with the same values as the output of /usr/sbin/useradd -D. Here is a sample.

# Begin /etc/default/useradd

GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=
SKEL=/etc/skel

# End /etc/default/useradd

The only thing missing from the file is a default shell. Add that by running:

/usr/sbin/useradd -D -s/bin/bash

This will set the SHELL= line to SHELL=/bin/bash.

Useradd has many parameters that can be set in the /etc/default/useradd file.

For more information see man useradd.

/etc/skel

To get started create an /etc/skel directory and make sure it is writable only by the system administrator, usually root. Creating the directory as root is the best way to go.

The mode of any files from this part of the book that you put in /etc/skel should be writable only by the owner. Also, since there is no telling what kind of sensitive information a user may eventually place in their copy of these files, you should make them unreadable by "group" and "other".

You can also put other files in /etc/skel and different permissions may be needed for them.

Decide which initialization files should be provided in every (or most) new user's home directory. The decisions you make will affect what you do in the next three sections, /etc/inputrc, The Bash Shell Startup Files and /etc/vimrc, ~/.vimrc. Some or all of those files will be useful for root, any already-existing users, and new users.

The files from those sections that you might want to place in /etc/skel include .inputrc, .bash_profile, .bashrc, .bash_logout, .dircolors, and .vimrc. If you are unsure which of these should be placed there, just continue to the following sections, read each section and any references provided, and then make your decision.

You will run a slightly modified set of commands for files which are placed in /etc/skel. Each section will remind you of this. In brief, the book's commands have been written for files not added to /etc/skel and just send the results to the user's home directory. If the file is going to be in /etc/skel, change the book's command(s) to send output there instead and then just copy the file from /etc/skel to the appropriate directories, like /etc, ~ or the home directory of any other user already in the system.

When Adding a User

When adding a new user with useradd use the -m parameter, which tells useradd to create the user's home directory and copy files from /etc/skel (can be overridden) to the new user's home directory. For example:

useradd -m -s/bin/bash jwrober

/etc/inputrc

Inputrc deals with the mapping of the keyboard for certain situations. This file is the start-up file used by readline - the input related library used by Bash and most other shells.

For more information see info bash -- Node: Readline Init file as well as info readline. There is a lot that can be done with this one rc file.

Global values are set in /etc/inputrc. Personal user values are set in ~/.inputrc. The ~/.inputrc file will override the global settings file. A later page sets up Bash to use /etc/inputrc if there is no .inputrc for a user when /etc/profile is read (usually at login). If you want your system to use both, or don't want global keyboard handling, it is a good idea to place a default .inputrc into the /etc/skel directory for use with new users.

Below is a base /etc/inputrc along with comments to explain what the various options do. Note that comments can not be on the same line as commands.

If you will create an .inputrc in /etc/skel using the command below, change the command's output to /etc/skel/.inputrc and be sure to check/set permissions afterward. Then you can just copy that file to /etc/inputrc and the home directory of any user already existing in the system, including root, that needs a private version of the file. Be sure to use the -p parameter of cp to maintain permissions and be sure to change owner and group appropriately.

cat > /etc/inputrc << "EOF"
# Begin /etc/inputrc

# Make sure we don't output everything on the 1 line
set horizontal-scroll-mode Off

# Enable 8bit input
set meta-flag On 
set input-meta On

# Turns off 8th bit stripping
set convert-meta Off

# Keep the 8th bit for display
set output-meta On

# none, visible or audible
set bell-style none

# All of the following map the escape sequence of the 
# value contained inside the 1st argument to the 
# readline specific functions

"\eOd": backward-word
"\eOc": forward-word

# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert

# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# End /etc/inputrc
EOF

The Bash Shell Startup Files

The shell program /bin/bash (hereafter referred to as just "the shell") uses a collection of startup files to help create an environment to run in. Each file has a specific use and may affect login and interactive environments differently. The files in the /etc directory generally provide global settings. If an equivalent file exists in your home directory it may override the global settings.

An interactive login shell is started after a successful login, using /bin/login, by reading the /etc/passwd file. An interactive non-login shell is started at the command-line (e.g. [prompt]$/bin/bash). A non-interactive shell is usually present when a shell script is running. It is non-interactive because it is processing a script and not waiting for user input between commands.

For more information see info bash -- Nodes: Bash Startup Files and Interactive Shells.

The following files are used to make sure that the correct environment is established for each of the ways the shell can be invoked: /etc/profile and its private equivalent ~/.bash_profile, and /etc/bashrc (unofficial) and its private equivalent ~/.bashrc.

The file ~/.bash_logout is not used for an invocation of the shell. It is read by the shell when a user logs out of the system.

The files /etc/profile and ~/.bash_profile are read when the shell is invoked as an interactive login shell. The file ~/.bashrc is read when the shell is invoked as an interactive non-login shell and it reads /etc/bashrc if it exists

Also useful are the /etc/dircolors and ~/.dircolors files called from /etc/profile. They control colorized output of things like ls --color.

Here is a base /etc/profile. Comments in the file should explain everything you need. For more information on the escape sequences you can use for your prompt (e.g. the PS1 environment variable) see info bash -- Node: Printing a Prompt.

cat > /etc/profile << "EOF"
# Begin /etc/profile
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>

# System wide environment variables and startup programs.

# System wide aliases and functions should go in /etc/bashrc.  Personal
# environment variables and startup programs should go into
# ~/.bash_profile.  Personal aliases and functions should go into
# ~/.bashrc.

# Function to help us manage paths
pathman () {
	if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
		if [ "$2" = "last" ] ; then
			PATH=$PATH:$1
		else
			PATH=$1:$PATH
		fi
	fi
}

# Add to the standard path.
if [ $(id -u) = 0 ] ; then
	if [ -d "/usr/local/sbin" ] ; then
		pathman /usr/local/sbin last
	fi
fi

if [ $(id -u) != 0 ] ; then
	if [ -d "/usr/local/bin" ] ; then
		pathman /usr/local/bin last
	fi
fi

if [ -d "/usr/X11R6/bin" ] ; then
	pathman /usr/X11R6/bin last
fi

# Setup some environment variables.
HISTSIZE=1000
HISTIGNORE="&:[bf]g:exit"
PS1="[\u@\h \w]\\$ "

# Setup the INPUTRC environment variable.
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
	INPUTRC=/etc/inputrc
fi

# Setup for /bin/ls to support color, the alias is in /etc/bashrc.
if [ -f "/etc/dircolors" ] ; then
	eval $(dircolors -b /etc/dircolors)

	if [ -f "$HOME/.dircolors" ] ; then
		eval $(dircolors -b $HOME/.dircolors)
	fi
fi

export PATH HISTSIZE HISTIGNORE PS1 LS_COLORS INPUTRC

# End /etc/profile
EOF

Here is a base /etc/bashrc. Comments in the file should explain everything you need.

cat > /etc/bashrc << "EOF"
# Begin /etc/bashrc 
# Written for Beyond Linux From Scratch 
# by James Robertson <jameswrobertson@earthlink.net>

# System wide aliases and functions.

# System wide environment variables and startup programs should go into
# /etc/profile.  Personal environment variables and startup programs
# should go into ~/.bash_profile.  Personal aliases and functions should
# go into ~/.bashrc

# By default we want the umask to get set.
# Even for non-interactive and non-login shells.
if [ "$(id -gn)" = "$(id -un)" -a $(id -u) -gt 99 ] ; then
	umask 002
else
	umask 022
fi

# Provides a colored /bin/ls command.  Used in conjunction with code in
# /etc/profile.
alias ls='ls --color=auto'

# Provides prompt for non-interactive shells, specifically shells started
# in the xfree environment. [Review archive thread titled PS1
# Environment Variable for a great case study behind this script
# addendum.]
export PS1="[\u@\h \w]\\$ "

# End /etc/bashrc
EOF

Here is a base ~/.bash_profile. Comments in the file should explain everything you need. If you want each new user to have this file automatically provided, just change the output of the next command to /etc/skel/.bash_profile and check the permissions after the command is run. You can then copy /etc/skel/.bash_profile to the home directories of already existing users, including root, and set the owner and group appropriately.

cat > ~/.bash_profile << "EOF"
# Begin ~/.bash_profile
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>

# Personal environment variables and startup programs.

# Personal aliases and functions should go in ~/.bashrc.  System wide
# environment variables and startup programs are in /etc/profile.
# System wide aliases and functions are in /etc/bashrc.

if [ -f "$HOME/.bashrc" ] ; then
	source $HOME/.bashrc
fi

if [ -d "$HOME/bin" ] ; then
	pathman $HOME/bin last
fi

export PATH 

# End ~/.bash_profile
EOF

Here is a base ~/.bashrc. Comments in the file should explain everything you need. The comments and instructions for using /etc/skel for .bash_profile above also apply here. Only the target file names are different.

cat > ~/.bashrc << "EOF"
# Begin ~/.bashrc
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>

# Personal aliases and functions.

# Personal environment variables and startup programs should go in
# ~/.bash_profile.  System wide environment variables and startup
# programs are in /etc/profile.  System wide aliases and functions are
# in /etc/bashrc. 

if [ -f "/etc/bashrc" ] ; then
	source /etc/bashrc
fi

# End ~/.bashrc
EOF

Here is a base ~/.bash_logout. Comments in the file should explain everything you need. You will notice that the base ~/.bash_logout does not include a clear command. This is because the clear is handled in the /etc/issue file.

cat > ~/.bash_logout << "EOF"
# Begin ~/.bash_logout
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>

# Personal items to perform on logout.

# End ~/.bash_logout
EOF

If you want to use the dircolors capability then run the following command. The /etc/skel setup steps seen above also can be used here to provide a .dircolors file when a new user is set up. As before, just change the output file name on the following command and assure the permissions, owner and group are correct on the files created and/or copied.

/bin/dircolors -p > /etc/dircolors

Ian Macdonald has written an excellent collection of tips and tricks to enhance your shell environment. You can read it online at http://www.caliban.org/bash/index.shtml


/etc/vimrc, ~/.vimrc

The LFS book installs vim as its editor. At this point we should state that there are a lot of different editors out there including emacs, nano, joe and many more. Anyone who has been around the Internet (especially usenet) for a short time will certainly have observed at least one flame war, usually involving vim and emacs users!

The LFS book gives a basic vimrc file. Here, we attempt to enhance this file. At startup, vim reads /etc/vimrc and ~/.vimrc (i.e., the global vimrc and the user-specific one.). Note that this is only true if you compiled vim using LFS-3.1 onwards. Prior to this, the global vimrc was /usr/share/vim/vimrc .

Here is a slightly expanded vimrc that you can put in /etc/vimrc to provide global effect. Of course, if you put it into /etc/skel/.vimrc instead, it will be made available to users you add to the system later. You can also copy the file from /etc/skel/.vimrc to /etc/vimrc and the home directory of users already on the system, like root. Be sure to set permissions, owner and group if you do copy anything directly from /etc/skel.

" Begin .vimrc

set bs=2
set columns=80
set background=dark
set wrapmargin=8
syntax on
set ruler

" End .vimrc

A FAQ on the lfs mailing lists regards the comment tags in vimrc. Note that they are " instead of the more usual # or //. This is correct, the syntax for vimrc is slightly unusual.

We'll run through a quick explanation of what each of the options in this example file means here:

  • set bs=2: This influences the behavior of the backspace option. It is fairly complex so see :help 'bs' for more details.

  • set columns=80: This simply sets the number of columns used on the screen.

  • set background=dark: This tells vim to use colors which look good on a dark background.

  • set wrapmargin=8: This is the number of characters from the right window border where wrapping starts.

  • syntax on: Enables vim's syntax highlighting.

  • set ruler: This makes vim show the current row and column at the bottom right of the screen.

More information on the many vim options can be found by reading the help inside vim itself. Do this by typing :help in vim to get the general help, or by typing : help usr_toc.txt to view the User Manual Table of Contents.


/etc/issue (Customizing your logon)

When you first boot up your new LFS system, the logon screen will be nice and plain (as it should be in a bare-bones system). Many people however, will want their system to display some information in the logon message. This can be accomplished using the file /etc/issue.

The /etc/issue file is a plain text file which will also accept certain Escape sequences (see below) in order to insert information about the system. There is also the file issue.net which can be used when logging on remotely. ssh however, will only use it if you set the option in the configuration file and will also not interpret the escape sequences shown below.

One of the most common things which people want to do is to clear the screen at each logon. The easiest way of doing that is to put a "clear" escape-sequence into /etc/issue. A simple way of doing this is to do clear > /etc/issue. This will insert the relevant escape code into the start of the /etc/issue file. Note that if you do this, when you edit the file, you should leave the ^[c character on the first line alone.

The following escapes are recognized by agetty (the program which usually parses /etc/issue). This information is from man agetty where you can find extra information about the logon process.

The issue file can contain certain escape codes to display various information. All escape codes consist of a backslash (\) immediately followed by one of the letters explained below (so \d in /etc/issue would insert the current date).

b   Insert the baudrate of the current line.
d   Insert the current date.
s   Insert the system name, the name of the operating system.
l   Insert the name of the current tty line.
m   Insert the architecture identifier of the machine, e.g. i486
n   Insert the nodename of the machine, also known as the hostname.
o   Insert the domainname of the machine.
r   Insert the release number of the kernel, e.g. 2.4.16.
t   Insert the current time.
u   Insert the number of current users logged in.
U   Insert the string "1 user" or "<n> users" where <n> is the
    number of current users logged in.
v   Insert the version of the OS, e.g. the build-date etc.

Random number generation

The Linux kernel supplies a random number generator which is accessed through /dev/random and /dev/urandom. Programs that utilize the random and urandom devices, such as OpenSSH, will benefit from these instructions.

When a Linux system starts up without much operator interaction, the entropy pool, data used to compute a random number, may be in a fairly predictable state. This creates the real possibility that the number generated at startup may always be the same. In order to counteract this effect, you should carry the entropy pool information across your shut-downs and start-ups. The following init.d script and links will perform this function for you automatically.

cat > /etc/rc.d/init.d/random << "EOF"

#!/bin/sh
# Begin $rc_base/init.d/random

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# Random script elements by Larry Lawrence

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Initializing kernel random number generator..."
                if [ -f /var/tmp/random-seed ]; then
	                cat /var/tmp/random-seed >/dev/urandom
		fi
		dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
		evaluate_retval
		;;
		
	stop)
		echo "Saving random seed..."
		dd if=/dev/urandom of=/var/tmp/random-seed count=1 &>/dev/null
		evaluate_retval
		;;

        *)
                echo "Usage: $0 {start|stop}"
                exit 1
                ;;
esac

# End $rc_base/init.d/random
EOF
chmod 755 /etc/rc.d/init.d/random

Create the symbolic links to this file in the relevant rc.d directories with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/random ../rc0.d/K45random &&
ln -sf ../init.d/random ../rc2.d/S25random &&
ln -sf ../init.d/random ../rc3.d/S25random &&
ln -sf ../init.d/random ../rc4.d/S25random &&
ln -sf ../init.d/random ../rc5.d/S25random &&
ln -sf ../init.d/random ../rc6.d/K45random

Compressing man and info pages

Man and info reader programs can transparently process gzip'ed or bzip2'ed pages, a feature you can use to free some disk space while keeping your documentation available. However, things are not that simple: man directories tend to contain links - hard and symbolic - which defeat simple ideas like recursively calling gzip on them. A better way to go is to use the script below.

cat > /usr/bin/compressdoc << "EOF"

#!/bin/bash
# VERSION: 20031004.0245
#
# Compress (with bzip2 or gzip) all man pages in a hierarchy and
# update symlinks - By Marc Heerdink <marc @ koelkast.net>
# Modified to be able to gzip or bzip2 files as an option and to deal
# with all symlinks properly by Mark Hymers <markh @ linuxfromscratch.org>
#
# Modified 20030930 by Yann E. Morin <yann.morin.1998 @ anciens.enib.fr>
# to accept compression/decompression, to correctly handle hard-links,
# to allow for changing hard-links into soft- ones, to specify the
# compression level, to parse the man.conf for all occurrences of MANPATH,
# to allow for a backup, to allow to keep the newest version of a page.
#
# TODO:
#        - choose a default compress method to be based on the available
#          tool : gzip or bzip2;
#        - when a MANPATH env var exists, use this instead of /etc/man.conf
#          (useful for users to (de)compress their man pages;
#        - offer an option to restore a previous backup;
#        - add other compression engines (compress, zip, etc?). Needed?

# Funny enough, this function prints some help.
function help ()
{
  if [ -n "$1" ]; then
    echo "Unknown option : $1"
  fi
  ( echo "Usage: $0 <comp_method> [options] [dirs]" && \
  cat << EOT
Where comp_method is one of :
  --gzip, --gz, -g
  --bzip2, --bz2, -b
                Compress using gzip or bzip2.

  --decompress, -d
                Decompress the man pages.

  --backup      Specify a .tar backup shall be done for every directories.
                In case a backup already exists, it is saved as .tar.old prior
                to making the new backup. If an .tar.old backup exist, it is
                removed prior to saving the backup.
                In backup mode, no other action is performed.

And where options are :
  -1 to -9, --fast, --best
                The compression level, as accepted by gzip and bzip2. When not
                specified, uses the default compression level for the given
                method (-6 for gzip, and -9 for bzip2). Not used when in backup
                or decompress modes.

  --force, -F   Force (re-)compression, even if the previous one was the same
                method. Useful when changing the compression ratio. By default,
                a page will not be re-compressed if it ends with the same suffix
                as the method adds (.bz2 for bzip2, .gz for gzip).

  --soft, -S    Change hard-links into soft-links. Use with _caution_ as the
                first encountered file will be used as a reference. Not used
                when in backup mode.

  --hard, -H    Change soft-links into hard-links. Not used when in backup mode.

  --conf=dir, --conf dir
                Specify the location of man.conf. Defaults to /etc.

  --verbose, -v Verbose mode, print the name of the directory being processed.
                Double the flag to turn it even more verbose, and to print the
                name of the file being processed.

  --fake, -f    Fakes it. Print the actual parameters compman will use.

  dirs          A list of space-separated _absolute_ pathname to the man
                directories.
                When empty, and only then, parse ${MAN_CONF}/man.conf for all
                occurrences of MANPATH.

Note about compression
  There has been a discussion on blfs-support about compression ratios of
  both gzip and bzip2 on man pages, taking into account the hosting fs,
  the architecture, etc... On the overall, the conclusion was that gzip
  was much efficient on 'small' files, and bzip2 on 'big' files, small and
  big being very dependent on the content of the files.

  See the original post from Mickael A. Peters, titled "Bootable Utility CD",
  and dated 20030409.1816(+0200), and subsequent posts:
  http://linuxfromscratch.org/pipermail/blfs-support/2003-April/038817.html

  On my system (x86, ext3), man pages were 35564kiB before compression. gzip -9
  compressed them down to 20372kiB (57.28%), bzip2 -9 got down to 19812kiB
  (55.71%). That is a 1.57% gain in space. YMMV.

  What was not taken into consideration was the decompression speed. But does
  it make sense to? You gain fast access with uncompressed man pages, or you
  gain space at the expense of a slight overhead in time. Well, my P4-2.5GHz
  does not even let me notice this... :-)
EOT
) | less
}

# This function checks that the man page is unique amongst bzip2'd, gzip'd and
# uncompressed versions.
#  $1 the directory in which the file resides
#  $2 the file name for the man page
# Returns 0 (true) if the file is the latest and must be taken care of, and 1
# (false) if the file is not the latest (and has therefore been deleted).
function check_unique ()
{
  # NB. When there are hard-links to this file, these are
  # _not_ deleted. In fact, if there are hard-links, they
  # all have the same date/time, thus making them ready
  # for deletion later on.

  # Build the list of all man pages with the same name
  DIR=$1
  BASENAME=`basename "${2}" .bz2`
  BASENAME=`basename "${BASENAME}" .gz`
  LIST=
  [ -f "$DIR"/"${BASENAME}" -o -L "$DIR"/"${BASENAME}" ] && LIST="${LIST} ${BASENAME}"
  [ -f "$DIR"/"${BASENAME}".gz -o -L "$DIR"/"${BASENAME}".gz ] && LIST="${LIST} ${BASENAME}.gz"
  [ -f "$DIR"/"${BASENAME}".bz2 -o -L "$DIR"/"${BASENAME}".bz2 ] && LIST="${LIST} ${BASENAME}.bz2"

  # Look for, and keep, the most recent one
  LATEST=`(cd "$DIR"; ls -1rt $LIST | tail -1)`
  for i in $LIST; do
    [ "$LATEST" != "$i" ] && rm -f "$DIR"/"$i"
  done

  # In case the specified file was the latest, return 0
  [ "$LATEST" = "$2" ] && return 0
  # If the file was not the latest, return 1
  return 1
}

# OK, parse the command-line for arguments, and initialize to some sensible
# state, that is : don't change links state, parse /etc/man.conf, be most
# silent, search man.conf in /etc, and don't force (re-)compression.
COMP_METHOD=
COMP_SUF=
COMP_LVL=
FORCE_OPT=
LN_OPT=
MAN_DIR=
VERBOSE_LVL=0
BACKUP=no
FAKE=no
MAN_CONF=/etc
while [ -n "$1" ]; do
  case $1 in
    --gzip|--gz|-g)
      COMP_SUF=.gz
      COMP_METHOD=$1
      shift
      ;;
    --bzip2|--bz2|-b)
      COMP_SUF=.bz2
      COMP_METHOD=$1
      shift
      ;;
    --decompress|-d)
      COMP_SUF=
      COMP_LVL=
      COMP_METHOD=$1
      shift
      ;;
    -[1-9]|--fast|--best)
      COMP_LVL=$1
      shift
      ;;
    --force|-F)
      FORCE_OPT=-F
      shift
      ;;
    --soft|-S)
      LN_OPT=-S
      shift
      ;;
    --hard|-H)
      LN_OPT=-H
      shift
      ;;
    --conf=*)
      MAN_CONF=`echo $1 | cut -d '=' -f2-`
      shift
      ;;
    --conf)
      MAN_CONF="$2"
      shift 2
      ;;
    --verbose|-v)
      let VERBOSE_LVL++
      shift
      ;;
    --backup)
      BACKUP=yes
      shift
      ;;
    --fake|-f)
      FAKE=yes
      shift
      ;;
    --help|-h)
      help
      exit 0
      ;;
    /*)
      MAN_DIR="${MAN_DIR} ${1}"
      shift
      ;;
    -*)
      help $1
      exit 1
      ;;
    *)
      echo "\"$1\" is not an absolute path name" 
      exit 1
      ;;
  esac
done

# Redirections
case $VERBOSE_LVL in
  0)
     # O, be silent
     DEST_FD0=/dev/null
     DEST_FD1=/dev/null
     VERBOSE_OPT=
     ;;
  1)
     # 1, be a bit verbose
     DEST_FD0=/dev/stdout
     DEST_FD1=/dev/null
     VERBOSE_OPT=-v
     ;;
  *)
     # 2 and above, be most verbose
     DEST_FD0=/dev/stdout
     DEST_FD1=/dev/stdout
     VERBOSE_OPT="-v -v"
     ;;
esac

# Note: on my machine, 'man --path' gives /usr/share/man twice, once with a trailing '/', once without.
if [ -z "$MAN_DIR" ]; then
  MAN_DIR=`man --path -C "$MAN_CONF"/man.conf \
            | sed 's/:/\\n/g' \
            | while read foo; do dirname "$foo"/.; done \
            | sort -u \
            | while read bar; do echo -n "$bar "; done`
fi

# If no MANPATH in ${MAN_CONF}/man.conf, abort as well
if [ -z "$MAN_DIR" ]; then
  echo "No directory specified, and no directory found with \`man --path'"
  exit 1
fi

# Fake?
if [ "$FAKE" != "no" ]; then
  echo "Actual parameters used:"
  echo -n "Compression.......: "
  case $COMP_METHOD in
    --bzip2|--bz2|-b) echo -n "bzip2";;
    --gzip|__gz|-g) echo -n "gzip";;
    --decompress|-d) echo -n "decompressing";;
    *) echo -n "unknown";;
  esac
  echo " ($COMP_METHOD)"
  echo "Compression level.: $COMP_LVL"
  echo "Compression suffix: $COMP_SUF"
  echo -n "Force compression.: "
  [ "foo$FORCE_OPT" = "foo-F" ] && echo "yes" || echo "no"
  echo "man.conf is.......: ${MAN_CONF}/man.conf"
  echo -n "Hard-links........: "
  [ "foo$LN_OPT" = "foo-S" ] && echo "convert to soft-links" || echo "leave as is"
  echo -n "Soft-links........: "
  [ "foo$LN_OPT" = "foo-H" ] && echo "convert to hard-links" || echo "leave as is"
  echo "Backup............: $BACKUP"
  echo "Faking (yes!).....: $FAKE"
  echo "Directories.......: $MAN_DIR"
  echo "Verbosity level...: $VERBOSE_LVL"
  exit 0
fi

# If no method was specified, print help
if [ -z "${COMP_METHOD}" -a "${BACKUP}" = "no" ]; then
  help
  exit 1
fi

# In backup mode, do the backup solely
if [ "$BACKUP" = "yes" ]; then
  for DIR in $MAN_DIR; do
    cd "${DIR}/.."
    DIR_NAME=`basename "${DIR}"`
    echo "Backing up $DIR..." > $DEST_FD0
    [ -f "${DIR_NAME}.tar.old" ] && rm -f "${DIR_NAME}.tar.old"
    [ -f "${DIR_NAME}.tar" ] && mv "${DIR_NAME}.tar" "${DIR_NAME}.tar.old"
    tar cfv "${DIR_NAME}.tar" "${DIR_NAME}" > $DEST_FD1
  done
  exit 0
fi

# I know MAN_DIR has only absolute path names
# I need to take into account the localized man, so I'm going recursive
for DIR in $MAN_DIR; do
  MEM_DIR=`pwd`
  cd "$DIR"
  for FILE in *; do
    # Fixes the case were the directory is empty
    if [ "foo$FILE" = "foo*" ]; then continue; fi

    # Fixes the case when hard-links see their compression scheme change
    # (from not compressed to compressed, or from bz2 to gz, or from gz to bz2)
    # Also fixes the case when multiple version of the page are present, which
    # are either compressed or not.
    if [ ! -L "$FILE" -a ! -e "$FILE" ]; then continue; fi

    if [ -d "$FILE" ]; then
      cd "${MEM_DIR}"  # Go back to where we ran "$0", in case "$0"=="./compressdoc" ...
      # We are going recursive to that directory
      echo "-> Entering ${DIR}/${FILE}..." > $DEST_FD0
      # I need not pass --conf, as I specify the directory to work on
      # But I need exit in case of error
      "$0" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
      echo "<- Leaving ${DIR}/${FILE}." > $DEST_FD1
      cd "$DIR"  # Needed for the next iteration of the loop

    else # !dir
      if ! check_unique "$DIR" "$FILE"; then continue; fi

      # Check if the file is already compressed with the specified method
      BASE_FILE=`basename \`basename "$FILE" .bz2\` .gz`
      if [ "${FILE}" = "${BASE_FILE}${COMP_SUF}" -a "foo${FORCE_OPT}" = "foo" ]; then continue; fi

      # If we have a symlink
      if [ -h "$FILE" ]; then
        case $FILE in
          *.bz2)
            EXT=bz2 ;;
          *.gz)
            EXT=gz ;;
          *)
            EXT=none ;;
        esac

        if [ ! "$EXT" = "none" ]; then
          LINK=`ls -l $FILE | cut -d ">" -f2 | tr -d " " | sed s/\.$EXT$//`
          NEWNAME=`echo "$FILE" | sed s/\.$EXT$//`
          mv "$FILE" "$NEWNAME"
          FILE="$NEWNAME"
        else
          LINK=`ls -l $FILE | cut -d ">" -f2 | tr -d " "`
        fi

        if [ "$LN_OPT" = "-H" ]; then
          # Change this soft-link into a hard- one
          rm -f "$FILE" && ln "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
          chmod --reference "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
        else
          # Keep this soft-link a soft- one.
          rm -f "$FILE" && ln -s "${LINK}$COMP_SUF" "${FILE}$COMP_SUF"
        fi
        echo "Relinked $FILE" > $DEST_FD1

      # else if we have a plain file
      elif [ -f "$FILE" ]; then
        # Take care of hard-links: build the list of files hard-linked
        # to the one we are {de,}compressing.
        # NB. This is not optimum has the file will eventually be compressed
        # as many times it has hard-links. But for now, that's the safe way.
        inode=`ls -li "$FILE" | awk '{print $1}'`
        HLINKS=`find . \! -name "$FILE" -inum $inode`

        if [ -n "$HLINKS" ]; then
          # We have hard-links! Remove them now.
          for i in $HLINKS; do rm -f "$i"; done
        fi

        # Now take care of the file that has no hard-link
        # We do decompress first to re-compress with the selected
        # compression ratio later on...
        case $FILE in
          *.bz2)
            bunzip2 $FILE
            FILE=`basename "$FILE" .bz2`
          ;;
          *.gz)
            gunzip $FILE
            FILE=`basename "$FILE" .gz`
          ;;
        esac

        # Compress the file with the given compression ratio, if needed
        case $COMP_SUF in
          *bz2)
            bzip2 ${COMP_LVL} "$FILE" && chmod 644 "${FILE}${COMP_SUF}"
            echo "Compressed $FILE" > $DEST_FD1
            ;;
          *gz)
            gzip ${COMP_LVL} "$FILE" && chmod 644 "${FILE}${COMP_SUF}"
            echo "Compressed $FILE" > $DEST_FD1
            ;;
          *)
            echo "Uncompressed $FILE" > $DEST_FD1
            ;;
        esac

        # If the file had hard-links, recreate those (either hard or soft)
        if [ -n "$HLINKS" ]; then
          for i in $HLINKS; do
            NEWFILE=`echo $i | sed s/\.gz$// | sed s/\.bz2$//`
            if [ "$LN_OPT" = "-S" ]; then
              # Make this hard-link a soft- one
              ln -s "${FILE}$COMP_SUF" "${NEWFILE}$COMP_SUF"
            else
              # Keep the hard-link a hard- one
              ln "${FILE}$COMP_SUF" "${NEWFILE}$COMP_SUF"
            fi
            chmod 644 "${NEWFILE}$COMP_SUF" # Really work only for hard-links. Harmless for soft-links
          done
        fi

      else
        # There is a problem when we get neither a symlink nor a plain file
        # Obviously, we shall never ever come here... :-(
        echo "Whaooo... \"${DIR}/${FILE}\" is neither a symlink nor a plain file. Please check:"
        ls -l ${DIR}/${FILE}
        exit 1
      fi
    fi
  done # for FILE
done # for DIR
EOF
chmod 755 /usr/bin/compressdoc

Now, as root, you can issue a /usr/bin/compressdoc --bz2 to compress all your system man pages. You can also run /usr/bin/compressdoc --help to get a comprehensive help about what the script is able to do.

Don't forget that a few programs, like the X Window system, XEmacs, also install their documentation in non standard places (such as /usr/X11R6/man, etc...). Don't forget to add those locations in the file /etc/man.conf, as a MANPATH=/path section.

Example:

    ...
    MANPATH=/usr/share/man
    MANPATH=/usr/local/man
    MANPATH=/usr/X11R6/man
    MANPATH=/opt/qt/doc/man
    ...

Generally, package installation systems do not compress man/info pages, which means you will need to run the script again if you want to keep the size of your documentation as small as possible. Also, note that running the script after upgrading a package is safe: when you have several versions of a page (for example, one compressed and one uncompressed), the most recent one is kept and the others deleted.


Chapter 4. Security

Security takes many forms in a computing environment. This chapter gives examples of three different types of security: access, prevention and detection.

Access for users is usually handled by login or an application designed to handle the login function. In this chapter, we show how to enhance login by setting policies with PAM modules. Access via networks can also be secured by policies set by iptables, commonly referred to as a firewall.

Prevention of breaches, like a trojan, are assisted by applications like GnuPG, specifically the ability to confirm signed packages, which prevents modification of the TAR ball after the packager creates it.

Finally, we touch on detection with a package that stores "signatures" of critical files (defined by the administrator) and then regenerates those "signatures" and compares for files that have been changed.


Linux-PAM-0.77

Introduction to Linux-PAM

The Linux-PAM package contains Pluggable Authentication Modules. This is useful to enable the local system administrator to choose how applications authenticate users.


Package information


Linux-PAM dependencies


Installation of Linux-PAM

Install Linux-PAM by running the following commands:

patch -Np1 -i ../Linux-PAM-0.77-linkage-1.patch &&
./configure --enable-static-libpam --with-mailspool=/var/mail \
--enable-read-both-confs --sysconfdir=/etc &&
make &&
make install &&
mv /lib/libpam.a /lib/libpam_misc.a /lib/libpamc.a /usr/lib &&
ln -sf ../../lib/libpam.so.0.77 /usr/lib/libpam.so &&
ln -sf ../../lib/libpam_misc.so.0.77 /usr/lib/libpam_misc.so &&
ln -sf ../../lib/libpamc.so.0.77 /usr/lib/libpamc.so

Command explanations

--enable-static-libpam: This switch builds static PAM libraries as well as the dynamic libraries.

--with-mailspool=/var/mail: This switch makes the mailspool directory FHS compliant.

--enable-read-both-confs: This switch lets the local administrator choose which configuration file setup to use.

mv /lib/libpam.a /lib/libpam_misc.a /lib/libpamc.a /usr/lib: This command moves the static libraries to /usr/lib to comply with FHS.


Configuring Linux-PAM

Config files

/etc/pam.d or /etc/pam.conf


Configuration Information

Configuration information is placed in /etc/pam.d or /etc/pam.conf depending on the application that is using PAM. Below are example files of each type:

# Begin /etc/pam.d/other

auth            required        pam_unix.so     nullok
account         required        pam_unix.so
session         required        pam_unix.so
password        required        pam_unix.so     nullok

# End /etc/pam.d/other

# Begin /etc/pam.conf

other           auth            required        pam_unix.so     nullok
other           account         required        pam_unix.so
other           session         required        pam_unix.so
other           password        required        pam_unix.so     nullok

# End /etc/pam.conf

The PAM man page (man pam) provides a good starting point for descriptions of fields and allowable entries. The Linux-PAM guide for system administrators is recommended for further reading.


Contents

The Linux-PAM package contains unix-chkpwd and libpam libraries.


Description

unix-chkpwd

No description available.


libpam libraries

libpam libraries provide the interfaces between applications and the modules included with PAM.


Shadow-4.0.3

Introduction to Shadow

Shadow was indeed installed in LFS and there is no reason to reinstall it unless you installed Linux-PAM. If you did, this will allow programs like login and su to utilize PAM.


Shadow dependencies


Installation of shadow

Download the patch for shadow from http://www.linuxfromscratch.org/patches/blfs/5.0.

Reinstall shadow by running the following commands:

patch -Np1 -i ../shadow-4.0.3-pam-2.patch &&
./configure --prefix=/usr --libdir=/usr/lib \
--enable-shared --with-libpam &&
make &&
make install &&
ln -sf vipw /usr/sbin/vigr &&
rm /bin/vipw &&
mv /bin/sg /usr/bin &&
mv /usr/lib/lib{misc,shadow}.so.0* /lib &&
ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so &&
ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so &&
cp debian/securetty /etc/securetty

Command explanations

cp debian/securetty /etc/securetty: This command sets the tty's that allow logins through PAM.


Configuring PAM to work with shadow

Config files

/etc/pam.d/login, /etc/pam.d/passwd, /etc/pam.d/su, /etc/pam.d/shadow, /etc/pam.d/useradd


Configuration Information

Add the following PAM configuration files to /etc/pam.d (or add them to /etc/pam.conf with the additional field for the program).

cat > /etc/pam.d/login << "EOF"
# Begin /etc/pam.d/login

auth        requisite      pam_securetty.so
auth        requisite      pam_nologin.so
auth        required       pam_env.so
auth        required       pam_unix.so
account     required       pam_access.so
account     required       pam_unix.so
session     required       pam_motd.so
session     required       pam_limits.so
session     optional       pam_mail.so     dir=/var/mail standard
session     optional       pam_lastlog.so
session     required       pam_unix.so

# End /etc/pam.d/login
EOF
cat > /etc/pam.d/passwd << "EOF"
# Begin /etc/pam.d/passwd

password    required       pam_unix.so     md5 shadow 

# End /etc/pam.d/passwd
EOF
cat > /etc/pam.d/shadow << "EOF"
# Begin /etc/pam.d/shadow

auth        sufficient      pam_rootok.so
auth        required        pam_unix.so
account     required        pam_unix.so
session     required        pam_unix.so
password    required        pam_permit.so

# End /etc/pam.d/shadow
EOF
cat > /etc/pam.d/su << "EOF"
# Begin /etc/pam.d/su

auth        sufficient      pam_rootok.so
auth        required        pam_unix.so
account     required        pam_unix.so
session     required        pam_unix.so

# End /etc/pam.d/su
EOF
cat > /etc/pam.d/useradd << "EOF"
# Begin /etc/pam.d/useradd

auth        sufficient      pam_rootok.so
auth        required        pam_unix.so
account     required        pam_unix.so
session     required        pam_unix.so
password    required        pam_permit.so

# End /etc/pam.d/useradd
EOF
cat > /etc/pam.d/chage << "EOF"
# Begin /etc/pam.d/chage

auth        sufficient      pam_rootok.so
auth        required        pam_unix.so
account     required        pam_unix.so
session     required        pam_unix.so
password    required        pam_permit.so

# End /etc/pam.d/chage
EOF

Currently, /etc/pam.d/other is configured to allow anyone with an account on the machine to use programs that do not specifically have a configuration file of their own. After testing PAM for proper configuration, it can be changed to the following:

cat > /etc/pam.d/other << "EOF"
# Begin /etc/pam.d/other

auth        required        pam_deny.so
auth        required        pam_warn.so
account     required        pam_deny.so
session     required        pam_deny.so
password    required        pam_deny.so
password    required        pam_warn.so

# End /etc/pam.d/other
EOF

Finally, edit /etc/login.defs by adding '#' to the beginning of the following lines:

DIALUPS_CHECK_ENAB
LASTLOG_ENAB
MAIL_CHECK_ENAB
PORTTIME_CHECKS_ENAB
CONSOLE
MOTD_FILE
NOLOGINS_FILE
PASS_MIN_LEN
SU_WHEEL_ONLY
MD5_CRYPT_ENAB
CONSOLE_GROUPS
ENVIRON_FILE

This stops login from performing these functions, as they will now be performed by PAM modules.


iptables-1.2.8

The next part of this chapter deals with firewalls. The principle firewall tool for Linux, as of the 2.4 kernel series, is iptables. It replaces ipchains from the 2.2 series and ipfwadm from the 2.0 series. You will need to install iptables if you intend on using any form of a firewall.


Introduction to iptables

To use a firewall, as well as installing iptables, you will need to configure the relevant options into your kernel. This is discussed in the next part of this chapter - getting a firewalling-enabled Kernel.

If you intend to use IPv6 you might consider extending the kernel by running make patch-o-matic in the top-level directory of the sources of iptables. If you are going to do this, on a freshly untarred kernel, you need to run yes "" | make config && make dep first because otherwise the patch-o-matic command is likely to fail while setting up some dependencies.

If you are going to patch the kernel, you need to do it before you compile iptables, because during the compilation, the kernel source tree is checked (if it is available at /usr/src/linux-[version] to see which features are available. Support will only be compiled into iptables for the features recognized at compile-time. Applying a kernel patch may result in errors, often because the hooks for the patches have changed or because the runme script doesn't recognize that a patch has already been incorporated.

Note that for most people, patching the kernel is unnecessary. With the later 2.4.x kernels, most functionality is already available and those who need to patch it are generally those who need a specific feature; if you don't know why you need to patch the kernel, you're unlikely to need to!


Package information


Installation of iptables

Install iptables by running the following commands:

make PREFIX=/usr &&
make PREFIX=/usr install

Command explanations

PREFIX=/usr: Compiles and installs iptables into the /usr hierarchy instead of /usr/local.


Contents

The iptables-package contains iptables, ip6tables and some libraries.


Description

iptables

iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel.


iptables-save, ~-restore

These are used to save and to restore your elaborated set of chains and rules. Until iptables-1.2.5, they were declared experimental.


ip6tables

This is the same as iptables but for use with IPv6. As of v1.2.5, it is not as complete as the standard IPv4 version, especially with regard to some of the modules.


libip*.so

These are various modules (implemented as dynamic libraries) which extend the core functionality of iptables.


Setting up a network firewall

Before you read this part of the chapter, note that we assume that you have already installed iptables as described in the previous section.


Introduction to Firewall Creation

The general purpose of a firewall is to protect a network against malicious access by using a single machine as a firewall. This does imply that the firewall is to be considered a single point of failure, but it can make the administrators life a lot easier.

In a perfect world where you knew that every daemon or service on every machine was perfectly configured and was immune to, e.g., buffer-overflows and any other imaginable problem regarding its security, and where you trusted every user accessing your services to aim no harm, you wouldn't need to do have a firewall! In the real world however, daemons may be misconfigured, exploits against essential services are freely available, you may wish to choose which services are accessible by certain machines, you may wish to limit which machines or applications are allowed to have Internet access, or you may simply not trust some of your apps or users. In these situations you might benefit by using a firewall.

Don't assume however, that having a firewall makes careful configuration redundant, nor that it makes any negligent misconfiguration harmless, nor that it prevents anyone from exploiting a service you intentionally offer but haven't recently updated or patched after an exploit went public. Despite having a firewall, you need to keep applications and daemons on your system well-configured and up-to-date; a firewall is not a cure-all!


Meaning of the word firewall.

The word firewall can have several different meanings.


Personal Firewall

This is a setup or program, for Windows commercially sold by companies such as Symantec, of which they claim or pretend that it secures a home or desktop-pc with Internet access. This topic is highly relevant for users who do not know the ways their computers might be accessed via the Internet and how to disable these, especially if they are always online and if they are connected via broadband links.


Masquerading Router

This is a box placed between the Internet and an intranet. To minimize the risk of compromising the firewall itself it should generally have only one role, that of protecting the intranet. Although not completely risk free, the tasks of doing the routing and eventually IP masquerading (rewriting IP-headers of the packets it routes from clients with private IP-addresses onto the Internet so that they seem to come from the firewall itself) are commonly considered harmless.


BusyBox

This is often an old box you may have retired and nearly forgotten, performing masquerading or routing functions, but offering a bunch of services, e.g., web-cache, mail, etc. This may be very commonly used for home networks, but can definitely not to be considered as secure anymore because the combining of server and router on one machine raises the complexity of the setup.


Firewall with a demilitarized zone [not further described here]

This box performs masquerading or routing, but grants public access to some branch of your network which, because of public IP's and a physically separated structure, is neither considered to be part of the inter- nor intranet. These servers are those which must be easily accessible from both the inter- and intranet. The firewall protects them all.


Packetfilter / partly accessible net [partly described here, see BusyBox]

Doing routing or masquerading, but permitting only selected services to be accessible, sometimes only by selected internal users or boxes; mostly used in highly secure business contexts, sometimes by distrusting employers. This was the common configuration of a firewall at the time of the Linux 2.2 kernel. It's still possible to configure a firewall this way, but it makes the rules quite complex and lengthy.


Disclaimer

This document is meant as an introduction to how to setup a firewall - it is not a complete guide to securing systems. Firewalling is a complex issue that requires careful configuration. The scripts quoted here are simply intended to give examples as to how a firewall works, they are not intended to fit into any imaginable configuration and may not prevent any imaginable attack.

The purpose of this text is simply to give you a hint on how to get started with a firewall.

Customization of these scripts for your specific situation will be necessary for an optimal configuration, but you should make a serious study of the iptables documentation and creating firewalls in general before hacking away. Have a look at the list of Links for further reading at the end of this section for more details. Here you will find a list of URLs that contain quite comprehensive information about building your own firewall.


Getting a firewall enabled Kernel

If you want your Linux-Box to have a firewall, you must first ensure that your kernel has been compiled with the relevant options turned on .

How to configure your kernel, with enabling the options to be either compiled into the kernel or as modules, depends on your personal preferences and experience. Note, that for the quoted scripts it is assumed that the modules need to be loaded at first.

Network options menu
  Network packet filtering:                         Y
  Unix domain sockets:                         Y or M
  TCP/IP networking:                                Y
  IP: advanced router:                              Y
  IP: verbose route monitoring:                     Y
  IP: TCP Explicit Congestion Notification support: Y
  IP: TCP syncookie support:                        Y
  IP: Netfilter Configuration menu
    Every option except:                       Y or M
      ipchains (2.2-style) support                  N
      ipfwadm (2.0-style) support                   N
  Fast switching:                                   N

Now you can start to build your Firewall

Personal Firewall

A Personal Firewall is supposed to let you access the all services offered on the Internet, but keep your box secure and your data private.

Below is a slightly modified version of Rusty Russell's recommendation from the Linux 2.4 Packet Filtering HOWTO:

cat > /etc/rc.d/init.d/firewall << "EOF"
#!/bin/sh

# Begin $rc_base/init.d/firewall

# Insert connection-tracking modules (not needed if built into the kernel).
modprobe ip_tables
modprobe iptable_filter
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ipt_state
modprobe ipt_LOG

# allow local-only connections
iptables -A INPUT  -i lo -j ACCEPT
# free output on any interface to any ip for any service (equal to -P ACCEPT)
iptables -A OUTPUT -j ACCEPT

# permit answers on already established connections
# and permit new connections related to established ones (eg active-ftp)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Log everything else:  What's Windows' latest exploitable vulnerability?
iptables -A INPUT -j LOG --log-prefix "FIREWALL:INPUT "

# set a sane policy:    everything not accepted > /dev/null
iptables -P INPUT    DROP
iptables -P FORWARD  DROP
iptables -P OUTPUT   DROP

# be verbose on dynamic ip-addresses     (not needed in case of static IP)
echo 2 > /proc/sys/net/ipv4/ip_dynaddr

# disable ExplicitCongestionNotification - too many routers are still ignorant
echo 0 > /proc/sys/net/ipv4/tcp_ecn

# End $rc_base/init.d/firewall
EOF

His script is quite simple, it drops all traffic coming in into your computer that wasn't initiated from your box, but as long as you are simply surfing the Internet you are unlikely to exceed its limits.

If you frequently encounter certain delays at accessing ftp-servers, please have a look at BusyBox - example no. 4.

Even if you have daemons / services running on your box, these should be inaccessible everywhere but from your box itself. If you want to allow access to services on your machine, such as ssh or pinging, take a look at BusyBox.


Masquerading Router

A true Firewall has two interfaces, one connected to an intranet, in this example, eth0, and one connected to the Internet, here, ppp0. To provide the maximum security against the box itself being broken into, make sure that there are no servers running on it, especially not X11 et al. And, as a general principle, the box itself should not access any untrusted service (Think of a name server giving answers that make your bind crash, or, even worse, that implement a worm via a buffer-overflow).

cat > /etc/rc.d/init.d/firewall << "EOF"
#!/bin/sh

# Begin $rc_base/init.d/firewall

echo
echo "You're using the example-config for a setup of a firewall"
echo "from the firewalling-hint written for LinuxFromScratch."
echo "This example is far from being complete, it is only meant"
echo "to be a reference."
echo "Firewall security is a complex issue, that exceeds the scope"
echo "of the quoted configuration rules."
echo "You can find some quite comprehensive information"
echo "about firewalls in Chapter 4 of the BLFS book."
echo "http://www.linuxfromscratch.org/blfs"
echo

# Insert iptables modules (not needed if built into the kernel).

modprobe ip_tables
modprobe iptable_filter
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ipt_state
modprobe iptable_nat
modprobe ip_nat_ftp
modprobe ipt_MASQUERADE
modprobe ipt_LOG
modprobe ipt_REJECT

# allow local-only connections
iptables -A INPUT  -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# allow forwarding
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state NEW -i ! ppp+	 -j ACCEPT

# do masquerading    (not needed if intranet is not using private ip-addresses)
iptables -t nat -A POSTROUTING -o ppp+ -j MASQUERADE

# Log everything for debugging (last of all rules, but before DROP/REJECT)
iptables -A INPUT   -j LOG --log-prefix "FIREWALL:INPUT  "
iptables -A FORWARD -j LOG --log-prefix "FIREWALL:FORWARD"
iptables -A OUTPUT  -j LOG --log-prefix "FIREWALL:OUTPUT "

# set a sane policy
iptables -P INPUT   DROP
iptables -P FORWARD DROP
iptables -P OUTPUT  DROP

# be verbose on dynamic ip-addresses (not needed in case of static IP)
echo 2 > /proc/sys/net/ipv4/ip_dynaddr

# disable ExplicitCongestionNotification
echo 0 > /proc/sys/net/ipv4/tcp_ecn

# activate TCPsyncookies
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

# activate Route-Verification = IP-Spoofing_protection
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
	echo 1 > $f
done

# activate IP-Forwarding 
echo 1 > /proc/sys/net/ipv4/ip_forward
EOF

With this script your intranet should be sufficiently secure against external attacks: no one should be able to setup a new connection to any internal service and, if it's masqueraded, it s even invisible; furthermore, your firewall should be nearly immune because there are no services running that a cracker could attack.

Note: if the interface you're connecting to the Internet doesn't connect via ppp, you will need to change ppp+ to the name of the interface which you are using. If you are using the same interface type to connect to both your intranet and the Internet, you need to use the actual name of the interface such as eth0, on both interfaces.

If you need stronger security (e.g., against DOS, connection highjacking, spoofing, etc.) have a look at the list of Links for further reading at the end of this section.


BusyBox

This scenario isn't too different from (Masquerading Router), but in this case you want to offer some services to your intranet. Examples of this can be when you want to admin your box from another host on your intranet or use it as a proxy or a name server. Note: Outlining a true concept of how to protect a server that offers services on the Internet goes far beyond the scope of this document, see Disclaimer.

Be cautious. Every service you offer and have enabled makes your setup more complex and your box less secure: You induce the risks of misconfigured services or running a service with an exploitable bug, both risks that a firewall principally should be immune of. See the introduction to Masquerading Router for some more details.

If the services you'd like to offer do not need to access the Internet themselves, like internal-only samba- or name-servers, it's quite simple and should still be acceptable from a security standpoint. Just add the following lines before the logging-rules into the script.
iptables -A INPUT  -i ! ppp+  -j ACCEPT
iptables -A OUTPUT -o ! ppp+  -j ACCEPT

If your daemons have to access the web themselves, like squid would need to, you could open OUTPUT generally and restrict INPUT.
iptables -A INPUT -m state --state ESTABLISHED,RELATED	-j ACCEPT
iptables -A OUTPUT                                      -j ACCEPT

However, it is generally not advisable to leave OUTPUT unrestricted: you lose any control on trojans who'd like to "call home", and a bit of redundancy in case you've (mis-)configured a service so that it does broadcast its existence to the world.

If you prefer to have this protection, you may restrict INPUT and OUTPUT on all ports except those that it's absolutely necessary to have open. Which ports you have to open depends on your needs: mostly you will find them by looking for failed accesses in your log-files.

Have a look at the following examples:

  • Squid is caching the web:
    iptables -A OUTPUT -p tcp --dport 80                              -j ACCEPT
    iptables -A INPUT  -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT

  • Your caching name server (e.g., dnscache) does its lookups via udp:
    iptables -A OUTPUT -p udp --dport 53                              -j ACCEPT
    iptables -A INPUT  -p udp --sport 53 -m state --state ESTABLISHED -j ACCEPT

  • Alternatively, if you want to be able to ping your box to ensure it's still alive:
    iptables -A INPUT  -p icmp -m icmp --icmp-type echo-request -j ACCEPT
    iptables -A OUTPUT -p icmp -m icmp --icmp-type echo-reply   -j ACCEPT

  • If you are frequently accessing ftp-servers or enjoy chatting you might notice certain delays because some implementations of these daemons have the feature of querying an identd on your box for your username for logging. Although there's really no harm in this, having an identd running is not recommended because some implementations are known to be vulnerable.

    To avoid these delays you could reject the requests with a 'tcp-reset':
    iptables -A INPUT  -p tcp --dport 113 -j REJECT --reject-with tcp-reset
    iptables -A OUTPUT -p tcp --sport 113 -m state --state RELATED -j ACCEPT

  • To log and drop invalid packets, mostly harmless packets that came in after netfilter's timeout, sometimes scans:
    iptables -I INPUT 1 -p tcp -m state --state INVALID -j LOG --log-prefix \ 
    "FIREWALL:INVALID"
    iptables -I INPUT 2 -p tcp -m state --state INVALID -j DROP

  • Anything coming from the outside should not have a private address, this is a common attack called IP-spoofing:
    iptables -t nat -A PREROUTING -i ppp+ -s 10.0.0.0/8     -j DROP
    iptables -t nat -A PREROUTING -i ppp+ -s 172.16.0.0/12	-j DROP
    iptables -t nat -A PREROUTING -i ppp+ -s 192.168.0.0/16	-j DROP

  • To simplify debugging and be fair to anyone who'd like to access a service you have disabled, purposely or by mistake, you should REJECT those packets that are dropped.

    Obviously this must be done directly after logging as the very last lines before the packets are dropped by policy:
    iptables -A INPUT                        -j REJECT
    iptables -A OUTPUT -p icmp --icmp-type 3 -j ACCEPT

These are only examples to show you some of the capabilities of the new firewall code in Linux-Kernel 2.4. Have a look at the man page of iptables. There you will find more of them. The port-numbers you'll need for this can be found in /etc/services, in case you didn't find them by trial and error in your log file.

If you add any of your offered or accessed services such as the above, maybe even in FORWARD and for intranet-communication, and delete the general clauses, you get an old fashioned packet filter.


Conclusion

Finally, I'd like to remind you of one fact we must not forget: The effort spent attacking a system corresponds to the value the cracker expects to gain from it. If you are responsible for such valuable assets that you expect great effort to be made by potential crackers, you hopefully won't be in the need of this hint!


Extra Information


firewall.status

If you'd like to have a look at the chains your firewall consists of and the order in which the rules take effect:

cat > /etc/rc.d/init.d/firewall.status << "EOF"
#!/bin/sh

# Begin $rc_base/init.d/firewall.status

echo "iptables.mangling:"
iptables -t mangle  -v -L -n --line-numbers

echo
echo "iptables.nat:"
iptables -t nat	    -v -L -n --line-numbers

echo
echo "iptables.filter:"
iptables	    -v -L -n --line-numbers
EOF

firewall.stop

If you need to turn the firewall off, this script will do it:

cat > /etc/rc.d/init.d/firewall.stop << "EOF"
#!/bin/sh

# Being $rc_base/init.d/firewall.stop

# deactivate IP-Forwarding 
echo 0 > /proc/sys/net/ipv4/ip_forward

iptables -Z
iptables -F
iptables -t nat         -F PREROUTING
iptables -t nat         -F OUTPUT
iptables -t nat         -F POSTROUTING
iptables -t mangle      -F PREROUTING
iptables -t mangle      -F OUTPUT
iptables -X
iptables -P INPUT       ACCEPT
iptables -P FORWARD     ACCEPT
iptables -P OUTPUT      ACCEPT
EOF

GnuPG-1.2.3

Introduction to GnuPG

The GnuPG package contains a public/private key encryptor. This is becoming useful for signing files or emails as proof of identity and preventing tampering with contents of the file or email.


Package information


Installation of GnuPG

Install GnuPG by running the following commands:

./configure --prefix=/usr --libexecdir=/usr/lib &&
make &&
make install &&
chmod 4755 /usr/bin/gpg

Command explanations

--libexecdir=/usr/lib: This command creates a gnupg directory in /usr/sbin instead of /usr/libexec.


Contents

The GnuPG package contains gpg, gpgsplit and gpgv


Description

gpg

gpg is the backend (command-line interface) for this OpenPGP implementation.


gpgsplit

gpgsplit separates key rings.


gpgv

gpgv is a verify only version of gpg.


Tripwire-2.3.1-2

Introduction to Tripwire

The Tripwire package contains the programs used by Tripwire to verify the integrity of the files on a given system.


Package information


Additional downloads


Installation of Tripwire

Compile Tripwire by running the following commands:

patch -Np1 -i ../tripwire-2.3.1-2-gcc3-build-fixes.patch &&
cd src &&
make release &&
cd .. &&
cp install/install.{sh,cfg} .

Install Tripwire by running the following commands:

./install.sh &&
cp /etc/tripwire/tw.cfg /usr/sbin &&
cp policy/*.txt /usr/share/doc/tripwire

Command explanations

make release: This command creates the Tripwire binaries.

cp install.{sh,cfg} .: These are copied to the main Tripwire directory so that the script can be used to install the package.

cp policy/*.txt /usr/share/doc/tripwire: This command installs the documentation.


Configuring Tripwire

Config files

/etc/tripwire


Configuration Information

Tripwire uses a policy file to determine which files integrity are checked. The default policy file (twpol.txt found in /etc/tripwire/) is for a default installation of Redhat 7.0 and is woefully outdated.

Policy files are also a custom thing and should be tailored to each individual distribution and/or installation. Some custom policy files can be found below:

http://home.iprimus.com.au/glombowski/blfs/twpol-all.txt
Checks integrity of all files
http://home.iprimus.com.au/glombowski/blfs/twpol-lfs.txt
Custom policy file for Base LFS 3.0 system
http://home.iprimus.com.au/glombowski/blfs/twpol-suse7.2.txt
Custom policy file for SuSE 7.2 system

Download the custom policy file you'd like to try, copy it into /etc/tripwire/, and use it instead of twpol.txt. It is, however, recommended that you make your own policy file. Get ideas from the examples above and read /usr/share/doc/tripwire/policyguide.txt. twpol.txt is a good policy file for beginners as it will note any changes to the file system and can even be used as an annoying way of keeping track of changes for uninstallation of software.

After your policy file has been transferred to /etc/tripwire/ you may begin the configuration steps:

twadmin -m P /etc/tripwire/twpol.txt &&
tripwire -m i

During configuration Tripwire will create two (2) keys: a site key and a local key which will be stored in /etc/tripwire/ .


Usage Information

To use Tripwire after this and run a report, use the following command:

tripwire -m c > /etc/tripwire/report.txt

View the output to check the integrity of your files. An automatic integrity report can be produced by using a cron facility to schedule the runs.

Please note that after you run an integrity check, you must check the report or email and then modify the Tripwire database of the files on your system so that Tripwire will not continually notify you that files you intentionally changed are a security violation. To do this you must first ls /var/lib/tripwire/report/ and note the name of the newest file which starts with linux- and ends in .twr. This encrypted file was created during the last report creation and is needed to update the Tripwire database of your system. Then, type in the following command making the appropriate substitutions for '?':

tripwire -m u -r /var/lib/tripwire/report/linux-???????-??????.twr 

You will be placed into vim with a copy of the report in front of you. If all the changes were good, then just type :x and after entering your local key, the database will be updated. If there are files which you still want to be warned about, please remove the x before the filename in the report and type :x.


Changing the Policy File

If you are unhappy with your policy file and would like to modify it or use a new one, modify the policy file and then execute the following commands:

twadmin -m P /etc/tripwire/twpol.txt &&
tripwire -m i

Contents

The Tripwire package contains siggen , tripwire, twadmin and twprint.


Chapter 5. File Systems

Journaling file systems reduce the time needed to recover a file system that was not unmounted properly. While this can be extremely important in reducing downtime for servers, it has also become popular for desktop environments. This chapter contains a variety of journaling file systems.


Ext3

Ext3 is a journaling file system that is an extension to the ext2 file system. It is backward compatible with ext2 and the conversion from ext2 to ext3 is trivial.

You don't need to install anything to use ext3, all the required packages are available with a bare LFS system.

When building the kernel, ensure that you have compiled in ext3 support. If you want your root partition to be ext3, then compile the ext3 support in the kernel, else you may compile it as a module. Recompile the kernel if needed.

Edit your /etc/fstab. For each partition that you want to convert into ext3, edit the entry so that it looks similar to the following line.

/dev/hdXX /mnt_point ext3 defaults 1 0

In the above line, replace /dev/hdXX by the partition (e.g. /dev/hda2), /mnt_point by the mount point (e.g. /home). The 0 in the last field ensures that the partition will not be checked for consistency during the boot process by the checkfs script. You may replace the ext3 fs type in the above by auto if you want to ensure that the partition is mounted if you accidentally skip enabling the ext3 support in the kernel.

For each partition that you have converted to ext3 in /etc/fstab, enable the journal for the partition by running the following command.

tune2fs -j /dev/hdXX

Remount the concerned partitions, or simply reboot if you have recompiled the kernel to enable ext3 support.

More information is available at http://www.zip.com.au/~akpm/linux/ext3/ext3-usage.html


ReiserFS-3.6.11

Introduction to ReiserFS

The ReiserFS package contains various utilities for use with the Reiser file system.


Package information


Installation of ReiserFS

Install ReiserFS by running the following commands:

./configure --prefix=/usr --sbindir=/sbin &&
make &&
make install &&
ln -sf reiserfsck /sbin/fsck.reiserfs &&
ln -sf mkreiserfs /sbin/mkfs.reiserfs

Command explanations

--prefix=/usr: This ensures that the manual pages are installed in the correct location while still installing the programs in /sbin as they should be.

--sbindir=/sbin: This ensures that the ReiserFS utilities are installed in /sbin as they should be.


Contents

ReiserFS contains debugreiserfs, mkreiserfs, reiserfsck, resize_reiserfs and unpack.


Description

debugreiserfs

debugreiserfs can sometimes help to solve problems with ReiserFS file systems. If it is called without options it prints the super block of any reiserfs file system found on the device.


mkreiserfs

mkreiserfs creates a ReiserFS file system.


reiserfsck

reiserfsck checks a ReiserFS file system.


reiserfstune

reiserfstune is used for tuning the ReiserFS journal. WARNING: Don't use this utility without first reading the man page thoroughly.


resize_reiserfs

resize_reiserfs is used to resize an unmounted ReiserFS file system.


unpack

The unpack utility can be used to dump ReiserFS file system information to files for debugging, much like debugreiserfs.


XFS-2.5.6

XFS kernel patch

The XFS kernel patch must be applied to use XFS file systems.


Package information


Patching Linux-2.4.22 for XFS

Build an XFS enabled Linux 2.4.22 kernel with the following commands:

cd /usr/src/linux &&
make mrproper &&
bzcat ../xfs-2.4.22-all-i386.bz2 | patch -Np1 &&
make menuconfig &&
make CC=/opt/gcc-2.95.3/bin/gcc dep &&
make CC=/opt/gcc-2.95.3/bin/gcc bzImage &&
make CC=/opt/gcc-2.95.3/bin/gcc modules &&
make CC=/opt/gcc-2.95.3/bin/gcc modules_install &&
cp arch/i386/boot/bzImage /boot/vmlinuz-xfs &&
cp System.map /boot/System.map-xfs

Introduction to XFS

The XFS package contains administration and debugging tools for the XFS file system.


Package information


Installation of XFS

Install XFS by running the following commands:

./configure &&
make &&
make install

Contents

XFS contains xfs_growfs, xfs_admin, xfs_freeze, xfs_mkfile, xfs_check, xfs_bmap, xfs_rtcp, xfs_repair, xfs_db, xfs_logprint, xfs_ncheck, mkfs.xfs and fsck.xfs.


Description

xfsgrowfs

xfsgrowfs expands an XFS file system.


xfs_admin

xfs_admin changes the parameters of an XFS file system.


xfs_freeze

xfs_freeze suspends access to an XFS file system.


xfs_mkfile

xfs_mkfile creates an XFS file, padded with zeroes by default.


xfs_check

xfs_check checks XFS file system consistency.


xfs_bmap

xfs_bmap prints block mapping for an XFS file.


xfs_rtcp

xfs_rtcp copies a file to the real-time partition on an XFS file system.


xfs_repair

xfs_repair repairs corrupt or damaged XFS file systems.


xfs_db

xfs_db is used to debug an XFS file system.


xfs_logprint

xfs_logprint prints the log of an XFS file system.


xfs_ncheck

xfs_ncheck generates pathnames from inode numbers for an XFS file system.


mkfs.xfs

mkfs.xfs constructs an XFS file system.


fsck.xfs

fsck.xfs simply exits with a zero status, since XFS partitions are checked at mount time.


Chapter 6. Editors

This chapter is referenced in the LFS book for those wishing to use other editors on their LFS system. We also have the opportunity to show how some LFS installed programs benefit from being recompiled after GUI libraries have been installed.


Vim-6.2

Introduction to Vim

The Vim package, which is an abbreviation for VI IMproved, contains a vi clone with extra features as compared to the original vi.

The default LFS instructions install vim as a part of the base system, but owing to the lack of X libraries during the base install, Vim needs to be recompiled once X is installed to enable the GUI mode. There is no need for special instructions since X support is automatically detected.


Package information


Vim dependencies


Installation of Vim

Install Vim by running the following commands:

echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h &&
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h &&
./configure --prefix=/usr \
   --with-features=huge &&
make &&
make install

Command explanations

--with-features=huge: This switch enables all the additional features available in Vim.


Contents

The Vim package contains eview, evim, ex, gview, gvim, gvimdiff, rgview, rgvim, rview, rvim, view, vim, vimdiff, vimtutor and xxd. Except for vimtutor and xxd, all the other commands are symlinks to vim and start vim with different options. vimtutor is a tool to learn the various vim commands and xxd is a command used to create hex dumps.


Emacs-21.3

Introduction to Emacs

The Emacs package contains the extensible, customizable, self-documenting real-time display editor.


Package information


Installation of Emacs

Install Emacs by running the following commands:

./configure --prefix=/usr \
   --libexecdir=/usr/sbin &&
make bootstrap &&
make install

Contents

The Emacs package contains emacs, b2m, ctags, ebrowse, emacsclient, etags, grep-changelog, rcs-checkin, cvt-mail, digest-doc, emacsserver, fakemail, hexl, movemail, profile, rcs2log, sorted-doc, vcdiff and yow.


Description

emacs

The editor proper.


b2m

b2m is a program to convert mail files from RMAIL format to Unix `mbox' format.


ctags

ctags creates cross-reference tagfile database files for source code.


ebrowse

ebrowse permits browsing of C++ class hierarchies from with emacs.


emacsclient

emacsclient attaches an emacs session to an already running emacsserver instance.


etags

etags is another program to generate source code cross-reference tagfiles.


grep-changelog

grep-changelog prints entries in Change Logs matching various criteria.


rcs-checkin

rcs-checkin is a shell script used to check files into RCS.


cvt-mail

cvt-mail converts old style goslings emacs mail directories into gnu-rmail format.


digest-doc

digest-doc is a filter to create nroff output for man pages.


emacsserver

emacserver allows other applications/shells to access an already running emacs instance and share buffers with it.


fakemail

fakemail is a sendmail-like interface to /bin/mail.


hexl

hexl converts files for editing with emacs hexl-mode binary file editing mode.


movemail

movemail provide access to POP3 mailboxes.


profile

profile generates periodic events for profiling of Emacs Lisp code.


rcs2log

rcs2log generates change log prefixes from RCS files.


sorted-doc

sorted-doc is a filter to generate texinfo files.


vcdiff

vcdiff compares SCCS files.


yow

yow prints a quotation from Zippy the Pinhead.


nano-1.2.2

Introduction to nano

The nano package contains a small, simple text editor which aims to replace Pico, the default editor in the Pine package.


Package information


nano dependencies

Optional

slang-1.4.9


Installation of nano

Install nano by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc \
--enable-color --enable-multibuffer --enable-nanorc &&
make &&
make install &&
mkdir -p /usr/share/doc/nano/examples &&
cp nanorc.sample /usr/share/doc/nano/examples

Configuring nano

Config files

/etc/nanorc, ~/.nanorc

Example Configuration

set autoindent
set const
set fill 72
set historylog
set multibuffer
set nohelp
set regexp
set smooth
set suspend

Another example is in the /usr/share/doc/nano/examples directory in the nanorc.sample file. It includes color configurations and has some documentation included in the comments.


Contents

The nano package contains nano.


Description

nano

nano is a small, simple text editor which aims to replace Pico, the default editor in the Pine package.


JOE-2.9.8

Introduction to JOE

JOE (Joe's own editor) is a small text editor capable of emulating WordStar, Pico, and Emacs.


Package information


Installation of JOE

Install JOE by running the following commands:

./configure --sysconfdir=/etc --prefix=/usr &&
make &&
make install

Configuration files

JOE can make use of several configuration files. Information about these files may be found in the joe man page. These files are /etc/jmacsrc, /etc/joerc, /etc/jpicorc, /etc/jstarrc, and /etc/rjoerc. JOE can also make use of ~/.joerc, which may be copied from /etc/joerc and customized for each user's taste.


Contents

The JOE package contains jmacs, joe, jpico, jstar, rjoe and termidx.


Description

jmacs

jmacs is a symbolic link to joe used to launch Emacs emulation mode.


joe

joe is a small text editor capable of emulating WordStar, Pico, and Emacs.


jpico

jpico is a symbolic link to joe used to launch Pico emulation mode.


jstar

jstar is a symbolic link to joe used to launch WordStar emulation mode.


rjoe

rjoe is a symbolic link to joe that restricts JOE to editing only files which are specified on the command-line.


termidx

termidx is a program used by joe to generate the termcap index file.


Chapter 7. Shells

We are all familiar with the Bourne Again SHell, but there are two other user interfaces that are considered useful modern shells -- the Berkeley Unix C shell and the Korn shell. This chapter installs packages compatible with these additional shell types.


ASH-0.4.0

Introduction to ASH

ash is a shell that is the most compliant with the Bourne Shell (not to be confused with Bourne Again SHell i.e. Bash installed in LFS) without any additional features. Bourne Shell is available on most commercial UNIX systems. Hence ash is useful for testing scripts to be sh-compliant. It also has a small memory and space requirements compared to the other sh-compliant shells.


Package information


Installation of ASH

Install ASH by running the following commands:

patch -Np1 -i ../ash-0.4.0-cumulative-fixes.patch &&
make &&
install -m 755 sh /bin/ash &&
install -m 644 sh.1 /usr/share/man/man1/ash.1

If you would like to make ash the default sh shell, make a symlink.

ln -sf ash /bin/sh

Configuring ASH

Config files

ASH sources /etc/profile and $HOME/.profile


Contents

The ASH package contains ash, a sh compliant shell.


Description

ash

ash is a sh-compliant shell.


Tcsh-6.12.00

Introduction to Tcsh

The Tcsh package contains "an enhanced but completely compatible version of the Berkeley Unix C shell (csh)". This is useful as an alternative shell for those who prefer C syntax to that of the bash shell, and also because some programs require the C shell in order to install.


Package information


Installation of Tcsh

Install Tcsh by running the following commands:

./configure --prefix=/usr &&
make &&
make install &&
cp tcsh.man /usr/share/man/man1/tcsh.1 &&
ln -s /usr/bin/tcsh /bin/csh

Command explanations

cp tcsh.man /usr/share/man/man1/tcsh.1: Tcsh doesn't install its man page correctly, so we do it manually.

ln -s /usr/bin/tcsh /bin/csh: The FHS states that if there is a C shell installed, there should be a symlink from /bin/csh to it. This creates that symlink.


Configuring Tcsh

Config files

There are numerous configuration files for the C shell. Examples of these are /etc/csh.cshrc, /etc/csh.login, ~/.tcshrc, ~/.cshrc, ~/.history, ~/.login, ~/.cshdirs, /etc/csh.logout, ~/.logout and ~/.logout. More information on these files can be found in the tcsh(1) man page.


Contents

The Tcsh package contains tcsh.


Description

tcsh

tcsh is an enhanced but completely compatible version of the Berkeley Unix C shell, csh. It is usable as both an interactive shell and a script processor.


ZSH-4.1.1

Introduction to ZSH

The ZSH package contains a command interpreter (shell) usable as an interactive login shell and as a shell script command processor. Of the standard shells, ZSH most closely resembles KSH but includes many enhancements.


Package information


Installation of ZSH

Install ZSH by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring ZSH

Config files

There are a whole host of configuration files for ZSH including /etc/zshenv, /etc/zprofile, /etc/zshrc, /etc/zlogin and /etc/zlogout. You can find more information on these in the zsh(1) and related man pages.


Contents

The ZSH package contains zsh.


Description

zsh

zsh is a shell which has command-line editing, built-in spelling correction, programmable command completion, shell functions (with autoloading), a history mechanism, and a host of other features.

III. General Libraries and Utilities


Chapter 8. General Libraries

Libraries contain code which is often required by more than one program. This has the advantage that each program doesn't need to duplicate code (and risk introducing bugs), it just has to call functions from the libraries installed on the system. The most obvious example of a set of libraries is glibc which is installed during the LFS book. This contains all of the C library functions which programs use.

There are two types of library, static and shared. Shared libraries (usually libXXX.so) are loaded into memory from the shared copy at runtime (hence the name). Static libraries (libXXX.a ) are actually linked into the program executable file itself, thus making the program file larger. Quite often, you will find both static and shared copies of the same library on your system.

Generally, you only need to install libraries when you are installing software which requires functionality which they supply. In the BLFS book, each package is listed with a list of (known) dependencies. Thus, you can figure out which libraries you need to have before installing that program. If you are installing something without using BLFS instructions, usually the README or INSTALL file will contain details of the programs requirements.

There are certain libraries which nearly everyone will need at some point. In this chapter we list these and some others and explain why you may want to install them.


OpenSSL-0.9.7c

Introduction to OpenSSL

The OpenSSL package contains management tools and libraries relating to cryptography. These are useful for providing cryptography functions to other packages, notably OpenSSH and web browsers (for accessing secure https sites).


Package information


Installation of OpenSSL

Install OpenSSL by running the following commands:

patch -Np1 -i ../openssl-0.9.7c-manpages.patch
sed 's/^passwd/openssl-passwd/' doc/apps/passwd.pod \
> doc/apps/openssl-passwd.pod &&
rm doc/apps/passwd.pod &&
./config --openssldir=/etc/ssl --prefix=/usr shared &&
make MANDIR=/usr/share/man &&
make MANDIR=/usr/share/man install &&
rmdir /etc/ssl/lib &&
chmod 755 /usr/lib/pkgconfig

Command explanations

no-rc5 no-idea: When added to the ./config command, this will eliminate the building of those encryption methods. Patent licenses may be needed for you to utilize either of those methods in your projects.

rm doc/apps/passwd.pod : This command prevents OpenSSL from installing its passwd man page over an existing man page with the same name.

make MANDIR=/usr/share/man
make MANDIR=/usr/share/man install
These commands install OpenSSL with the man pages in /usr/share/man instead of the default which is /etc/ssl/man.

rmdir /etc/ssl/lib: This is simply a tidy-up command. For some reason, the openssl install routine creates the /etc/ssl/lib directory even though the libraries have been installed in /usr/lib. We remove it to keep things nice and tidy!

chmod 755 /usr/lib/pkgconfig: The installation process modifies the rights on this directory to mode 644. This command restores the permissions to the setting prior to installation (mode 755).


Configuring OpenSSL

Config files

/etc/ssl/openssl.cnf


Configuration Information

Most people who just want to use openssl for providing functions to other programs such as OpenSSH and web browsers won't need to worry about configuring OpenSSL. Configuring OpenSSL is an advanced topic and so those who do would normally be expected to either know how to do it or to be able to find out how to do it.


Contents

The OpenSSL package contains c_rehash, openssl, libcrypto libraries and libssl libraries.


Description

c_rehash

c_rehash is a Perl script that scans all files in a directory and adds symbolic links to their hash values.


openssl

The openssl program is a command-line tool for using the various cryptography functions of OpenSSL's crypto library from the shell. It can be used for various functions which are documented in man 1 openssl.


libcrypto

The OpenSSL crypto library implements a wide range of cryptographic algorithms used in various Internet standards. The services provided by this library are used by the OpenSSL implementations of SSL, TLS and S/MIME, and they have also been used to implement OpenSSH, OpenPGP , and other cryptographic standards.


libssl

The OpenSSL SSL library implements the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols. It provides a rich API, documentation on which can be found by running man 3 ssl.


pcre-4.3

Introduction to pcre

The pcre package contains Perl compatible regular expression libraries. These are useful for implementing regular expression pattern matching using the same syntax and semantics as Perl 5.


Package information


Installation of pcre

Install pcre by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The pcre package contains the libpcre libraries, pcregrep, pcretest and pcre-config.


Description

pcregrep

pcregrep is a grep that understands Perl compatible regular expressions.


pcretest

pcretest can test your Perl compatible regular expression.


pcre-config

pcre-config is used during the compile process of programs linking to this library.


popt-1.7

Introduction to popt

The popt package contains the popt libraries which are used by some programs to parse command-line options.


Package information


Installation of popt

Install popt by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The popt package contains the libpopt libraries.


Description

popt library

The popt library is used to parse command-line options.


slang-1.4.9

Introduction to slang

The slang package contains the slang library, which is used to create robust, multi-platform software.


Package information


Installation of slang

Install slang by running the following commands:

./configure --prefix=/usr &&
make &&
make install &&
make elf &&
make install-elf &&
make install-links &&
chmod 755 /usr/lib/libslang.so.1.4.9

Configuring slang

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The slang package contains the libslang libraries.


FAM-2.6.10

Introduction to FAM

The FAM package contains a File Alteration Monitor which is useful for notifying applications of changes to the file system.


Package information


FAM dependencies

Required

portmap-5


Installation of FAM

Install FAM by running the following commands:

Note: You will get warnings about make install being unable to merge entries in /etc/rpc. These can be ignored, along with any IMON or inetd.conf warnings, as we will be configuring these files after installation.

patch -Np1 -i ../fam-2.6.10-dnotify.patch &&
libtoolize --force &&
aclocal &&
automake --add-missing &&
autoconf &&
./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

patch -Np1 -i ../fam-dnotify.patch: This patch causes FAM to use the Linux kernel dnotify mechanism to inform the calling process of file modifications, rather than polling the file system for modifications.

libtoolize --force
aclocal
automake --add-missing
autoconf
These commands are necessary since the patches affect the configure.in file. They regenerate a new configure command with the necessary changes.


Configuring FAM

Config files

/etc/rpc, /etc/fam.conf, /etc/inetd.conf, /etc/xinetd.d/fam or /etc/xinetd.conf


Configuration Information

Configuring the file alteration monitor.

If you use inetd, add the FAM entry to /etc/inetd.conf with the following command:

echo "sgi_fam/1-2 stream  rpc/tcp wait root /usr/bin/fam fam" >> /etc/inetd.conf

If you use xinetd, add an entry to /etc/xinetd.conf with the following command (be sure the "nogroup" group exists):

cat >> /etc/xinetd.conf << "EOF"
    # description: FAM - file alteration monitor
    service sgi_fam
    {
        type            = RPC UNLISTED
        socket_type     = stream
        user            = root
        group           = nogroup
        server          = /usr/bin/fam
        wait            = yes
        protocol        = tcp
        rpc_version     = 2
        rpc_number      = 391002
    }
EOF

Contents

The FAM package contains fam and libfam libraries.


Description

fam

fam is the file alteration monitor.


libxml-1.8.17

Introduction to libxml

The libxml package contains the libxml libraries. These are useful for parsing XML files.


Package information


Installation of libxml

Install libxml by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libxml package contains libxml libraries, xmllint and xmlcatalog.


Description

libxml libraries

libxml libraries provide the functions for programs to parse files that use the XML format.


libxml2-2.5.11

Introduction to libxml2

The libxml2 package contains XML libraries. These are useful for parsing XML files.


Package information


libxml2 dependencies

Optional

Python-2.3.2


Installation of libxml2

Install libxml2 by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libxml2 package contains libxml2 libraries, xmllint and xmlcatalog.


Description

libxml2 libraries

libxml2 libraries provide the functions for programs to parse files that use the XML format.


xmllint

xmllint parses XML files and outputs reports (based upon options) to detect errors in XML coding.


xmlcatalog

xmlcatalog allows users to monitor and manipulate XML and SGML catalogs.


libxslt-1.0.33

Introduction to libxslt

The libxslt package contains XSLT libraries. These are useful for extending libxml2 libraries to support XSLT files.


Package information


libxslt dependencies


Installation of libxslt

Install libxslt by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libxslt package contains libxslt libraries, libexslt libraries and xsltproc.


Description

libxslt libraries

libxslt libraries provide extensions to the libxml2 libraries to parse files that use the XSLT format.


xsltproc

xsltproc is used to apply XSLT stylesheets to XML documents.


readline-4.3

Introduction to readline

The readline library provides a set of functions for use by applications that allow users to edit command-lines as they are typed in. Both Emacs and vi editing modes are available.


Package information


Installation of readline

Install readline by running the following commands:

./configure --prefix=/usr &&
make SHLIB_LIBS=-lcurses &&
make install

Command explanations

make SHLIB_LIBS=-lcurses: These command makes the proper symbols available for applications that assume readline is compiled linked to ncurses.


Configuring readline

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The readline package contains the libreadline libraries and libhistory libraries.


GMP-4.1.2

Introduction to GMP

The GMP package contains an math library. This has useful functions for arbitrary precision arithmetic.


Package information


GMP dependencies

Optional

readline-4.3


Installation of GMP

Install GMP by running the following commands:

./configure --prefix=/usr --infodir=/usr/share/info  --mandir=/usr/share/man &&
make &&
make install

Command explanations

--infodir=/usr/share/info --mandir=/usr/share/man: These switches set the documentation directory to /usr/share instead of /usr.


Contents

The GMP package contains libgmp libraries.


Description

gmp libraries

libgmp libraries contain the functions to operate on signed integers, rational numbers, and floating point numbers.


GDBM-1.8.3

Introduction to GDBM

The GDBM package contains the GNU Database Manager. This is useful for database routines that use extendible hashing.


Package information


Installation of GDBM

Install GDBM by running the following commands:

./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man &&
make &&
make BINOWN=root BINGRP=root install

In addition, you may need to install the compatibility headers for gdbm. Apache 1.3, for example, will need these headers. Install the compatibility headers by running the following command:

make BINOWN=root BINGRP=root install-compat

Command explanations

--infodir=/usr/share/info --mandir=/usr/share/man: These switches set the documentation directory to /usr/share instead of /usr.

BINOWN=root BINGRP=root: This command changes the file ownership to root instead of the bin user.


Contents

The GDBM package contains libgdbm libraries.


Description

gdbm libraries

libgdbm libraries contain functions that perform database routines using extendible hashing.


GLib-1.2.10

Introduction to GLib

The glib package contains a low-level core library. This is useful for providing data structure handling for C, portability wrappers and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.


Package information


Installation of GLib

Install glib by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The glib package contains libglib-1.2 libraries.


Description

GLib libraries

GLib libraries contain a low-level core library for the GIMP Toolkit.


GLib-2.2.3

Introduction to GLib

The glib package contains a low-level core library. This is useful for providing data structure handling for C, portability wrappers and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.


Package information


Installation of GLib

Install glib by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Command explanations

--enable-gtk-doc: This switch will rebuild the API documentation during the make command.


Contents

The glib package contains libglib-2.0 libraries.


Description

GLib libraries

GLib libraries contain a low-level core library for the GIMP Toolkit.


expat-1.95.6

Introduction to expat

The expat package contains a stream oriented C library for parsing XML.


Package information


Installation of expat

The expat.h declares XML_Status after its first use. This is corrected by the following patch:

patch -Np1 -i ../expat-1.95.6-fix-declaration-order.patch

Install expat by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The expat package contains the libexpat libraries and xmlwf.


Description

xmlwf

xmlwf is a non-validating utility to check whether or not XML documents are well formed.


libesmtp-1.0

Introduction to libesmtp

The libesmtp package contains the libesmtp libraries which are used by some programs to manage email submission to a mail transport layer.


Package information


Installation of libesmtp

Install libesmtp by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libesmtp package contains the libesmtp library.


Description

libesmtp library

The libesmtp library is used to manage submission of electronic mail to a Mail Transport Agent.


aspell-0.50.3

Introduction to aspell

The aspell package contains the aspell library, used to interface to spell checking libraries.


Package information


Installation of aspell

Install aspell by running the following commands:

patch -Np1 -i ../aspell-0.50.3-gcc33-1.patch &&
./configure --prefix=/usr &&
make &&
make install

Configuring aspell

Configuration Information

After Aspell is installed at least one dictionary needs to be installed. You can find them at http://aspell.net/.

Install your dictionary or dictionaries by running the following commands:

./configure &&
make &&
make install

Contents

The aspell package contains the libaspell libraries.


Description

aspell library

The libaspell library is a spell checking library interface.


ispell-3.2.06.epa6

Introduction to ispell

The ispell package contains a spell checker that can handle international languages.


Package information


Installation of ispell

The first step is to create local.h.

sed -e "s:/usr/local:/usr:g" local.h.linux > local.h

By default, ispell only installs American English dictionary. To install other languages, check out the config.X file for the define to append to local.h.

Compile and install ispell using the following commands:

make &&
make install

Contents

The ispell package contains the ispell program used for spell checking.


Guile-1.6.4

Introduction to Guile

The Guile package contains the Project GNU's extension language library. Guile also contains a stand alone Scheme interpreter.


Package information


Guile dependencies

Optional

readline-4.3


Installation of Guile

Install Guile by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

In addition to the libguile libraries, the Guile package contains guile, guile-config and guile-snarf.


Description

guile

guile is a stand-alone scheme interpreter for Guile.


guile-config

guile-config is a Guile script which provides the information necessary to link your programs against the Guile library, in much the same way pkgconfig-0.15.0 does.


guile-snarf

guile-snarf a script to parse declarations in your C code for Scheme visible C functions, Scheme objects to be used by C code, etc.


slib-2d6

Introduction to slib

The slib package is a Scheme library used with Guile.


Package information


slib dependencies

Required

Guile-1.6.4


Installation of slib

Installation of slib is merely a copy command:

cp -R slib /usr/share/guile

Contents

The slib package contains a Scheme library.


G-Wrap-1.3.4

Introduction to G-Wrap

The G-Wrap package contains tools for exporting C libraries into Scheme interpreters.


Package information


G-wrap dependencies

Required

Guile-1.6.4 and slib-2d6


Installation of G-Wrap

Install G-Wrap by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

In addition to the Scheme libraries, the G-Wrap package contains g-wrap-config.


Description

g-wrap-config

g-wrap-config is a tool to generate CFLAGS for linking C code to the Scheme runtime libraries.


LZO-1.08

Introduction to LZO

LZO is a data compression library which is suitable for data decompression and compression in real-time. This means it favors speed over compression ratio.


Package information


Installation of LZO

Install LZO by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

LZO package provides liblzo library.


Description

liblzo

liblzo is a data compression and decompression library.


Chapter 9. Graphics Libraries

Depending on what your system will be used for, you may or may not require the graphics libraries. Most desktop machines will want them for use with graphical applications. Most servers on the other hand, will not require them.


lcms-1.11

Introduction to lcms

The lcms library is used by other programs to provide color management facilities.


Package information


lcms dependencies


Installation of lcms

Install lcms by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The lcms package contains the liblcms libraries, icc2ps, icclink, icctrans and optionally, tifficc, jpegicc, _lcms library and lcms.py.


Description

liblcms library

The liblcms libraries are used by other programs to provide color management facilities.


icc2ps

icc2ps generates PostScript CRD or CSA from ICC profiles.


icclink

icclink links two or more profiles into a single device link profile.


icctrans

icctrans is a Color Space conversion calculator.


tifficc

tifficc is an ICC profile applier for TIFF files.


jpegicc

jpegicc is an ICC profile applier for JPEG files.


libjpeg-6b

Introduction to libjpeg

The libjpeg package contains libraries that allow compression of image files based on the Joint Photographic Experts Group standard. It is a "lossy" compression algorithm.


Package information


Installation of libjpeg

Install libjpeg by running the following commands:

./configure --enable-static --enable-shared --prefix=/usr &&
make &&
make install

Command explanations

./configure --enable-static --enable-shared --prefix=/usr: This command tells libjpeg to build both shared and static libraries and to install them with a base of /usr.


Configuring libjpeg

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The libjpeg package contains cjpeg, djpeg, jpegtran, rdjpgcom, wrjpgcom and libjpeg libraries.


Description

cjpeg

cjpeg compresses image files to produce a JPEG/JFIF file on the standard output. Currently supported input file formats are: PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale format), BMP, and Targa.


djpeg

djpeg decompresses image files from JPEG/JFIF format to either PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale format), BMP, or Targa format.


jpegtran

jpegtran is used for lossless transformation of JPEG files.


rdjpgcom

rdjpgcom displays text comments from within a JPEG file.


wrjpgcom

wrjpgcom inserts text comments into a JPEG file.


jpeg libraries

These libraries are used by many programs for reading and writing jpeg format files.


libpng-1.2.5

Introduction to libpng

The libpng package contains libraries used by other programs for reading and writing PNG files.


Package information


Installation of libpng

Install libpng by running the following commands:

make prefix=/usr \
   ZLIBINC=/usr/include ZLIBLIB=/usr/lib -f scripts/makefile.linux &&
make prefix=/usr install -f scripts/makefile.linux

Command explanations

ZLIBINC=/usr/include ZLIBLIB=/usr/lib: This forces libpng to look for the zlib includes and libraries where we have them installed.

-f scripts/makefile.linux: This points make at the Linux version of the makefile as libpng doesn't use a autoconf routine instead coming with various makefiles for different platforms.


Configuring libpng

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The libpng package contains libpng libraries and libpng-config.


Description

png libraries

The PNG library is a collection of routines used to create and manipulate PNG format graphics files. The PNG format was designed as a replacement for GIF and, to a lesser extent, TIFF, with many improvements and extensions and lack of patent problems.


libpng-config

libpng-config provides configuration info for libpng.


libtiff-3.5.7

Introduction to libtiff

The libtiff package contains the tiff libraries and associated utilities. The libraries are used by many programs for reading and writing tiff files and the utilities are useful for general work with tiff files.


Package information


Installation of libtiff

Install libtiff by running the following commands:

patch -Np1 -i ../tiff-3.6.0-tiffio.patch &&
./configure --prefix=/usr --noninteractive \
   --with-DIR_MAN=/usr/share/man &&
make &&
make install

Command explanations

--noninteractive: This switch is used to avoid the configuration routine asking for confirmation of the directories to install to (which we pass using switches to configure anyways).

--with-DIR_MAN=/usr/share/man: This is used because despite the fact we pass --prefix=/usr, the configure routine tries to install the man pages in /usr/local/man instead of the correct place.


Configuring libtiff

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The libtiff package contains fax2ps, fax2tiff, gif2tiff, pal2rgb, ppm2tiff, ras2tiff, rgb2ycbcr, thumbnail, tiff2bw, tiff2ps, tiff2rgba, tiffcmp, tiffcp, tiffdither, tiffdump, tiffinfo, tiffmedian, tiffsplit and tiff libraries.


Description

fax2ps

fac2ps converts a TIFF facsimile to compressed PostScript file.


fax2tiff

fax2tiff creates a TIFF Class F fax file from raw fax data.


gif2tiff

gif2tiff creates a TIFF file from a GIF87 format image file.


pal2rgb

pal2rgb converts a palette color TIFF image to a full color image.


ppm2tiff

ppm2tiff creates a TIFF file from a PPM image file.


ras2tiff

ras2tiff creates a TIFF file from a Sun rasterfile.


rgb2ycbcr

rgb2ycbcr converts non-YCbCr TIFF images to a YCbCr TIFF image.


thumbnail

thumbnail creates a TIFF file with thumbnail images.


tiff2bw

tiff2bw converts a color TIFF image to grayscale.


tiff2ps

tiff2ps converts a TIFF image to a PostScript file.


tiff2rgba

No description available.


tiffcmp

tiffcmp compares two TIFF files.


tiffcp

tiffcp copies (and possibly converts) a TIFF file.


tiffdither

tiffdither converts a grayscale image to bilevel using dithering.


tiffdump

tiffdump prints verbatim information about TIFF files.


tiffinfo

tiffinfo prints information about TIFF files.


tiffmedian

tiffmedian applies the median cut algorithm to data in a TIFF file.


tiffsplit

tiffsplit splits a multi-image TIFF into single-image TIFF files.


tiff libraries

The tiff libraries are used by many programs to read and write tiff files.


libungif-4.1.0b1

Introduction to libungif

The libungif package contains libraries for reading all GIFs and writing non-compressed ones as well as programs for converting and working with GIF files. The libraries are useful for any graphics program wishing to deal with GIF files while the programs are useful for conversion purposes as well as cleaning up images.

The reason libungif only writes non-compressed GIFs is due to a legal issue with LZW compression (which Unisys claims a patent on). Reading GIFs is not a problem as the decompression routines do not seem to be limited in this way. Note that this has in the past been disputed. The best way to avoid this whole mess is to simply use libungif for looking at GIF images on the web, while in any pages which you design, use the open source PNG format instead (which uses, not surprisingly, the libpng library) which has no patent issues at all.


Package information


Installation of libungif

Install libungif by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libungif package contains gif2epsn, gif2ps, gif2rgb, gifasm, gifbg, gifburst, gifclip, gifclrmp, gifcolor, gifcomb, gifcompose, giffiltr, giffix, gifflip, gifhisto, gifinfo, gifinter, gifinto, gifovly, gifpos, gifrotat, gifrsize, gifspnge, giftext, gifwedge, icon2gif, raw2gif, rgb2gif, text2gif and libungif libraries.


Description

gif2epsn

Dumps images saved as GIF files on Epson type printers.


gif2ps

Print GIF file on laser printers supporting PostScript.


gif2rgb

Convert images saved as GIF to 24-bit RGB image(s).


gifasm

assemble multiple GIFs into one, or burst a multiple-image GIF.


gifbg

Generate a single-color test pattern GIF.


gifburst

Burst a GIF image into subrectangles.


gifclip

Clip or crop a GIF image.


gifclrmp

Modify GIF image colormaps.


gifcolor

Generate color test patterns.


gifcomb

Combine 2 GIF images of exactly the same size into one.


gifcompose

Use (un)giflib tools to compose images.


giffiltr

Template code for filtering a GIF sequentially.


giffix

Clumsily attempts to fix truncated GIF images.


gifflip

Flip GIF image along X or Y axis or rotate by 90 degrees.


gifhisto

Generate color-frequency histogram from a GIF.


gifinfo

Gives information on a GIF file.


gifinter

Convert between interlaced and non interlaced images.


gifinto

End-of-pipe fitting for GIF-processing pipelines.


gifovly

Generate one composite GIF from a multiple-image GIF.


gifpos

Change a GIF's screen size or recondition it.


gifrotat

Rotate a GIF through any desired angle.


gifrsize

Resize a GIF by deletion or duplication of bits.


gifspnge

Template code for filtering a GIF with in-core operations.


giftext

Print (text only) general information about a GIF.


gifwedge

Create a test GIF image resembling a color monitor test pattern.


icon2gif

Converter/deconverter to/from an editable text format.


raw2gif

Convert raw 8-bit image data into GIF files.


rgb2gif

Convert 24 bit images to a GIF image using color quantization.


text2gif

Generate GIF images out of regular text in 8x8 font.


libmng-1.0.5

Introduction to libmng

The libmng libraries are used by programs wanting to read and write Multiple-image Network Graphics (MNG ) files which are the animation equivalents to PNG files.


Package information


template dependencies

Required

libjpeg-6b and lcms-1.11


Installation of libmng

Install libmng by running the following commands:

./configure --prefix=/usr --with-zlib \
   --with-jpeg --with-lcms &&
make &&
make install &&
cp doc/man/*.3 /usr/share/man/man3 &&
cp doc/man/*.5 /usr/share/man/man5

Command explanations

./configure --prefix=/usr --with-zlib \
--with-jpeg --with-lcms
This command sets the install directory and also tells the configuration routine to look and find zlib, libjpeg and lcms.

cp doc/man/*.X /usr/share/man/manX: The install procedure doesn't properly install the man pages so we do it manually.


Contents

The libmng package contains libmng libraries.


Description

MNG libraries

libmng provides functions for programs wishing to read and write MNG files which are animation files without the patent problems associated with certain other formats.


Imlib-1.9.14

Introduction to Imlib

The Imlib package contains image libraries. These are useful for loading, rendering and dithering a wide variety of image data formats.


Package information


Installation of Imlib

Install Imlib by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc/imlib &&
make &&
make install

Command explanations

--sysconfdir=/etc/imlib: This installs and combines the configurations files into /etc instead of /usr/etc.


Contents

The Imlib package contains libimlib libraries.


Description

imlib libraries

libimlib libraries provide the functions for programs to display and edit a wide variety of image data formats.


AAlib-1.4rc5

Introduction to AAlib

AAlib is a library to render any graphic into ASCII Art.


Package information


AAlib dependencies


Installation of AAlib

Install AAlib by running the following commands:

./configure --prefix=/usr && 
make &&
make install

Contents

The AAlib package contains the libaa libraries, aalib-config, aainfo, aatest and aasavefont.


Description

ASCII Art libraries

The ASCII Art library is a collection of routines to render any graphical input in portable format to ASCII Art. It can be used through many programs and has a very well documented API, so you can easily put it into your own programs.


aalib-config

aalib-config provides configuration info for AAlib.


aainfo

aainfo provides information for your current settings related to AAlib.


aatest

aatest shows the abilities of AAlib in a little test.


aafire

aafire is another little toy of AAlib , rendering an animated fire in ASCII Art.


aasavefont

Currently no information available.


SVGAlib-1.4.3

Introduction to SVGAlib

SVGAlib is a low-level graphics library that provides VGA and SVGA modes in a console. This is useful for programs running on a console that require graphics capabilities.


Package information


Installation of SVGAlib

Note: You must compile and install as root. If you don't nothing bad will happen during compilation, but certain tools won't be able to become SUID root which is required for proper operation. However, this raises a risk of exposing your system to any holes in those tools that might be used to gain root access so use with caution.

Install SVGAlib by running the following commands:

patch -Np1 -i ../svgalib-1.4.3-gcc3-1.patch &&
make prefix=/usr install &&
cd doc &&
for dir in man?; do for file in $dir/*; do \
gunzip /usr/share/man/$file; done; done

Command explanations

cd doc && for dir in man?; do for file in $dir/*; do gunzip /usr/share/man/$file; done; done: SVGAlib installs it's man pages in compressed format so we uncompress them.


Configuring SVGAlib

Config files

/etc/vga/libvga.config, ~/.svgalibrc


Configuration information

You must edit the config file to set the monitor and mouse type. Depending on your hardware, other setup might be required.

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The SVGAlib package contains libvga and libvgagl libraries, dumpreg, mode3, restorefont, restorepalette, restoretextmode, savetextmode, textmode and svgakeymap.


Description

libvga library

libvga is a low-level graphics library.


libvgagl library

libvgagl is a fast frame buffer level graphics library based on libvga.


dumpreg

dumpreg dumps the state of the card as the svgalib chipset driver sees it.


mode3

mode3 sets a VESA mode.


restorefont

restorefont saves or restores the SVGA font for textmode.


restorepalette

restorepalette sets the color palette for textmode.


restoretextmode

restoretextmode saves or restores the SVGA registers for textmode.


savetextmode, textmode

savetextmode and textmode save or restore the complete SVGA status for textmode.


svgakeymap

svgakeymap generates keymaps for svgalib.


DirectFB-0.9.19

Introduction to DirectFB

DirectFB is a graphics library on top of the Linux frame buffer device. It offers maximum hardware accelerated performance at a minimum of resource usage and overhead.


Package information


Additional downloads


Installation of DirectFB

Note: DirectFB needs a Linux kernel with frame buffer support. Check the documentation in the kernel tree (/usr/src/linux/Documentation/fb/) on how to enable the frame buffer device for your graphics card.

Install DirectFB by running the following commands:

./configure --prefix=/usr &&
make &&
make install

If you decided to add optional image and video providers then you have to install DirectFB-extra package too:

./configure --prefix=/usr &&
make &&
make install

Note: The current version of avifile does not work with DirectFB. You have to use the avifile version which can be found at http://www.directfb.org/download/contrib/ or alternatively disable the avifile video provider by calling configure with --disable-avifile.


Configuring DirectFB

Config files

/etc/directfbrc, ~/.directfbrc


Configuration information

DirectFB is shipped with reasonable defaults but you might have to tweak things. There are several ways to do this. You may edit the system-wide configuration file /etc/directfbrc, the user-specific ~/.directfbrc or you may configure the DirectFB application via the command-line. Consult the directfbrc(5) manual page for details.


Contents

The DirectFB package provides dfbdump, dfbg, dfbinfo, dfblayer, directfb-config, directfb-csource and libdirectfb libraries.


Description

dfbdump

This is a simple debugging tool for DirectFB that shows a list of surfaces and windows.


dfbg

dfbg is a background configuration tool.


dfbinfo

This tool enumerates input devices.


dfblayer

dfblayer is a display layer configuration tool.


directfb-config

directfb-config provides all flags to link static binaries with selectable drivers and other modules built in.


directfb-csource

This is a C code generation utility for DirectFB surfaces.


libdirectfb libraries

They provide hardware graphics acceleration, input device handling and abstraction, integrated windowing system with support for translucent windows and multiple display layers on top of the Linux frame buffer device.


Imlib2-1.1.0

Introduction to Imlib2

Imlib2 is a graphics library for fast file loading, saving, rendering and manipulation.


Package information


Installation of Imlib2

Install Imlib2 by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

This package contains libImlib2 library as well as various filters and image loader libraries.


Description

libImlib2

libImlib2 provides the functions for programs to deal with various image data formats.


Chapter 10. General Utilities

bc-1.06

Introduction to bc

The bc package contains an arbitrary precision numeric processing language.


Package information


bc dependencies

Required

readline-4.3


Installation of bc

Download the patches for bc from http://www.linuxfromscratch.org/patches/blfs/5.0.

Install bc by running the following commands:

patch -Np1 -i ../bc-1.06-flex-invocation.patch &&
patch -Np1 -i ../bc-1.06-readline.patch &&
./configure --prefix=/usr --with-readline &&
make &&
make install

Contents

The bc package contains bc and dc.


Description

bc

bc is a calculator.


dc

dc is a reverse-polish calculator.


rep-gtk-0.18

Introduction to rep-gtk

The rep-gtk package contains a Lisp and GTK binding. This is useful for extending GTK-2 and GDK libraries with Lisp. The rep-gtk-0.15 package contains the bindings to GTK and uses the same instructions. They can both can be installed, if needed.


Package information


rep-gtk dependencies


Installation of rep-gtk

Install rep-gtk by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The rep-gtk package contains Lisp bindings.


Description

Lisp bindings

Lisp bindings are libraries stored in /usr/lib/rep/i686-pc-linux-gnu/gui/ that assist communications between Lisp and the GTK libraries.


Compface-1.4

Introduction to Compface

Compface provides utilities and a library to convert from/to X-Face format, a 48x48 bitmap format used to carry thumbnails of email authors in a mail header.


Package information


Installation of Compface

Install Compface by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

This package contains compface, uncompface and libcompface.


Description

compface

compface is a filter for generating highly compressed representations of 48x48x1 face image files.


uncompface

uncompface is an inverse filter which performs an inverse transformation with no loss of data.


libcompface

libcompface allows the compression and decompression algorithms to be used in other programs such as MTAs.


Chapter 11. System Utilities

This chapter contains mainly hardware utilities. It also contains some applications used by other applications in the book for installation purposes.


GPM-1.20.1

GPM (the General Purpose Mouse daemon) is a mouse server for applications running in the console. It not only provides cut and paste support generally, but its library component is used by various software such as links to provide mouse support to the application generally. It is useful on desktops, especially if following (Beyond) Linux From Scratch instructions - it's often much easier (and less error prone) to cut and paste between two console windows than to type everything by hand!


Introduction to GPM

The GPM package contains a mouse server for the console and xterm. This is useful for cutting and pasting text in console mode, and also because many console-based programs need it to compile mouse support into themselves.


Package information


Installation of GPM

Install GPM by running the following commands:

patch -Np1 -i ../gpm-1.20.1-segfault.patch &&
patch -Np1 -i ../gpm-1.20.1-silent.patch &&
LDFLAGS="-lm" ./configure --prefix=/usr &&
make &&
make install &&
ldconfig -n -l /usr/lib/libgpm.so.1.19.0

Command explanations

export LDFLAGS="-lm": The math library must be linked with gpm, as ceil() is used in some cursor scrolling logic. LDFLAGS is only needed if you optimize gpm for size.

ldconfig -n -l : During installation, gpm outputs a message to run the above command to create the proper library links.


Configuring GPM

gpm init.d script

The gpm init.d script can be created using the following commands:

cat > /etc/rc.d/init.d/gpm << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/gpm

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# GPM specific parts by Mark Hymers - markh@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

if [ -f /etc/sysconfig/mouse ]
	then
        source /etc/sysconfig/mouse
fi

if [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
	then
	echo "Please create an /etc/sysconfig/mouse file containing"
	echo "MDEVICE and PROTOCOL values"
	exit 1;
fi

case "$1" in
        start)
                echo "Starting gpm..."
                loadproc gpm -m $MDEVICE -t $PROTOCOL
                ;;

        stop)
                echo "Stopping gpm..."
                killproc gpm
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                statusproc gpm
                ;;

        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/gpm
EOF
chmod 755 /etc/rc.d/init.d/gpm

You then need to create symbolic links to this file in the relevant rc.d directories. For example:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/gpm ../rc0.d/K10gpm &&
ln -sf ../init.d/gpm ../rc1.d/K10gpm &&
ln -sf ../init.d/gpm ../rc2.d/K10gpm &&
ln -sf ../init.d/gpm ../rc3.d/S70gpm &&
ln -sf ../init.d/gpm ../rc4.d/S70gpm &&
ln -sf ../init.d/gpm ../rc5.d/S70gpm &&
ln -sf ../init.d/gpm ../rc6.d/K10gpm

Config files

/etc/sysconfig/mouse This file contains the name of your mouse device and the protocol which it uses. To create this file, run the following:

cat > /etc/sysconfig/mouse << "EOF" 
# start /etc/sysconfig/mouse
MDEVICE=[yourdevice]
PROTOCOL=[yourprotocol]
# end /etc/sysconfig/mouse
EOF

Configuration Information

Examples of values to set MDEVICE and PROTOCOL to are

MDEVICE=/dev/psaux
PROTOCOL=imps2

A list of which protocol values are known can be found by running gpm -t -help. Your MDEVICE setting depends on which type of mouse you have. For example, /dev/ttyS0 for a serial mouse (on Windows this is COM1), /dev/input/mice is often used for USB mice and /dev/psaux for PS2 mice. It is normally thought not a good idea to link /dev/mouse to the relevant device, but instead to reference it directly.


Contents

The GPM package contains gpm, gpm-root, disable-paste and mev.


Description

gpm

gpm is a cut and paste utility and mouse server for virtual consoles.


gpm-root

gpm-root is a default handler for gpm. It is used to draw menus on the root window.


disable-paste

No description available.


mev

mev is a program to report mouse events.


Fcron-2.9.3

Introduction to Fcron

The Fcron package contains a periodical command scheduler which aims at replacing Vixie Cron.


Package information


Installation of Fcron

Fcron uses the cron facility of syslog to log all messages. Since LFS does not set up this facility in /etc/syslog.conf, it needs to be done prior to installing Fcron. This command will append the necessary line to the current /etc/syslog.conf.

cat >> /etc/syslog.conf << "EOF"
# Begin fcron addition to /etc/syslog.conf

cron.* -/var/log/cron.log

# End fcron addition
EOF

The configuration file has been modified, so reloading the sysklogd daemon will activate the changes.

/etc/rc.d/init.d/sysklogd reload

For security reasons, we need to create an unprivileged user and group for fcron:

groupadd fcron &&
useradd -c fcron -g fcron fcron

Install Fcron by running the following commands:

./configure --without-sendmail --with-answer-all=no &&
make &&
make install

Command explanations

--without-sendmail: Fcron does not require an MTA to run but will use one, if it is installed, to email you the results of the fcron script. If you wish to utilize this feature change the switch to --with-sendmail=[path to your MTA] .

--with-answer-all=no: After the files are installed, the make install script enters into a configuration routine. The first test will be whether to install a boot script in the /etc/rc.d/init.d directory with the appropriate symbolic links in run levels 2, 3, 4, and 5. The second is to stop any current fcron processes and start a new one. Since this is probably your first install and we want a boot script based upon the BLFS template we answer 'n' to both tests.

--with-dsssl-dir=/usr/share/sgml/docbook/dsssl-stylesheets-1.78 : Can be added if you have installed OpenJade and dsssl-stylesheets to generate the documentation from the DocBook source files.


Configuring Fcron

Config files

/etc/fcron.conf, /etc/fcron.allow, /etc/fcron.deny


Configuration Information

There are no required changes in any of the config files. Configuration information can be found in the man page for fcron.conf.

fcron scripts are written using fcrontab . Refer to the man page for fcrontab for proper parameters for your situation.

Create the boot script with the following:

cat > /etc/rc.d/init.d/fcron << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/fcron

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting fcron..."
                loadproc fcron
                ;;

        stop)
                echo "Stopping fcron..."
                killproc fcron
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                statusproc fcron
                ;;

        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/fcron
EOF
chmod 755 /etc/rc.d/init.d/fcron

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/fcron ../rc0.d/K08fcron &&
ln -sf ../init.d/fcron ../rc2.d/S40fcron &&
ln -sf ../init.d/fcron ../rc3.d/S40fcron &&
ln -sf ../init.d/fcron ../rc4.d/S40fcron &&
ln -sf ../init.d/fcron ../rc5.d/S40fcron &&
ln -sf ../init.d/fcron ../rc6.d/K08fcron

Contents

The Fcron package contains fcron, fcrontab, fcronsighup and fcrondyn.


Description

fcron

fcron is the scheduling daemon.


fcrontab

fcrontab is the program used to install, edit, list and remove the tables used by fcron.


fcronsighup

fcronsighup instructs fcron to reread the fcron tables.


fcrondyn

fcrondyn is a user tool intended to interact with a running fcron daemon.


hdparm-5.4

Introduction to hdparm

The hdparm package contains a utility that useful for controlling ATA/IDE controllers and hard drives both to increase performance and sometimes to increase stability.

WARNING! As well as being useful, incorrect usage of hdparm can destroy your information and in rare cases, drives. Use with caution and make sure you know what you are doing. If in doubt, we recommend you leave the default kernel parameters alone.


Package information


Installation of hdparm

Install hdparm by running the following commands:

make &&
make install

Note that by default, hdparm is installed in /sbin as some systems may require it during the boot process before /usr is mounted. If you wish to install hdparm under the /usr hierarchy, then replace the above commands with the following:

make &&
make binprefix=/usr install

Contents

The hdparm package contains hdparm.


Description

hdparm

hdparm provides a command-line interface to various hard disk ioctls supported by the stock Linux ATA/IDE device driver subsystem.


which-2.14 and alternatives

The presence / absence of the which program in the main LFS book is probably one of the most contentious issues we have on the mailing lists. It has resulted in at least one flame war in the recent past. To hopefully put an end to this once and for all, we here present two of the options for equipping your system with "which".

The first option is to install the actual GNU program which.


Introduction to which

Package information


Installation of which

Install which by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The which package contains which .


Description

which

which shows the full path of (shell) commands.


The 'which' script

The second option (for those who don't want to install the program) is to create a simple script:

cat > /usr/bin/which << "EOF"
#!/bin/bash
type -p "$@"
EOF
chmod 755 /usr/bin/which
chown root:root /usr/bin/which

This should generally work OK and is probably the easiest solution for boxes which don't need a good user environment to work in.


UnZip-5.50

Introduction to UnZip

The UnZip package contains ZIP extraction utilities. These are useful for extracting files from ZIP archives. ZIP archives are created with PKZIP or Info-ZIP utilities primarily in a DOS environment.


Package information


Installation of UnZip

By default, UnZip does not support shrink decompression. To enable it or to obtain more information, check out the UnZip FAQ at http://www.info-zip.org/pub/infozip/FAQ.html#unshrink.

Install UnZip by running the following commands:

patch -Np1 -i ../unzip-5.50-fix-Makefile.patch &&
patch -Np1 -i ../unzip-5.50-fix-libz.patch &&
patch -Np1 -i ../unzip-5.50-dont-make-noise.patch &&
patch -Np1 -i ../unzip-5.50-dotdot.patch &&
cp unix/Makefile . &&
make prefix=/usr linux &&
make prefix=/usr linux_shlibz &&
make prefix=/usr install &&
cp -a libunzip.so* /usr/lib

Command explanations

make prefix=/usr linux: This command overrides the prefix variable that is set to /usr/local in the Makefile and builds the executables for a linux system. The alternatives to 'linux' can be seen with a 'make list' command.

make prefix=/usr linux_shlibz: Build shared libunzip and link UnZip against it and zlib.


Contents

The UnZip package contains unzip , funzip, unzipfsx, zipgrep and zipinfo.


Description

unzip

unzip lists, tests or extracts files from a ZIP archive.


funzip

funzip allows the output of unzip commands to be redirected.


unzipfsx

unzipfsx is the self-extracting stub that can be prepended to a ZIP archive. Files in this format allow the recipient to decompress the archive without installing UnZip.


zipgrep

zipgrep is a grep for ZIP archives.


zipinfo

zipinfo produces technical information about the files in a ZIP archive, including file access permissions, encryption status, type of compression, etc.


Zip-2.3

Introduction to Zip

The Zip package contains Zip utilities. These are useful for compressing files into ZIP archives.


Package information


Installation of Zip

Install Zip by running the following commands:

cp unix/Makefile . &&
make prefix=/usr generic_gcc &&
make prefix=/usr install

Command explanations

make prefix=/usr generic_gcc: This command overrides the prefix variable that is set to /usr/local in the Makefile and builds the executables for a linux system. The alternatives to 'generic_gcc' can be seen with a 'make list' command.


Contents

The Zip package contains zip , zipcloak, zipnote and zipsplit.


Description

zip

zip compresses files into a ZIP archive.


zipcloak

zipcloak is disabled in this version of Zip. It will display a message about how to support encryption by recompiling with zcrypt27.zip.


zipnote

zipnote reads or writes comments stored in a ZIP file .


zipsplit

zipsplit is a utility to split ZIP files into smaller files.


PCI Utilities-2.1.11

Introduction to PCI Utilities

The PCI Utilities package is a set of programs for listing PCI devices, inspecting their status and setting their configuration registers.


Package information


PCI Utilities dependencies


Installation of PCI Utilities

Install PCI Utilities by running the following commands:

make PREFIX=/usr &&
make PREFIX=/usr install

Contents

The PCI Utilities package contains lspci, setpci and update-pciids.


Description

lspci

lspci is a utility for displaying information about all PCI buses in the system and all devices connected to them.


setpci

setpci is a utility for querying and configuring PCI devices.


update-pciids

update-pciids fetches the current version of the PCI ID list.


pkgconfig-0.15.0

Introduction to pkgconfig

The pkgconfig package contains tools for passing the include path and/or library path to the compiler during the make script.


Package information


Installation of pkgconfig

Install pkgconfig by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring pkgconfig

Add to your system or personal profile:

export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig

The default settings for PKG_CONFIG_PATH are /lib/pkgconfig, /usr/lib/pkgconfig and /usr/local/lib/pkgconfig. These settings are hard-coded and do not have to be exported with the additional paths.


Contents

The pkgconfig package contains pkg-config.


Description

pkg-config

pkg-config is a function that returns meta information for the specified library.


cpio-2.5

Introduction to cpio

The cpio package contains tools for archiving.


Package information


Installation of cpio

Install cpio by running the following commands:

./configure --prefix=/usr --libexec=/usr/sbin \
--bindir=/bin &&
make &&
make install

Command explanations

--libexec=/usr/sbin: This command installs rmt to /usr/sbin instead of /usr/libexec.

--bindir=/bin: This command installs cpio to /bin instead of /usr/bin as per FHS guidelines.


Contents

The cpio package contains cpio , mt and rmt.


Description

cpio

cpio copies files to and from archives.


mt

mt controls magnetic tape drive operations.


rmt

rmt controls remote magnetic tape drive operations.


MC-4.6.0

Introduction to MC

MC (Midnight Commander) is a text-mode full-screen file manager and visual shell. It provides a clear, user-friendly, and somewhat protected interface to a Unix system while making many frequent file operations more efficient and preserving the full power of the command prompt.


Package information


Installation of MC

Install MC by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring MC

Config files

~/.mc/*


Configuration Information

The ~/.mc directory and its contents are created when you start mc for the first time. Then you can edit the main ~/.mc/ini configuration file manually or through the MC shell. Consult the mc(1) man page for details.


Contents

The MC package contains mc, mcedit, mcmfmt and mcview.


Description

mc

mc is a visual shell.


mcedit

mcedit is an internal file editor.


mcview

mcview is an internal file viewer.


Chapter 12. Programming

An LFS is a development system, but only for C, C++ and Perl. This chapter expands the languages available.


Python-2.3.2

Introduction to Python

The Python package contains the Python development environment. This is useful for object-oriented programming, writing scripts, prototyping large programs or developing them entirely.


Package information


Python dependencies


Installation of Python

Install Python by running the following commands:

./configure --prefix=/usr --enable-shared &&
make &&
make install 

Contents

The Python package contains python and pydoc.


Description

python

python is an interpreted, interactive, object-oriented programming language.


pydoc

pydoc is the Python documentation tool.


Perl modules

Introduction to Perl modules

The Perl module packages add useful objects to the Perl language. Modules utilized by packages throughout BLFS are listed here along with their dependencies.


Installation of Perl modules

Install Perl modules by running the following commands:

perl Makefile.PL &&
make &&
make install

Below are installation instructions for modules that happen to be broken at the present time.

Gtk-Perl-0.7008:

perl Makefile.PL --without-guessing &&
make
cp Gtk/Makefile Gtk/Makefile.bak &&
sed '/^OBJECT/s/xs/./g' Gtk/Makefile.bak > Gtk/Makefile &&
cp Gtk/Makefile Gtk/Makefile.bak &&
sed '/^OBJECT/s/build/./g' Gtk/Makefile.bak > Gtk/Makefile &&
make &&
make install

librep-0.16.2

Introduction to librep

The librep package contains a Lisp system. This is useful for scripting or for applications that may use the Lisp interpreter as an extension language.


Package information


librep dependencies

Required

GMP-4.1.2 and GDBM-1.8.3


Optional

readline-4.3


Installation of librep

Install librep by running the following commands:

./configure --prefix=/usr --libexec=/usr/lib --mandir=/usr/share/man \
--infodir=/usr/share/info &&
make &&
make install

Command explanations

--libexec=/usr/lib: This command installs files to /usr/lib/rep instead of /user/libexec/rep.


Contents

The librep package contains rep and librep libraries.


Description

rep

rep is the Lisp interpreter.


librep libraries

librep libraries contain the functions necessary for the Lisp interpreter.


J2SDK-1.4.1

Introduction to j2sdk

The J2SDK package contains Sun's Java development environment. This is useful for developing Java programs and provides the runtime environment necessary to run Java programs. It also includes a plug-in for browsers so that they can be Java aware.

The JDK comes in two flavors, a precompiled binary and a source package. Previously, the plugin included in the JDK binary package was unusable on LFS owing to incompatibilities with GCC-3 compiled browsers. This is not the case anymore.

The source package requires registration at the Sun developer site and accepting the Sun Community Source License. The source code cannot be downloaded from some countries, so for users from those countries, the binary may be the only option.

Even if you plan on compiling the JDK source, you will need to download the binary version to bootstrap the JDK build. Follow the below link to download both source and binary packages. When downloading the source also download the Mozilla headers package available at the same location.


Package information

  • Download (HTTP): http://freshmeat.net/projects/sunjdk

  • Download (FTP):

  • Version used (binary): 1.4.2_01

  • Download size (binary): 59 MB

  • Download size (source): 77 MB

  • Estimated Disk space required: 1810 MB

  • Estimated build time: 85 SBU


J2SDK dependencies


Installation of J2SDK

Both versions will be installed in parallel. You may choose to keep either or both.

Installation of the precompiled JDK is easy, change the executable bit for the downloaded file, change to the directory where you want it installed and execute the downloaded file.

VERSION=1.4.2_01 &&
MV=`echo $VERSION | cut -d "_" -f 1,1` &&
V=`echo ${VERSION} | sed -e "s/\./_/g"` &&
chmod +x j2sdk-${V}-linux-i?86.bin &&
./j2sdk-${V}-linux-i?86.bin &&
cd j2sdk${VERSION} &&
install -d /opt/j2sdk/j2sdk-precompiled-${MV} &&
mv * /opt/j2sdk/j2sdk-precompiled-${MV}

The binary version is now installed.

If you don't want to compile the source or are not in a postition to download the source owing to license restrictions, skip ahead to the configuration section.

Add the recently compiled JDK to the path.

export JAVA_HOME=/opt/j2sdk/j2sdk-precompiled-${MV} &&
export PATH=$PATH:${JAVA_HOME}/bin

Unzip and patch the source:

VERSION=1.4.1 &&
V=`echo $VERSION | sed -e "s/\./_/g"` &&
unzip j2sdk-${V}-src-scsl.zip &&
unzip j2sdk-${V}-mozilla_headers-unix.zip &&
patch -Np1 -i j2sdk-${VERSION}-gcc33-1.patch &&
patch -Np1 -i j2sdk-${VERSION}-fix-intl-files.patch &&
patch -Np1 -i j2sdk-${VERSION}-link-missing-libs.patch &&
patch -Np1 -i j2sdk-${VERSION}-remove-fixed-paths.patch &&
patch -Np1 -i j2sdk-${VERSION}-syntax-fixes.patch &&
patch -Np1 -i j2sdk-${VERSION}-motif-mkmsgcat.patch &&
patch -Np1 -i j2sdk-${VERSION}-use-included-motif.patch

Set some variables which affect the build:

export ALT_BOOTDIR="$JAVA_HOME" &&
unset JAVA_HOME &&
unset CLASSPATH
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
export ALT_DEVTOOLS_PATH="/usr/bin" &&
export BUILD_NUMBER="blfs-`date +%s`" &&
export DEV_ONLY=true &&
export ALT_MOZILLA_PATH=$PWD &&
export INSANE=true &&
export MAKE_VERBOSE=true &&
export ALT_CACERTS_FILE=${ALT_BOOTDIR}/jre/lib/security/cacerts

Additionally, if you would like to make in parallel, add the following (adjust MAKE_PARALLEL to your liking):

export HOTSPOT_BUILD_JOBS=$MAKE_PARALLEL

If the included Motif doesn't build properly, the error is noticed much later in the build. A solution is to build the Motif library before compiling the J2SDK.

cd motif/lib/Xm &&
make &&
cd ../../..

Make and Install J2SDK with the following commands. There will be a lot of messages about missing files that look like errors. As long as the build doesn't stop, the messages are harmless, so ignore them.

cd control/make &&
make &&
cd ../.. &&
cd control/build/linux-i?86 &&
cp -a j2sdk-image /opt/j2sdk/j2sdk-1.4.1

Command explanations

export ALT_BOOTDIR="$JAVA_HOME": This var sets location of the bootstrap JDK.

export ALT_MOZILLA_PATH=$PWD: This sets the variable that points to where you unzipped the Mozilla headers.

export ALT_DEVTOOLS_PATH="/usr/bin": This changes the location where the build finds the needed executables.

export BUILD_NUMBER="blfs-`date +%s`": This will help you identify this compiled version of the runtime environment and virtual machine by appending this information to the version in the output to java -version.

export DEV_ONLY=true: This command eliminates compiling the documentation and eliminates a dependency for rpm.

unset JAVA_HOME: This clears the JAVA_HOME variable as recommended by the build instructions.

unset CLASSPATH: This clears the CLASSPATH variable as per the recommendations in the build instructions.

unset CFLAGS...: These flags cause miscompilation of the build. Never set these.

export INSANE=true: Unless you specify that you are insane the build will not proceed. The certified platform for the build is Redhat 6.1. The above variable ensures that all the errors related to compiling on a non-certified platform will be converted to warnings.

export MAKE_VERBOSE=true: Allows the current compilation command to be displayed on the console.

export ALT_CACERTS_FILE...: Specifies the certificate file to use.


Configuring J2SDK

Configuration Information

We have two Java 2 SDK's installed in /opt/j2sdk. Decide on which one you would like to use as the default. For example if you decide to use the source compiled J2SDK, do the following:

ln -nsf j2sdk-1.4.1 /opt/j2sdk/j2sdk

Add the following lines to your shell startup file (e.g. /etc/profile).

export JAVA_HOME=/opt/j2sdk/j2sdk
export PATH=$PATH:$JAVA_HOME/bin

Add $JAVA_HOME/man to your MANPATH variable or to /etc/man.conf

The Java plugin is in the directory $JAVA_HOME/jre/plugin/i?86/ns610/. Make a symbolic link to the file in that directory from your plugins directory.


Contents

The J2SDK package contains appletviewer, extcheck, idlj, jar, jarsigner, java, javac, javadoc, javah, javap, jdb, keytool, native2ascii, orbd, policytool, rmic, rmid, rmiregistry, rmiregistry, serialver, servertool and tnameserv.


Description

appletviewer

appletviewer runs Java applets outside of the context of a browser.


extcheck

extcheck checks a specified JAR file for title and version conflicts with any extensions installed in the JDK software.


idlj

idlj generates Java bindings from a given IDL file.


jar

jar combines multiple files into a single JAR archive file.


jarsigner

jarsigner signs JAR (Java ARchive) files and verifies the signatures and integrity of a signed JAR.


java

java launches a Java application by starting a Java runtime environment, loading a specified class and invoking that class's main method.


javac

javac reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files.


javadoc

javadoc parses the declarations and documentation comments in a set of Java source files and produces a corresponding set of HTML pages describing the classes, interfaces, constructors, methods, and fields.


javah

javah generates C header and source files that are needed to implement native methods.


javap

javap disassembles a Java class file.


jdb

jdb is a simple command-line debugger for Java classes.


keytool

keytool is a key and certificate management utility.


native2ascii

native2ascii converts files that contain non-supported character encoding into files containing Latin-1 or Unicode-encoded characters.


orbd

orbd is used to enable clients to transparently locate and invoke persistent objects on servers in the CORBA environment.


policytool

policytool creates and manages a policy file graphically.


rmic

rmic generates stub and skeleton class files for remote objects from the names of compiled Java classes that contain remote object implementations.


rmid

rmid starts the activation system daemon.


rmiregistry

rmiregistry creates and starts a remote object registry on the specified port on the current host.


serialver

serialver returns the serialVersionUID for one or more classes in a form suitable for copying into an evolving class.


servertool

servertool provides an ease-of-use interface for application programmers to register, unregister, startup and shutdown a server.


tnameserv

tnameserv starts the Java IDL name server.


Ruby-1.8.0

Introduction to Ruby

The Ruby package contains the Ruby development environment. This is useful for object-oriented scripting.


Package information


Installation of Ruby

Install Ruby by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Ruby package contains ruby and irb.


Description

ruby

ruby is an interpreted scripting language for quick and easy object-oriented programming.


irb

irb is the interactive interface for ruby.


GCC-3.3.1

Introduction to GCC

The GCC package contains GNU compilers. This is useful for compiling programs written in Ada, C, C++, Fortran, Java and Objective C.


Package information


Installation of GCC

If you plan to compile Ada, you will need to install GNAT temporarily to satisfy the circular dependency when you recompile GCC to include Ada.


Package information


GNAT dependencies

Required

Tcsh-6.12.00


Installation of GNAT

Install GNAT by running the following commands:

./doconfig

The above script will ask you how and where you would like to install GNAT. To avoid conflicts with the system gcc, the package will be installed in a separate directory, that can later be removed from the system.

In response to the questions asked by the doconfig script, enter 3 in response to the first question and /opt/gnat in response to the second question.

To finish the install, run

./doinstall

The GNAT compiler can be invoked by executing the gcc binary installed by the above script.


Return to Installation of GCC

Patch the source files with the following command:

patch -Np1 -i ../gcc-3.3.1-no_fixincludes-2.patch &&
patch -Np1 -i ../gcc-3.3.1-suppress-libiberty.patch

Install GCC by running the following commands:

PATH_HOLD=$PATH &&
export PATH=/opt/gnat/bin:$PATH &&
cd gcc/ada &&
touch treeprs.ads [es]info.h nmake.ad[bs] &&
cd ../.. &&
mkdir ../gcc-build &&
cd ../gcc-build &&
CC=/usr/bin/gcc ../gcc-3.3.1/configure --prefix=/usr --enable-shared \
--enable-languages=c,c++,objc,f77,ada,java --enable-threads=posix \
--enable-__cxa_atexit --enable-clocale=gnu &&
make bootstrap &&
make -C gcc gnatlib_and_tools &&
make install &&
ln -sf g77 /usr/bin/f77 &&
export PATH=$PATH_HOLD

You may remove the GNAT installation:

rm -rf /opt/gnat

Command explanations

PATH_HOLD=$PATH: This command stores your current path before it's modified so that it can be restored after installation.

export PATH=/opt/gnat/bin:$PATH: This command allows the build to find GNAT's Ada compiler to build Ada.

touch treeprs.ads [es]info.h nmake.ad[bs]: This command creates necessary files for the Ada build. This step may be skipped if you don't want to compile the Ada front end.

CC=/usr/bin/gcc: This command works around the new PATH which puts GNAT 's gcc as the primary compiler.

--enable-languages=c,c++,objc,f77,ada,java: This command builds all available languages in the GCC package. You may modify this command to remove unwanted languages.

--enable-shared --enable-threads=posix --enable-__cxa_atexit: These commands are required to build the C++ libraries to published standards.

--enable-clocale=gnu: This command is a failsafe for incomplete locale data.

make gnatlib_and tools: This command completes the Ada build process. Skip this step if you have not enabled Ada as one of the languages.


Contents

The GCC package contains c++, c++filt, cpp, g++, g77, gcc, gccbug, gcov, glob, gnat, gnatbind, gnatbl, gnatchop, gnatfind, gnatkr, gnatlink, gnatls, gnatmake, gnatprep, gnatpsta, gnatpsys, gnatxref and >GCC libraries.


Description

The programs and libraries whose descriptions are missing here have been described in the LFS GCC-3.3.1 page.


g77

g77 is the Fortran compiler invoked by gcc.


add2line

add2line converts the ASCII form of the 2-line orbital elements in a file to binary form and appends them to the orbdata files.


gcov

gcov is a test coverage program.


gdb

gdb is the GNAT debugger.


gnatbind

gnatbind is used to bind compiled objects.


gnatbl

gnatbl is the Ada linker.


gnatchop

gnatchop is useful for renaming files to meet the standard Ada default file naming conventions.


gnatelim

gnatelim is used to detect and eliminate unused subprograms in an Ada partition.


gnatfind

gnatfind is the GNAT definition/use finder.


gnatgcc

gnatgcc is the compiler.


gnathtml.pl

gnathtml.pl converts Ada source files to HTML for viewing in Web browsers.


gnatkr

gnatkr is used to determine the crunched name for a given file, when crunched to a specified maximum length.


gnatlink

gnatlink is used to link programs and build an executable file.


gnatls

gnatls is the compiled unit browser.


gnatemake

gnatmake is an automatic make facility.


gnatmem

gnatmem is the GNAT utility that monitors dynamic allocation and deallocation activity in a program.


gnatprep

gnatprep is the GNAT external preprocessor.


gnatpsta

gnatpsta determines the values of all the relevant parameters in Standard and outputs to stdout.


gnatpsys

gnatpsys determines the values of all the relevant parameters in System and outputs to stdout.


gnatstub

gnatstub is a generator of body stubs.


gnatxref

gnatxref is the GNAT cross-referencer.


gvd

gvd is the GNU Visual Debugger.


Tcl-8.4.4

Introduction to Tcl

The Tcl package contains Tool Command Language.


Package information


Installation of Tcl

Install Tcl by running the following commands:

VERSION=8.4.4 &&
V=`echo $VERSION | cut -d "." -f 1,2` &&
DIR=$PWD &&
cd unix &&
./configure --prefix=/usr &&
make &&
sed -i "s:${DIR}/unix:/usr/lib:" tclConfig.sh &&
sed -i "s:${DIR}:/usr/include/tcl${V}:" tclConfig.sh &&
sed -i "s,^TCL_LIB_FILE='libtcl${V}..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl${V}\$\{TCL_DBGX\}.so\"," tclConfig.sh &&
make install &&
install -d /usr/include/tcl${V}/unix &&
install -m644 *.h /usr/include/tcl${V}/unix/ &&
install -d /usr/include/tcl${V}/generic &&
install -c -m644 ../generic/*.h /usr/include/tcl${V}/generic/ &&
rm -f /usr/include/tcl${V}/generic/{tcl,tclDecls,tclPlatDecls}.h &&
ln -nsf /usr/include/tcl${V} /usr/lib/tcl${V}/include &&
ln -sf libtcl${V}.so /usr/lib/libtcl.so &&
ln -sf tclsh${V} /usr/bin/tclsh

Command explanations

sed -i ...: The Tcl package assumes that the source that is used to build Tcl is always kept around for compiling packages that depend on Tcl. These sed's remove the reference to the build directory and replace them by saner system wide locations.

install ...: These commands install the internal headers into a system-wide location.

ln -sf ...: These commands create compatibility symbolic links.


Tk-8.4.4

Introduction to Tk

The Tk package contains TCL GUI Toolkit.


Package information


Tk dependencies


Installation of Tk

Install Tk by running the following commands:

VERSION=8.4.4 &&
V=`echo $VERSION | cut -d "." -f 1,2` &&
DIR=$PWD &&
cd unix &&
./configure --prefix=/usr &&
make &&
sed -i "s:${DIR}/unix:/usr/lib:" tkConfig.sh &&
sed -i "s:${DIR}:/usr/include/tk${V}:" tkConfig.sh &&
make install &&
install -d /usr/include/tk${V}/unix &&
install -m644 *.h /usr/include/tk${V}/unix/ &&
install -d /usr/include/tk${V}/generic &&
install -m644 ../generic/*.h /usr/include/tk${V}/generic/ &&
rm -f /usr/include/tk${V}/generic/{tk,tkDecls,tkPlatDecls}.h &&
ln -nsf /usr/include/tk${V} /usr/lib/tk${V}/include &&
ln -sf libtk${V}.so /usr/lib/libtk.so &&
ln -sf wish${V} /usr/bin/wish

Command explanations

sed -i ...: The Tk package assumes that the source that is used to build Tk is always kept around for compiling packages that depend on Tk. These sed's remove the reference to the build directory and replace them by saner system wide locations.

install ...: These commands install the internal headers into a system-wide location.

ln -sf ...: These commands create compatibility symbolic links.


GCC-2.95.3

Introduction to GCC-2.95.3

There are two reasons for installing GCC-2.95.3. The first is that the kernel developers have certified GCC-2.95.3 as the preferred compiler for compiling the kernel. The other (and more compelling reason) is that some commercial closed-source packages (such as Netscape Navigator, Yahoo Pager) and precompiled packages (such as Mozilla) are linked against GCC-2.95.3 libs.


Package information


Installation of GCC

Apply the patches:

patch -Np1 -i ../gcc-2.95.3-2.patch &&
patch -Np1 -i ../gcc-2.95.3-no-fixinc.patch &&
patch -Np1 -i ../gcc-2.95.3-returntype-fix.patch

The GCC development team recommends building in a separate directory.

mkdir ../gcc-build &&
cd ../gcc-build

Configure GCC to build the C and C++ compilers and enable the related C++ options.

../gcc-2.95.3/configure \
--prefix=/opt/gcc-2.95.3 \
--enable-shared --enable-languages=c,c++ \
--enable-threads=posix

Compile and install GCC:

make bootstrap &&
make install

Make note of the library that is installed.

L=`find /opt/gcc-2.95.3/lib -name "*libstdc++*.so" -type f` &&
IL=`basename $L`

Move the C++ libraries to the standard lib directory to avoid having to add /opt/gcc-2.95.3/lib to /etc/ld.so.conf.

for i in /opt/gcc-2.95.3/lib/*.so*; do mv -f $i /usr/lib;
ln -sf /usr/lib/`basename $i` /opt/gcc-2.95.3/lib; done

Create symlinks required by commercial and precompiled packages.

ln -sf $IL /usr/lib/libstdc++-libc6.1-1.so.2 &&
ln -sf $IL /usr/lib/libstdc++-libc6.2-2.so.3 &&
ln -sf $IL /usr/lib/libstdc++-libc6.3-2.so.3

Configuring GCC

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.

The instructions given above make compatibility symlinks that pre-compiled packages in BLFS require. You may create additional compatibility links based on your requirements.

If you only need the GCC-2.95.3 libraries, you may delete /opt/gcc-2.95.3.

Whenever you need to use GCC-2.95.3 instead of you system installed compiler, add /opt/gcc-2.95.3/bin to the front of your PATH or (preferably) set the CC environment variable before compiling the concerned package.


Contents

The GCC-2.95.3 package contains the gcc-2.95.3 C and C++ compilers and GCC-2.95.3 libstdc++.so that is required by some commercial and pre-compiled packages.


NASM-0.98.38

Introduction to NASM

NASM (Netwide Assembler) is an 80x86 assembler designed for portability and modularity. It includes a disassembler as well.


Package information


Installation of NASM

Install NASM by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The NASM package contains nasm and ndisasm programs.


Description

nasm

nasm is a portable 80x86 assembler.


ndisasm

ndisasm is an 80x86 binary file disassembler.

IV. Connecting to a Network

The LFS book covers setting up networking by connecting to a LAN with a static IP. There are other methods used to connect to LAN's and other networks (such as the Internet). We cover the most popular methods in this chapter.


Chapter 13. Dial-up networking

PPP-2.4.1

Introduction to PPP

The PPP package contains the pppd daemon and the chat program. This is used for connecting to other machines; often for connecting to the Internet via a dial-up connection to an ISP.


Package information


Additional downloads


Installation of PPP

Note: PPP support must be compiled into the kernel or available as a kernel module.

If you need PPPoE related patch, apply it:

patch -Np1 -i ../ppp-2.4.1-pppoe-5.patch

Install PPP by running the following commands:

./configure &&
make &&
make install

Configuring PPP

Config files

/etc/ppp/*


Configuration Information

The PPP daemon itself requires very little configuration. The main trick is scripting the connection. This can be done either using the chat program which comes with this package or by using WvDial-1.53.


Contents

The PPP package contains the chat, pppd, pppdump and pppstats programs.


Description

chat

The chat program defines a conversational exchange between the computer and the modem. Its primary purpose is to establish the connection between the Point-to-Point Protocol Daemon (PPPD) and the remote's pppd process.


pppd

pppd is the Point to Point Protocol daemon.


pppdump

pppdump is used to convert PPP record files to a readable format.


pppstats

pppstats is used to print PPP statistics.


WvDial-1.53

Introduction to WvDial

The WvDial package contains a no nonsense, quick and easy to use alternative to chat and pppd scripts. If you simply want to dial a modem without the fuss and hassle of chat issues, then you'll want this.


Package information


WvDial dependencies


Installation of WvDial

Install WvDial by running the following commands:

make PREFIX=/usr &&
make PREFIX=/usr install

Configuring WvDial

Config files

/etc/wvdial.conf, /etc/ppp/peers/*


Configuration Information

touch /etc/wvdial.conf &&
wvdialconf /etc/wvdial.conf

wvdialconf will test that you have a working modem and try to determine it's exact setup. You will then need to enter your ISP's phone number, login name and password into the /etc/wvdial.conf file.

You then start wvdial with:

wvdial

For more information examine the wvdialconf, wvdial.conf and wvdial man pages.


Contents

The WvDial package contains the wvdial and wvdialconf programs.


Description

wvdial

Starts a PPP connection.


wvdialconf

Automates the configuration of wvdial.


Chapter 14. DHCP Clients

DHCP stands for Dynamic Host Configuration Protocol. It is a protocol which is used by many sites to automatically provide information such as IP addresses, subnet masks and routing information to computers. If your network uses DHCP, you will need a DHCP client in order to connect to it. DHCP is also used by some cable modems.

We currently provide installation instructions for two DHCP clients, dhclient (from the dhcp package) and dhcpcd. We begin with a page which shows how to alter the LFS boot scripts for generic DHCP support. We then present the two sets of installation instructions which also discuss how to create an appropriate configuration file to work with the DHCP client of your choice.


Configuring the LFS bootscripts to support DHCP clients

Config files

/etc/sysconfig/network, /etc/sysconfig/network-devices/ifup-eth0, /etc/sysconfig/network-devices/ifdown-eth0, /etc/sysconfig/network-devices/ifconfig.eth0


Configuration Information

Note that on this and the following pages, we use eth0 as the example interface. If you want to configure a different (or more than one) interface, simply replace eth0 with the interface you wish to use.

These instructions will convert the configuration files from LFS (a static configuration) to a configuration using the DHCP protocol. Note that static and DHCP-based interfaces can co-exist on a LFS system. To do this, you should only make the alterations to those interfaces which need to support DHCP. All of the instructions on this page are applicable no matter which DHCP client you intend to use.

If the interface you intend to use as your default gateway is going to use DHCP, the first step is to remove the GATEWAY and GATEWAY_IF variables from /etc/sysconfig/network. This will only need to be done once.

cd /etc/sysconfig &&
cp network network.bak &&
sed "s/GATEWAY/# GATEWAY/" network.bak > network

You then need to create scripts which will override the default network scripts and provide DHCP support. These two scripts are generic and so for use with both DHCP clients. First, the ifup-eth0 script:

cat > /etc/sysconfig/network-devices/ifup-eth0 << "EOF" 
#!/bin/sh

source /etc/sysconfig/rc || exit
source $rc_functions || exit
source $network_devices/ifconfig.eth0 || exit

echo "Bringing up the eth0 interface..."
modprobe eth0
loadproc $DHCP_PROG $DHCP_START
EOF

Then the ifdown-eth0 script:

cat > /etc/sysconfig/network-devices/ifdown-eth0 << "EOF" 
#!/bin/sh

source /etc/sysconfig/rc || exit
source $rc_functions || exit
source $network_devices/ifconfig.eth0 || exit

echo "Bringing down the eth0 interface..."
$DHCP_PROG $DHCP_STOP
evaluate_retval
EOF

Finally, we need to make these scripts executable:

chmod 755 /etc/sysconfig/network-devices/ifup-eth0 &&
chmod 755 /etc/sysconfig/network-devices/ifdown-eth0

DHCP-3.0pl2

The DHCP package comes with both a client (called dhclient) and a server program for using DHCP. If you want to install this package, the instructions can be found at DHCP-3.0pl2. Note that if you only want to use the client, you do not need to run the server and so do not need the startup script and links provided for the server daemon. You only need to run the DHCP server if you're providing this service to a network, and it's likely that you'll know if that's the case; if it isn't, don't run the server! Once you have installed the package, return here for information on how to configure the client (dhclient).

To configure dhclient, you need to create two files, /etc/sysconfig/network-devices/ifconfig.eth0 and /etc/dhclient.conf.

First, create the ifconfig.eth0 file with the following commands (note that this will overwrite any existing file):

cd /etc/sysconfig/network-devices &&
cat > /etc/sysconfig/network-devices/ifconfig.eth0 << "EOF"
ONBOOT=yes
DHCP_PROG=/sbin/dhclient
DHCP_START=<appropriate start parameters>
DHCP_STOP=-r
EOF

For more information on the appropriate DHCP_START and DHCP_STOP values, examine the man page for dhclient.

Next, you should then create the /etc/dhclient.conf using the following command:

cat > /etc/dhclient.conf << "EOF"
# dhclient.conf

interface "eth0"{
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;
}
# end dhclient.conf
EOF

dhcpcd-1.3.22-pl4

Introduction to dhcpcd

The dhcpcd package contains the dhcpcd client. This is useful for connecting your computer to a network which uses DHCP to assign network addresses.


Package information


Installation of dhcpcd

Install dhcpcd by running the following commands:

patch -Np1 -i ../dhcpcd-1.3.22-pl4-fhs.patch &&
./configure --prefix="" --sysconfdir=/var/lib \
--mandir=/usr/share/man &&
make &&
make install

Command explanations

patch -Np1 -i ../dhcpcd-1.3.22-pl4-fhs.patch : Dhcpcd unpatched puts all configuration and temporary files in /etc/dhcpc. This becomes very annoying when dhcpcd tells you it's running and it's not. You look in /var/run for the PID file, but it's not there, the PID file that needs deleting is in /etc/dhcpc. This patch brings this program into FHS compliance, but more importantly, puts files where you expect them to be.

--prefix="": There may be a good reason for abandoning the normal BLFS convention of using --prefix=/usr here. If you are installing DHCP, it is likely that it is required during the boot process and /usr may be network mounted in which case, dhcpcd wouldn't be available due to being on the network! Therefore, depending on your situation, you may want it to be installed in /sbin or /usr/sbin. This command installs to /sbin.

--sysconfdir=/var/lib: This command install configuration files in the /var/lib directory.

--mandir=/usr/share/man: This command install the man pages to the /usr/share/man directory.


Configuring dhcpcd

Config files

/var/lib/dhcpc/*


Configuration Information

To configure dhcpcd, create the ifconfig.eth0 file with the following commands (note that this will overwrite any existing file):

cd /etc/sysconfig/network-devices &&
cat > ifconfig.eth0 << "EOF"
ONBOOT=yes
DHCP_PROG=/sbin/dhcpcd
DHCP_START=<appropriate start parameters>
DHCP_STOP=-k
EOF

For more information on the appropriate DHCP_START and DHCP_STOP values, examine the man page for dhcpcd.


Contents

The dhcpcd package contains dhcpcd.


Description

dhcpcd

dhcpcd is an implementation of the DHCP client specified in RFC2131 and RFC1541 (depending on which options are specified).


Chapter 15. Other Connections

Other methods to connect to large networks are through ISDN and PPPoE interfaces, among others. PPPoE is discussed here. Pages written for ISDN (or others as the need arises) are always welcome and will be included in future books, if available.


RP-PPPoE-3.5

Introduction to RP-PPPoE

The Roaring Penguin PPPoE package contains both a client and a server component that works with the client. The client allows you to connect to large networks that use the PPPoE protocol, common among ADSL providers. The server component runs alongside the client, allowing you to configure other clients that send out a configuration request.


Package information


RP-PPPoE dependencies

Required

PPP-2.4.1


Installation of RP-PPPoE

If you plan on using demand dialing, or kernel mode PPPoE, confirm that you have applied the patch during installation of PPP-2.4.1. Additional information about kernel mode PPPoE can be found in rp-pppoe-3.5/doc/KERNEL-MODE-PPPOE.

Install RP-PPPoE by running the following commands:

cd src &&
./configure &&
make &&
make install

Command explanations

These are the standard installation commands that will install into the /usr prefix. You can optionally use the go script in the root of the source tree, to run the same commands, which are then immediately followed by the adsl-setup script.


Configuring RP-PPPoE

Config files

/etc/ppp/pppoe.conf, /etc/ppp/firewall-standalone, /etc/ppp/firewall-masq, /etc/ppp/pppoe-server-options, /etc/resolv.conf, /etc/ppp/pap-seecrets, /etc/ppp/chap-secrets


Configuration Information

To configure RP-PPPoE after installation, you should run the adsl-setup script.

When configuring your connection, you will need to have your ISP's nameserver information available, as well as your username and password. You will also be asked whether to configure a dial-on-demand or a constant connection. If your service provider does not charge by the minute, it is usually good to have a bootscript handle the connection for you. You can, of course, choose not to install the following script, and start your connection manually with the adsl-start script.

Use the following commands to create the optional adsl bootscript:

cat > /etc/rc.d/init.d/adsl << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/adsl

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# adsl script written by DJ Lucas  - dj@lucasit.com

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Bringing up the ADSL interface..."
                /usr/sbin/adsl-start
                evaluate_retval
                ;;

        stop)
                echo "Bringing down the ADSL interface..."
                /usr/sbin/adsl-stop
                evaluate_retval
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                /usr/sbin/adsl-status
                ;;

        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/adsl
EOF
chmod 755 /etc/rc.d/init.d/adsl

Now create the necessary symlinks:

ln -sf ../init.d/adsl /etc/rc.d/rc0.d/K49adsl &&
ln -sf ../init.d/adsl /etc/rc.d/rc1.d/K49adsl &&
ln -sf ../init.d/adsl /etc/rc.d/rc2.d/K49adsl &&
ln -sf ../init.d/adsl /etc/rc.d/rc3.d/S24adsl &&
ln -sf ../init.d/adsl /etc/rc.d/rc4.d/S24adsl &&
ln -sf ../init.d/adsl /etc/rc.d/rc5.d/S24adsl &&
ln -sf ../init.d/adsl /etc/rc.d/rc6.d/K49adsl

Contents

The RP-PPPoE package contains adsl-setup, adsl-start, adsl-status, adsl-stop, pppoe, pppoe-relay, pppoe-server and pppoe-sniff.


Description

adsl-setup

A script for configuring the client. Configuration is then stored in /etc/ppp/pppoe.conf.


adsl-start

adsl-start starts the client using the options specified in /etc/ppp/pppoe.conf.


adsl-status

adsl-status displays the status of the ADSL connection.


adsl-stop

adsl-stop stops the client.


pppoe

This is the client itself. Generally it should not be started on its own.


pppoe-relay

pppoe-relay starts the server relay agent.


pppoe-server

pppoe-server starts the server component.


pppoe-sniff

A small network sniffer designed to assist in setting PPPOE_EXTRA settings.


Chapter 16. Networking Libraries

These applications are support libraries for other applications in the book. It is unlikely that you would just install these libraries, you will generally find that you will be referred to this chapter to satisfy a dependency of other applications.


cURL-7.10.7

Introduction to cURL

The cURL package contains curl and its support library. This is useful for transferring files with URL syntax. For example, curl http://curl.haxx.se/download/curl-7.10.7.tar.gz > curl-7.10.7.tar.gz would download this program's TAR ball to the current directory. This ability to both download and redirect files can be incorporated into other programs to support functions like streaming media.


Package information


cURL dependencies


Installation of cURL

Install cURL by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The cURL package contains curl, curl-config and the libcurl libraries.


Description

curl

curl is a client that can get documents from or send documents to any of the following protocols: HTTP, HTTPS (needs OpenSSL-0.9.7c), FTP, GOPHER, DICT, TELNET, LDAP (needs OpenLDAP-2.1.22) or FILE.


curl-config

curl-config prints information about the last compile, like libraries linked to and prefix setting.


curl library

libcurl provides the functionality of curl to other programs.


WvStreams-3.70

Introduction to WvStreams

The WvStreams package contains the network programming libraries. These are needed to compile wvdial.


Package information


WvStreams dependencies


Installation of WvStreams

Install WvStreams by running the following commands:

patch -Np1 -i ../wvstreams-3.70-wvcrypto.patch &&
patch -Np1 -i ../wvstreams-3.70-wvresolver.patch &&
make PREFIX=/usr LDFLAGS="-lcrypt" &&
make PREFIX=/usr install

Command explanations

make PREFIX=/usr LDFLAGS="-lcrypt": This fixes libwvstreams' issues with OpenSSL's crypto library.


Configuring WvStreams

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The WvStreams package contains the libwvcrypto, libwvstreams and libwvutils libraries.


Description

libwvcrypto

libwvcrypto defines streams with built-in cryptography.


libwvstreams

libwvstreams defines the basic properties of a stream.


libwvutils

libwvutils contains fundamental support utilities.


GNet-2.0.4

Introduction to GNet

The GNet package contains a simple network library. This is useful for supporting TCP sockets, UDP and IP multicast, asynchronous DNS lookup, and more.


Package information


GNet dependencies

Required

GLib-2.2.3


Installation of GNet

Install GNet by running the following commands:

./configure --prefix=/usr  &&
make &&
make install

Contents

The GNet package contains libgnet libraries.


libsoup-1.99.23

Introduction to libsoup

The libsoup package contains an HTTP library implementation in C. This is useful for accessing HTTP servers in a completely asynchronous mode.


Package information


libsoup dependencies


Installation of libsoup

Install libsoup by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libsoup package contains libsoup libraries.


Description

libsoup libraries

libsoup libraries provide functions for asynchronous HTTP connections.


Chapter 17. Text Web Browsers

People who are new to Unix-based systems tend to ask the question "Why on earth would I want a text-mode browser? I'm going to compile X and use Konqueror/Mozilla/Whatever!". Those who have been around systems for a while know that when (not if) you manage to mess up your graphical browser install and you need to look up some information on the web, a console based browser will save you. Also, there are quite a few people who prefer to use one of these browsers as their principle method of browsing; either to avoid the clutter and bandwidth which accompanies images or because they may use a text-to-speech synthesizer which can read the page to them (of use for instance to partially sighted or blind users). We currently have installation instructions for three console web browsers:


Links-2.1pre11

Introduction to Links

Links is a text and graphics mode WWW browser. It includes support for rendering tables and frames, features background downloads, can display colors and has many other features.


Package information


Installation of Links

Install Links by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Command explanations

--enable-graphics: Add this switch if you want to use Links in graphics mode. You will also need to enable frame buffer support in your kernel and install GPM-1.20.1 or install one of the supported graphics libraries.


Configuring Links

Config files

~/.links/*


Configuration Information

Links stores its configuration in per-user files in the ~/.links directory. These files are created automatically when links is run.


Contents

The Links package contains links.


Description

links

links is a text and graphics mode WWW browser.


Lynx-2.8.4

Introduction to Lynx

Lynx is a text based web browser.


Package information


Lynx dependencies


Installation of Lynx

Install Lynx by running the following commands.

./configure --prefix=/usr --libdir=/etc --with-ssl --with-zlib &&
make &&
make install &&
make DOCDIR=/usr/share/doc/lynx-2.8.4/lynx_doc \
   HELPDIR=/usr/share/doc/lynx-2.8.4/lynx_help install-doc &&
make DOCDIR=/usr/share/doc/lynx-2.8.4/lynx_doc \
   HELPDIR=/usr/share/doc/lynx-2.8.4/lynx_help install-help &&
sed s/"t\/etc"/"t\/usr\/share\/doc\/lynx\-2\.8\.4"/ \
   /etc/lynx.cfg > /etc/lynx.bak &&
mv /etc/lynx.bak /etc/lynx.cfg

Command explanations

--libdir=/etc: For some reason, the configure and make routine for lynx uses libdir as the prefix for the configuration file. We set this to /etc so that the system wide configuration file is /etc/lynx.cfg.

--with-ssl: This enables support for linking SSL into lynx.

--with-zlib: This enables support for linking zlib into Lynx.

DOCDIR=... HELPDIR=...: We set these variables to avoid getting the help and documentation files installed under /etc.

sed... mv /etc/lynx.bak /etc/lynx.cfg: This sed command changes the /etc/lynx.cfg file so it looks for the help files in the correct place.


Configuring Lynx

Config files

/etc/lynx.cfg


Configuration Information

Various settings such as proxies can be set in the system-wide lynx.cfg file found in /etc.


Contents

The Lynx package contains lynx .


Description

lynx

lynx is a general purpose, text-based, distributed information browser for the World Wide Web.


w3m-0.4.1

Introduction to w3m

w3m is primarily a pager but it can also be used as a text-mode WWW browser.


Package information


Installation of w3m

We configure w3m to use the "monster" model, which includes color, menu, mouse, cookie, and SSL support. Other models include:

baby   - bare minimum
little - color and menu support
mouse  - color, menu, and mouse support
cookie - color, menu, mouse, and cookie support

Install w3m by running the following commands:

./configure -yes -lang=en -model=monster -prefix=/usr &&
make &&
make install

Command explanations

./configure -yes: Set all parameters to their default values.

-lang=en: Set the default language to English.

-model=monster: This sets the build model to monster. Alternative build models are discussed above.


Contents

The w3m package contains w3m and w3mman.


Description

w3m

w3m is a text based web browser and pager.


w3mman

w3mman is an interface to the on-line reference manuals in w3m.


Chapter 18. Basic Networking Programs

These applications are generally client applications used to access the appropriate server across the building or across the world. Tcpwrappers and portmap are support programs for daemons that you may have running on your machine.


NcFTP-3.1.6

Introduction to NcFTP

The NcFTP package contains a powerful and flexible interface to the Internet standard File Transfer Protocol. It is intended to replace or supplement the stock ftp program.


Package information


Installation of NcFTP

There are two ways to build NcFTP. The first (and optimal) way, builds most of the functionality as a shared library and then builds and installs the program linked against this library. The second method simply links all of the functionality into the binary statically. This doesn't make the dynamic library available for linking by other applications. You need to choose which method best suits you. Note that the second method does not create an entirely statically linked binary; only the libncftp parts are statically linked in, in this case. Be aware that building and using the shared library is covered by the Clarified Artistic License; however, developing applications that utilize the shared library is subject to a different license.

To install NcFTP using the first (and optimal) method, run the following commands:

./configure --prefix=/usr &&
cd libncftp &&
make shared &&
make soinstall &&
cd .. &&
make &&
make install

To install NcFTP using the second method (with the libncftp functionality linked in statically) run the following commands:

./configure --prefix=/usr &&
make &&
make install

Command explanations

cd libncftp && 
make shared && 
make soinstall
These commands make and install the dynamic library libncftp which is then used to link against when compiling the main program.


Configuring NcFTP

Config files

~/.ncftp/*; especially ~/.ncftp/prefs_v3


Configuration Information

Most NcFTP configuration is done while in the program and the configuration files are dealt with automatically. One exception to this is ~/.ncftp/prefs_v3. There are various options to alter in there, including:

yes-i-know-about-NcFTPd=yes
This disables the splash screen advertising the NcFTPd server.

There are other options in the prefs_v3 file. Most of these are self-explanatory.


Contents

The NcFTP package contains ncftp, ncftpbatch , ncftpbookmarks, ncftpget, ncftpls, ncftpput and ncftpspooler.


Description

ncftp

A browser program for File Transfer Protocol.


ncftpbatch

Individual batch FTP job processor.


ncftpbookmarks

NcFTP Bookmark Editor (NCurses-based).


ncftpget

Internet file transfer program for scripts.


ncftpls

Internet file transfer program for scripts.


ncftpput

Internet file transfer program for scripts.


ncftpspooler

Global batch FTP job processor daemon.


OpenSSH-3.7.1p2 client

The ssh client is a secure replacement for telnet. If you want to install it, the instructions can be found in Chapter 23 - OpenSSH-3.7.1p2. Note that if you only want to use the client, you do not need to run the server and so do not need the startup script and links. In accordance with good practice, only run the server if you actually need it (and if you don't know whether you need it or not, it's likely that you don't!).


rsync-2.5.6 client

rsync is a utility for fast incremental file transfers. If you want to install it, the instructions can be found in Chapter 23 - rsync-2.5.6. Note that if you only want to use the client, you do not need to run the server and so do not need the startup script and links. In accordance with good practice, only run the server if you actually need it (and if you don't know whether you need it or not, it's likely that you don't!).


CVS-1.11.6

Introduction to CVS

CVS is the concurrent versioning system. This is useful for projects on which multiple people are working or where archives of previous versions of files need to be kept.


Package information


Installation of CVS

Install cvs by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring CVS

Config files

~/.cvsrc, ~/.cvswrappers


Configuration Information

~/.cvsrc is the main CVS configuration file. This file is used by users to specify defaults for different cvs commands, for example to make all cvs diff commands run with -u, a user would add diff -u to their .cvsrc file.

~/.cvswrappers specifies wrappers to be used in addition to those specified in the CVSROOT/cvswrappers file in the repository.


Contents

The CVS package contains cvs, cvsbug and rcs2log .


Description

cvs

This is the main program file for the concurrent versioning system.


cvsbug

This is used to send problem reports about CVS to a central support site.


rcs2log

RCS to Change Log generator.


Wget-1.8.2

Introduction to Wget

The Wget package contains a utility useful for non-interactive downloading of files from the Web.


Package information


Wget dependencies


Installation of Wget

Install Wget by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

--prefix=/usr ": This compiles and installs wget into the /usr hierarchy instead of /usr/local.

--sysconfigdir=/etc: This relocates the configuration file from /usr/etc to /etc.


Configuring Wget

Config files

/etc/wgetrc, ~/.wgetrc

There are no required changes in these files.


Contents

The Wget package contains wget.


Description

wget

wget retrieves files from the Web using the HTTP, HTTPS and FTP protocols. It is designed to be non-interactive, for background or unattended operations.


tcpwrappers-7.6

Introduction to tcpwrappers

The tcpwrappers package provides daemon wrapper programs that report the name of the client requesting network services and the requested service.


Package information


Installation of tcpwrappers

Install tcpwrappers with the following commands:

patch -Np1 -i ../tcp_wrappers_7.6.diff &&
make REAL_DAEMON_DIR=/usr/sbin linux &&
cp libwrap.a /usr/lib &&
cp tcpd.h /usr/include &&
cp safe_finger /usr/sbin &&
cp tcpd /usr/sbin &&
cp tcpdchk /usr/sbin &&
cp tcpdmatch /usr/sbin &&
cp try-from /usr/sbin &&
cp -av *.3 /usr/share/man/man3 &&
cp -av *.5 /usr/share/man/man5 &&
cp -av *.8 /usr/share/man/man8

Command explanations

patch -Np1 -i ../tcp_wrappers_7.6.diff: This patch alters the original path and logging facility of the original tcpwrappers program.


Configuring tcpwrappers

Config files

/etc/hosts.allow, /etc/hosts.deny

File protections: the wrapper, all files used by the wrapper, and all directories in the path leading to those files, should be accessible but not writable for unprivileged users (mode 755 or mode 555). Do not install the wrapper set-uid.

Then perform the following edits on the /etc/inetd.conf configuration file:
finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerd
becomes:
finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd

Note: The finger server is used as an example here.

Similar changes must be made if xinetd is used, with the emphasis being on calling /usr/sbin/tcpd instead of calling the service daemon directly, and passing the name of the service daemon to tcpd.


Contents

The tcpwrappers package contains tcpd, tcpdchk, tcpdmatch, try-from and safe_finger.


Description

tcpd

tcpd is the main access control daemon for all Internet services, which inetd or xinetd will run instead of running the requested service daemon.


tcpdchk

tcpdchk is a tool to examine a tcpd wrapper configuration and report problems with it.


tcpdmatch

tcpdmatch is used to predict how the tcp wrapper would handle a specific request for a service.


try-from

try-from can be called via a remote shell command to find out if the host name and address are properly recognized.


safe_finger

safe_finger is a wrapper for the finger utility, to provide automatic reverse name lookups.


portmap-5

Introduction to portmap

The portmap package is a more secure replacement for the original SUN portmap package. Portmap is used to forward RPC requests to RPC daemons such as NFS and NIS.


Package information


portmap dependencies


Installation of portmap

Install portmap with the following commands:

patch -Np1 -i ../portmap_5-1.diff &&
patch -Np1 -i ../portmap_5-errno.patch &&
mkdir /usr/share/doc/portmap &&
make &&
make install

Command explanations

patch -Np1 -i ../portmap_5-1.diff: This patch provides added security for the portmap package, including only allowing portmap table changes from the local host.

mkdir /usr/share/doc/portmap: This directory must be created before installation.


Configuring portmap

Config files

/etc/rc.d/init.d/portmap


Create the portmap boot script

cat > /etc/rc.d/init.d/portmap << "EOF"
#!/bin/sh
# Begin /etc/rc.d/init.d/portmap

source /etc/rc.d/init.d/functions

case "$1" in
        start)
                echo "Starting RPC Portmap"
                loadproc /sbin/portmap
                ;;

        stop)
                echo "Stopping Portmap"
                killproc /sbin/portmap
                ;;

        restart)
                $0 stop
                /bin/sleep 1
                $0 start
                ;;

        *)
                echo "Usage: $0 {start|stop|restart}"
                exit 1
        ;;

esac

# End /etc/rc.d/init.d/portmap
EOF
chmod 754 /etc/rc.d/init.d/portmap &&
cd /etc/rc.d/init.d &&
ln -sf ../init.d/portmap ../rc0.d/K49portmap &&
ln -sf ../init.d/portmap ../rc1.d/K49portmap &&
ln -sf ../init.d/portmap ../rc2.d/K49portmap &&
ln -sf ../init.d/portmap ../rc3.d/S22portmap &&
ln -sf ../init.d/portmap ../rc4.d/S22portmap &&
ln -sf ../init.d/portmap ../rc5.d/S22portmap &&
ln -sf ../init.d/portmap ../rc6.d/K49portmap

Contents

The portmap package contains portmap, pmap_dump and pmap_set.


Description

portmap

portmap is the RPC port mapper.


pmap_dump

pmap_dump saves the port mapping table to an ASCII file.


pmap_set

pmap_set restores the port mapping table from an ASCII file.


Inetutils-1.4.2

Introduction to Inetutils

The Inetutils package contains network clients and servers. Inetutils installation in LFS lacks installation of the various servers that are included in the package. The instructions in BLFS removes this deficiency.


Package information


Inetutils dependencies


Installation of Inetutils

Install Inetutils by running the following commands:

./configure --prefix=/usr --disable-syslogd \
	--libexecdir=/usr/sbin --infodir=/usr/share/info \
    --sysconfdir=/etc --localstatedir=/var \
	--mandir=/usr/share/man --with-wrap &&
make &&
make install &&
mv /usr/bin/ping /bin

Command explanations

--disable-syslogd: This switch prevents Inetutils installing a System Log Daemon, which is installed in the LFS Book.

--with-wrap: This switch makes Inetutils compile against tcp-wrappers. Omit this option if you didn't install tcp-wrappers.

--disable-whois: This switch will prevent Inetutils installing a WhoIs client, since the included whois client is out of date. Add this option if you plan on installing Whois-4.6.7.

--with-pam: This switch makes Inetutils compile against for Linux-PAM . Add this option if you want to utilize PAM.

--disable-servers: Some of the servers included with Inetutils are insecure in nature and in some cases better alternative exist. You can choose this switch and enable only the servers you want to avoid installing unneeded servers.


Contents

The Inetutils package contains network clients and servers.


Description

ftp

ftp is a ARPANET file transfer client.


logger

logger make entries in the system log.


ping

ping sends ICMP ECHO_REQUEST packets to network hosts.


rcp

rcp is a remote file copy client.


rlogin

rlogin is a remote login client.


rsh

rsh is a remote shell client.


syslogd

syslogd logs systems messages.


talk

talk allows communication between users.


telnet

telnet is a user interface to the TELNET protocol.


tftp

tftp is a trivial file transfer program.


whois

whois is a client for the whois directory service.


ftpd

ftpd is a DARPA Internet File Transfer Protocol server.


inetd

inetd is a Internet super-server.


rexecd

rexcd is a remote execution server.


rlogind

rlogind is a remote login server.


rshd

rshd is a remote shell server.


talkd

talkd is a remote user communication server.


telnetd

telnetd is a DARPA TELNET protocol server.


tftpd

tftpd is a Internet Trivial File Transfer Protocol server.


uucpd

No description available.


NCPFS-2.2.3

Introduction to NCPFS

The NCPFS package contains client and administration tools for use with Novell networks.


Package information


Installation of NCPFS

Install NCPFS by running the following commands:

./configure --prefix=/usr --includedir=/usr/include \
    --mandir=/usr/share/man --datadir=/usr/share &&
make &&
make install &&
make install-dev


Command explanations

--prefix="": installs binaries on the root partition so that they are available at boot time. This may not be ideal for all systems. If /usr is mounted locally, --prefix=/usr may be a better option.

--includedir=/usr/include: Tells configure to look in /usr/include for header files. It also tells make to install NCPFS's headers here.

--mandir=/usr/share/man: installs the man pages in the correct location.

--datadir=/usr/share: correctly installs the locale files to /usr/share/.

Note: If you do not need to use the IPX protocol, or you use a different IPX package, you can optionally pass --disable-ipx and/or --disable-ipx-tools to the configure script to disable these options.


Configuring NCPFS

Config files

~/.nwclient


Configuration Information

A config file ~/.nwclient should be placed in the home directory of each user that intends to use ncpfs . The permissions on this file should be set to 600, for obvious security reasons. The configuration file should contain a single line per server that the user will use. Each line should contain the server name, the user name, and optionally the password. Below is a sample .nwclient file.

# Begin example ~/.nwclient config file

Server1/User1 Password
Server2/User1 
Server2/Guest1 -

# End example .nwclient config file

The syntax for the .nwclient file is simple, server_name/user_name password. Be extremely careful when creating or editing this file as the client utilities are very picky about syntax. There should always be a space immediately after the username. If this space is substituted by a tab or multiple spaces, you will not get the expected results when attempting to use the NCPFS tools. If no password is supplied, the client utilities will ask for a password when it is needed. If no password is needed, for instance when using a guest account, a single '-' should be put in place of a password.

It should be noted that the ncpmount is not intended to mount individual volumes because each mount point creates a separate client connection to the Novell server. Mounting each individual volume separately would be unwise, as mounting all volumes on a server under one mount point uses only one client connection.

If you need to set up the IPX protocol at boot, you can create the following scripts. These scripts assume IPX will be set up on eth0 and the network frame type is 802.2. You should confirm that these are the correct settings and adjust as necessary.

cat > /etc/sysconfig/network-devices/ifup-ipx0 << "EOF"
#!/bin/sh
# Begin /etc/sysconfig/network-devices/ifup-ipx0

source /etc/sysconfig/rc || exit
source $rc_functions || exit

echo "Setting up the IPX protocol on eth0..."
/bin/ipx_interface add eth0 802.2 &&
/bin/ipx_configure --auto_interface=on --auto_primary=on
evaluate_retval

# End /etc/sysconfig/network-devices/ifup-ipx0
EOF
cat > /etc/sysconfig/network-devices/ifdown-ipx0 << "EOF"
#!/bin/sh
# Begin /etc/sysconfig/network-devices/ifdown-ipx0

source /etc/sysconfig/rc || exit
source $rc_functions || exit

echo "Stopping IPX on the eth0 interface..."
/bin/ipx_configure --auto_interface=off --auto_primary=off &&
/bin/ipx_interface del eth0 802.2
evaluate_retval

# End /etc/sysconfig/network-devices/ifdown-ipx0
EOF
echo "ONBOOT=yes" > /etc/sysconfig/network-devices/ifconfig.ipx0
chmod 755 /etc/sysconfig/network-devices/ifup-ipx0
chmod 755 /etc/sysconfig/network-devices/ifdown-ipx0

Contents

  • Client Utilities: ncpmount, ncpumount, nprint, nsend, nwpasswd, nwsfind, pqlist, pqrm, pqstat, and slist.

  • Server Admin Utilities: ncopy, nwbocreate, nwbols, nwboprops, nwborm, nwbpadd, nwbpcreate, nwbprm, nwbpset, nwbpvalues, nwdir, nwdpvalues, nwfsctrl, nwfsinfo, nwfstime, nwgrant, nwpurge, nwrevoke, nwrights, nwtrustee, nwtrustee2, nwuserlist, amd nwvolinfo.

  • IPX Interface Utilities: ipx_cmd, ipx_configure, ipx_interface, ipx_internal_net, and ipx_route.

  • Other Utilities: ncpmap and nwauth.


NTP-4.1.2

Introduction to NTP

The NTP package contains a client and server to keep the time synchronized between various computers over a network. This package is the official reference implementation of the NTP protocol.


Package information


NTP dependencies

Optional

readline-4.3


Installation of NTP

Install NTP by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring NTP

Config files

/etc/ntp.conf


Configuration Information

The following configuration file defines various NTP servers to use with the primary server designated with the prefer tag. It also creates a drift file where ntpd stores the frequency offset. Since the documentation included with the package is sparse, visit the NTP website at http://www.ntp.org/ for more information.

server time-a.nist.gov prefer
server time-b.nist.gov
server tick.usno.navy.mil
driftfile /var/cache/ntp.drift

Synchronizing the time

There are two options. Option one is to use run ntpd continuously and allow it to synchronize the time in a gradual manner. The other option is to run ntpd periodically (using cron) and update the time each time ntpd is scheduled.

If you choose Option one, then create the bootscript /etc/rc.d/init.d/ntp and put the start and stop symlinks:

#!/bin/bash
# Begin $rc_base/init.d/ntp
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
        start)
                echo "Starting ntpd..."
                loadproc ntpd
                ;;
        stop)
                echo "Stopping ntpd..."
                killproc ntpd
                ;;
        restart)
                $0 stop
                sleep 1
                $0 start
                ;;
        status)
                statusproc ntpd
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac
# End $rc_base/init.d/ntp

If you prefer to start ntpd periodically, add the following command to the root's crontab:

ntpd -q

Contents

The NTP package contains NTP protocol client and server.


Description

ntpd: NTP daemon that runs in the background and keeps the date/time synchronized based on response from configured NTP servers. It also functions as a NTP server.

ntpdate: NTP Client program that sets the date/time based on the response from an NTP Server. This command is deprecated.

ntp-genkeys: This program generates cryptographic data files used by the NTPv4 authentication and identification schemes. a ARPANET file transfer client.

ntpdc and ntpq: Programs to query and set ntpd configuration.

ntptrace: Trace a chain of NTP servers back to the primary source.


Chapter 19. Basic Networking Utilities

This chapter contains some tools that come in handy when the network need some investigating.


Traceroute-1.4a12

Introduction to Traceroute

The Traceroute package contains a program which is used to display the network route that packets take to reach a specified host. This is a standard network troubleshooting tool. If you find yourself unable to connect to another system, traceroute can help pinpoint the problem.


Package information


Installation of Traceroute

Install Traceroute by running the following commands:

cp Makefile.in Makefile.in.bak &&
sed 's/-o bin/-o root/' Makefile.in.bak > Makefile.in &&
./configure --prefix=/usr &&
make &&
make install &&
make install-man

Command explanations

sed 's/-o bin/-o root/'...
Adjusts the Makefile so that the program is installed with user root instead of user bin (which doesn't exist on a default LFS system).

make install: Installs traceroute with UID set to root in the /usr/sbin directory. This makes it possible for all users to execute traceroute. For absolute security, turn off the SUID bit in traceroute's file permissions with the command:
chmod 0755 /usr/sbin/traceroute

The risk is that if a security problem such as a buffer overflow were ever found in the Traceroute code, a regular user on your system could gain root access if the program is SUID root. Removing the SUID permission of course also makes it impossible for users other than root to utilize traceroute, so decide what's right for your individual situation.

Now, to be completely FHS compliant, as is our aim, if you do leave the traceroute binary SUID root, then you should move traceroute to /usr/bin with the following command:
mv /usr/sbin/traceroute /usr/bin

This ensures that the binary is in the path for non-root users.


Contents

The Traceroute package contains traceroute.


Description

traceroute

traceroute does basically what it says: it traces the route your packets take from the host you are working on to another host on a network, showing all the intermediate steps (routers) along the way.


Nmap-3.30

Introduction to Nmap

Nmap is a utility for network exploration and security auditing. It supports ping scanning, port scanning and TCP/IP fingerprinting.


Package information


Nmap dependencies

Optional

GTK+-1.2.10 (for building the front-end)


Installation of Nmap

Install Nmap by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Nmap package contains nmap.


Description

nmap

nmap is a utility for network exploration and security auditing. It supports ping scanning, port scanning and TCP/IP fingerprinting.


Whois-4.6.7

Introduction to Whois

Whois is a client-side application which queries the whois directory service for information pertaining to a particular domain name.


Package information


Installation of Whois

Install Whois by running the following commands:

make &&
make prefix=/usr install

Contents

The Whois package contains whois .


Description

whois

whois is a client-side application which queries the whois directory service for information pertaining to a particular domain name.


BIND Utilities-9.2.2

Introduction to BIND Utilities

BIND Utilities is not a separate package, it is a collection of the client side programs that are included with BIND-9.2.2. The BIND package includes client side programs such as nslookup, dig and host. If you install BIND server, these programs will be installed automatically. This section is for those users who don't need the complete BIND server, but need these client side applications.


Package information


Installation of BIND Utilities

Install BIND Utilities by running the following commands:

./configure --prefix=/usr &&
make -C lib/dns &&
make -C lib/isc &&
make -C bin/dig &&
make -C bin/dig install

Command explanations

make -C lib/...
Build the libs that are needed for the client programs.

make -C bin/dig
Build the client programs.


Contents

The BIND Utilities package contains dig, host and nslookup.


Chapter 20. Mail/News Clients

Mail Clients help us retrieve (Fetchmail), sort (Procmail), read and compose responses (Nail, Mutt, Pine, Kmail, Balsa, Evolution, Mozilla) to email.

News clients also help us retrieve, sort, read and compose responses, but these messages travel through USENET (a worldwide bulletin board system) using the Network News Transfer Protocol (NNTP).


Nail-10.5

Introduction to Nail

The Nail package contains a command-line Mail User Agent that is compatible with the mail command available in commercial Unix versions. The mail command is useful for writing scripts.


Package information


Nail dependencies


Installation of Nail

Install Nail by running the following commands. (Note: If you would like nail to be linked against openssl , add --with-opensslto the configure command mentioned below.)

./configure --prefix=/usr &&
make &&
make install &&
ln -sf nail /usr/bin/mail

Configuring Nail

Config files

/etc/nail.rc


Contents

The Nail package contains nail , a program compatible with mail found on commercial Unix versions.


Description

nail

nail is a command-line mail user agent.


Procmail-3.22

Introduction to Procmail

The Procmail package contains an autonomous mail processor. This is useful for filtering and sorting incoming mail.


Package information


Installation of Procmail

Install Procmail by running the following commands:

make BASENAME=/usr install &&
make install-suid

Command explanations

BASENAME=/usr: The equivalent of ./configure --prefix=/usr on other package installations.

make install-suid: Modifies permissions of the installed files.


Configuring Procmail

Config files

/etc/procmailrc, ~/.procmailrc


Configuration Information

Recipes have to be written and placed in your ~/.procmailrc for execution. The procmailex man page is the starting place to learn how to write recipes.


Contents

The Procmail package contains procmail, formail, lockfile and mailstat.


Description

procmail

procmail is an autonomous mail processor. It performs all the functions of a MDA (Mail Delivery Agent).


formail

formail is a filter that can be used to format mail into mailbox format.


lockfile

lockfile is a utility that can lock a file for single use interactively or in a script.


mailstat

mailstat prints a summary report of mail that has been filtered by procmail since the last time mailstat was ran.


Fetchmail-6.2.3

Introduction to Fetchmail

The Fetchmail package contains the a mail retrieval program. "It retrieves mail from remote mail servers and forwards it to your local (client) machine's delivery system, so it can then be read by normal mail user agents."


Package information


Fetchmail dependencies

Required

OpenSSL-0.9.7c and a local MDA (Procmail-3.22)


Installation of Fetchmail

Install Fetchmail by running the following commands:

./configure --prefix=/usr --with-ssl --enable-fallback=procmail &&
make &&
make install

Command explanations

--with-ssl: This enables SSL if found, so that you can handle connections to secure POP3 and IMAP servers.

--enable-fallback=procmail: This tells Fetchmail to hand incoming mail to Procmail for delivery if your port 25 mail server is not present or not responding.


Configuring Fetchmail

Config files

~/.fetchmailrc


Configuration Information

set logfile /var/log/fetchmail.log
set no bouncemail
set postmaster root

poll SERVERNAME :
    user "username" pass "password";
    mda "/usr/bin/procmail -f %F -d %T";

Is an example configuration that should suffice for most people. You can add as many users and servers as you need using the same syntax.

man fetchmail: Look for the section near the bottom named CONFIGURATION EXAMPLES it gives some quick examples too. There are countless other config options once you get used to it.


Contents

The Fetchmail package contains fetchmail and fetchmailconf.


Description

fetchmail

When executed as a user, this will source that users ~/.fetchmailrc and download the appropriate mail. When run as root, users who have a .fetchmailrc will have their mail downloaded and delivered accordingly.


fetchmailconf

This program provides a Tk GUI interface to your ~/.fetchmailrc making it much easier to configure. However you will require, Python, and it must have the Tkinker module available.


Mutt-1.4.1i

Introduction to Mutt

The Mutt package contains a Mail User Agent. This is useful for reading, writing, replying, saving, and deleting your email.


Package information


Mutt dependencies

Optional

GnuPG-1.2.3


Installation of Mutt

Mutt requires a group named 'mail'. You can add this group, if it does not exist, with this command:

groupadd mail

If you did not install a MTA, such as Postfix-2.0.16 or Sendmail-8.12.10, you need to modify the ownership of /var/mail with this command:

chgrp mail /var/mail

Install Mutt by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

--sysconfdir=/etc: This installs the configuration files into /etc instead of /usr/etc.


Configuring Mutt

Config files

/etc/Muttrc, ~/.muttrc, /etc/mime.types, ~/.mime.types


Configuration Information

No changes in these files are necessary to begin using Mutt. When you are ready to make changes, the man page for muttrc is a good starting place.

In order to utilize GnuPG, use the following command:

cat /usr/share/doc/mutt/samples/gpg.rc >>
~/.muttrc

Contents

The Mutt package contains mutt, flea, muttbug, mutt_dotlock, pgpwrap and pgpring.


Description

mutt

mutt is a Mail User Agent (MUA) which enables you to read, write and delete your email.


flea

flea is a bug submitter for Mutt.


muttbug

muttbug is a script that executes flea.


mutt_dotlock

mutt_dotlock implements the mail spool file lock.


pgpwrap

No description available.


pgpring

No description available.


Pine-4.56

Introduction to Pine

The Pine package contains the Pine Mail User Agent and several server daemons for various mail protocols, in addition to some nice file and directory editing/browsing programs.


Package information


Pine dependencies


Optional

OpenLDAP-2.1.22 and Keberos5


Installation of Pine

Install Pine by running the following commands:

patch -Np1 -i ../pine-4.56-fhs.patch &&
./build slx  MAILSPOOL='/var/mail' \
SSLDIR=/usr SSLCERTS=/etc/ssl/certs &&
cp doc/pine.1 doc/pico.1 doc/rpdump.1 doc/rpload.1  /usr/share/man/man1 &&    
cd bin &&
install pine imapd ipop2d ipop3d mailutil mtest pico pilot rpdump \
rpload /usr/bin

Command explanations

patch -Np1 -i ../pine-4.56-fhs.patch: This patch will make Pine use /etc for configuration files.

The build procedure for Pine is somewhat unusual, in that options usually passed as ./configure options or housed in $CFLAGS must all be passed on the command line to the ./build script.

./build slx: Pine offers quite a few target platforms, slx specifies Linux using -lcrypt to get the crypt function. See the doc/pine-ports file for more information and other authentication options.

MAILSPOOL='/var/mail': Location of mail spool files, /var/mail.

cd bin &&
install pine imapd ipop2d ipop3d mailutil mtest pico pilot rpdump \
rpload /usr/bin
This installs Pine.


Configuring Pine

Config files

~/.pinerc


Configuration Information

The pine executable needs no global configuration to use. Users set Pine options in ~/.pinerc using an internal configuration menu.


Contents

The Pine package contains pine, pico, pilot, imapd, ipop2d, ipop3d, mtest, rpload and rpdump.


Description

pine

pine is the Pine mail user agent.


pico

pico is a stand-alone editor, similar to the Pine internal message composer.


pilot

pilot is a file and directory navigator and browser.


imapd

imapd is the IMAP server daemon.


ipop2d

ipop2d is an IMAP to POP2 conversion server.


ipop3d

ipop3d is an IMAP to POP3 conversion server.


mtest

mtest is a minimal IMAP mail user agent, used for debugging.


rpload

rpload is the Pine remote data utility, used to convert local Pine configuration files or address books into remote configurations or address books.


rpdump

rpdump is used to copy data from remote Pine configuration files or address books into a local file.


slrn-0.9.7.4

Introduction to slrn

slrn is a slang-based news reader, capable of reading local news spools as well as groups from an NNTP server. Small local news spools can also be created with the use of the slrnpull program included in the slrn distribution.


Package information


slrn dependencies

Required

slang-1.4.9 and MTA (See Chapter 22)


Installation of slrn

Install slrn by running the following commands:

./configure --prefix=/usr --with-slrnpull &&
make LDFLAGS="-ldl" &&
make install

Command explanations

./configure --prefix=/usr: Specify /usr to install to instead of /usr/local.

./configure --with-slrnpull: Build the slrnpull executable.


Configuring slrn

Config files

$HOME/.jnewsrc, $HOME/.jnewsrc.time, $HOME/.slrnrc


Configuration Information

The first time slrn is run, the $HOME/.jnewsrc file must be created. Create the $HOME/.jnewsrc file with the following command:

slrn -f $HOME/.jnewsrc --create

Contents

The slrn package contains slrn and slrnpull.


Description

slrn

slrn is the slang-based news reader.


slrnpull

slrnpull is used to pull a small news feed from an NNTP server for offline reading.


Other Mail and News programs

Pan-0.14.2 is an GTK2 based newsreader program.

KNode is a Qt based newsreader program from kdenetwork-3.1.4.

KMail is a Qt based mail client from kdenetwork-3.1.4.

Balsa-2.0.14 is an GTK2 based mail client.

Mozilla-1.4 includes both a mail client and newsreader in its installation along with notes for installing Mozilla Thunderbird, a mail/news client based on the Mozilla code base.

Evolution-1.4.4 includes an GTK2 based mail client.


Chapter 21. D.J. Bernstein's Utilities

This chapter includes applications needed for the qmail server. Their installation instructions are different than most packages in the book because we want to support the FHS throughout the book.


daemontools-0.76

Introduction to daemontools

The daemontools package is a replacement for inetd or xinetd. The main reason for using it here is because it is recommended for use with qmail and djbdns.


Package information


Installation of daemontools

Install daemontools by running the following commands:

cd admin/daemontools-0.76 && 
patch -Np1 -i ../../daemontools-0.76-errno.patch &&
package/compile &&
cd package && 
sed 's|command|usr/sbin|' boot.inittab > boot.inittab~ && 
mv boot.inittab~ boot.inittab &&
cd ../command &&
sed -e 's|/command:/usr/local/bin:/usr/local/sbin:||' \
    -e 's|command|usr/sbin|' \
    -e 's|/service|/etc/service|g' svscanboot > svscanboot~ &&
mv svscanboot~ svscanboot &&
chmod 555 svscanboot &&
cp * /usr/sbin &&
cd ../package && 
cat /etc/inittab boot.inittab > /etc/inittab~ && 
mv -f /etc/inittab~ /etc/inittab && 
mkdir /etc/service &&
telinit Q

Command explanations

The first thing to understand in installing any package written by Daniel J. Bernstein, and this includes qmail, djbdns and ucspi-tcp in addition to daemontools, is that he is willing to completely disregard standards if his idea of the correct thing to do differs from an particular standard. Professor Bernstein is a standards body unto himself when it comes to his own software.

It is therefore necessary to make quite a few changes to the installation commands for his packages to get them to install in a manner that is compliant with the Filesystem Hierarchy Standard (FHS). Most of the following commands are due to this difficulty.

cd admin/daemontools-0.76: First off, the package is unpacked in an admin directory. You will find the actual packages two directory levels below this.

package/compile: This command actually compiles the source and prepares the binaries.

Since we are installing the binaries in /usr/sbin rather than creating a non-standard /command directory, several paths have to be changed:

sed 's|command|usr/sbin|' boot.inittab > boot.inittab~
mv boot.inittab~ boot.inittab

In boot.inittab, /command/svscanboot is changed to /usr/sbin/svscanboot.

sed -e 's|/command:/usr/local/bin:/usr/local/sbin:||' \
    -e 's|command|usr/sbin|' \
    -e 's|/service|/etc/service|g' svscanboot > svscanboot~ &&

Here various paths are adjusted in the svscanboot script. In our setup svscan will check the /etc/service directory instead of the /service directory for daemons to run.

cp * /usr/sbin: We must manually copy the binaries to the /usr/sbin directory.

cat /etc/inittab boot.inittab > /etc/inittab~
mv -f /etc/inittab~ /etc/inittab
These commands append a line to /etc/inittab so that init will launch the svscanboot script.

mkdir /etc/service: This command creates the daemontools control directory, which - even if empty - needs to exist for daemontools to run properly.

telinit Q: This command tells the init process to re-read its configuration file (inittab) and act upon any changes that have been made. The svscanboot script is started.


Contents

The daemontools package contains svscanboot, svscan, supervise, svc, svok, svstat, fghack, pgrphack, readproctitle, multilog, tai64n, tai64nlocal, setuidgid, envuidgid, envdir, softlimit and setlock. More detailed descriptions of these commands may be found at http://cr.yp.to/daemontools.html.


Description

svscanboot

svscanboot is simply a script that calls svscan and pipes its output to readproctitle.


svscan

svscan checks the service directory for daemons to run and starts a supervise process for each run script that it finds.


supervise

supervise runs the run script passed to it by svscan and monitors the process the script starts so that if it dies, supervise restarts it.


svc

svc sends signals to processes being run under supervise.


svok

svok checks to see that supervise is running in the directory passed to it.


svstat

svstat prints the status of processes monitored by supervise.


fghack

fghack prevents processes from putting themselves into the background.


pgrphack

pgrphack runs a process in a separate process group.


readproctitle

readproctitle displays log entries in the output of ps.


multilog

multilog is a logging program. It takes output from a daemon and appends it to any number of logs.


tai64n

tai64n is a timestamp generating program.


tai64nlocal

tai64nlocal converts output of tai64n into a human readable format.


setuidgid

setuidgid runs a specified program under a given account's UID and GID.


envuidgid

envuidgid performs the same function as setuidgid, but sets environment variables UID and GID equal to the UID and GID of the account specified.


envdir

envdir runs a given program with environment variables specified by files in a directory.


softlimit

softlimit allows resource limits to be set for a given program.


setlock

setlock locks a file and runs a program.


daemontools-man-0.76

Introduction to daemontools-man

The daemontools package does not come with man pages, so install this package if you want online help with the daemontools programs.


Package information


Installation of daemontools-man

Install daemontools-man by running the following commands:

cd daemontools-man && 
gzip -9 *.8 &&
package/compile &&
cp *.8.gz /usr/share/man/man8/

Command explanations

gzip -9 *.8: You can compress the man pages to save space, but it isn't needed for the man pages to work.


Contents

The daemontools-man package contains man pages for the daemontools commands envdir, envuidgid, fghack, multilog, pgrphack, readproctitle, setlock, setuidgid, softlimit, supervise, svc, svok, svscan, svscanboot, svstat, tai64n and tai64nlocal.


ucspi-tcp-0.88

Introduction to ucspi-tcp

The ucspi-tcp package consists of a suite of tools that allow the easy creation of client-server tcp daemons. tcpserver is a more secure alternative to inetd. It has built in functionality for rule based access control, and will gracefully defer connections when the configurable maximum load is reached, unlike inetd. tcpserver is also recommended for use with qmail, and was written by the same author.


Package information


Installation of ucspi-tcp

Install ucspi-tcp by running the following commands:

patch -Np1 -i ../ucspi-tcp-0.88-errno.patch &&
sed 's|/usr/local|/usr|' conf-home > conf-home~ &&
mv conf-home~ conf-home &&
sed 's/bin/sbin/' hier.c > hier.c~ &&
mv hier.c~ hier.c &&
make &&
make setup check

Command explanations

sed 's|/usr/local|/usr|' conf-home > conf-home~
mv conf-home~ conf-home
sed 's/bin/sbin/' hier.c > hier.c~
mv hier.c~ hier.c
These commands change the installation directory to /usr/sbin from the default of /usr/local/bin. Since these tools are used in conjunction with daemons, they don't make much sense in general user directories. However, some of the example programs and the tcpclient program might be of use to non-root users. If you wish to make these available, then we would suggest installing as above, and then executing the following commands:
cd /usr/sbin mv tcpclient *@ mconnect delcr addcr tcpcat /usr/bin
This will place the client related programs into /usr/bin for general use.


Contents

The ucspi-tcp package contains tcpserver, tcprules, tcprulescheck, argv0, fixcrio, recordio, rblsmtpd, tcpclient, who@, date@, finger@, http@, tcpcat, mconnect, addcr and delcr

You can also find detailed descriptions of each of these programs at http://cr.yp.to/ucspi-tcp/tcpserver.html, but here is a brief summary:


Description

tcpserver

tcpserver listens for incoming TCP connections on a given port, and runs a program of your choosing in response to a connection.


tcprules

tcprules compiles rules that govern access control for tcpserver into a fast access database format.


tcprulescheck

tcprulescheck makes it possible to see how tcpserver will react to connections from a given address without actually having to connect via that address. This is useful for checking to see if the access control rules you are using are doing what you expected.


argv0

argv0 runs a given program with a specified 0th argument.


fixcrio

fixcrio inserts carriage returns at the end of lines when they are missing.


recordio

recordio records all input and output of a program given as an argument.


rblsmtpd

rblsmtpd is a spam blocking program that works in conjunction with your SMTP daemon and tcpserver .


tcpclient

tcpclient creates a connection to a TCP port for a given program.


who@

who@ is a demonstration program using tcpclient that has the functionality of the rwho program. It requires a server running sysstat on port 11.


date@

date@ is a demonstration program using tcpclient that will return the system time of a remote host which is running a daytime service on port 13.


finger@

finger@ is a demonstration program using tcpclient that mimics the functionality of the finger program. It requires a server running fingerd on port 79.


http@

http@ downloads web pages from web servers.


tcpcat

tcpcat connects to a TCP port and prints all that is returned from the port.


mconnect

mconnect connects to a TCP port, delivers any input specified to the port, and prints any output from the port.


addcr

addcr adds carriage returns to files. This and delcr are useful for converting between Windows to Unix file formats.


delcr

delcr removes carriage returns from files.

VI. Server Networking


Chapter 22. Mail Server Software

MTAs are the programs which transport mail from one machine to the other. The traditional MTA is sendmail however there are several other choices.

As well as SMTP servers there is a POP server (qpopper) and an IMAP server (Courier-IMAP).


Postfix-2.0.16

Introduction to Postfix

The Postfix package contains a Mail Transport Agent (MTA). This is useful for sending email to other users of your host machine. It can also be configured to be a central mail server for your domain, a mail relay agent or simply a mail delivery agent to your local Internet Service Provider (ISP).


Package information


Postfix dependencies


Installation of Postfix

Before you compile the program, you need to create users and groups that will be expected to be in place when the install script executes. Add the users and groups with the following commands:

groupadd postfix &&
groupadd postdrop &&
groupadd -g 65534 nogroup &&
useradd -c postfix -d /dev/null -g postfix -s /bin/false postfix &&
useradd -c nobody -d /home -g nogroup -s /bin/bash -u 65534 nobody &&
chown postfix:postfix /var/mail

Install postfix by running the following commands:

make &&
sh postfix-install daemon_directory=/usr/sbin \
                   manpage_directory=/usr/share/man \
                   sample_directory=/usr/share/doc/postfix \
                   -non-interactive

The final installation step is to install the program's documentation with this command:

cp -rf html/* /usr/share/doc/postfix

Command explanations

sh postfix-install ... -non-interactive : We don't want the install script to ask any questions so we call it with a non-interactive switch and accept default destination directories in all but three cases.


Configuring Postfix

Config files

/etc/aliases, /etc/postfix/main.cf and /etc/postfix/master.cf


Configuration Information

cat > /etc/aliases << "EOF"
# Begin /etc/aliases

MAILER-DAEMON:    postmaster
postmaster:       root

root:             LOGIN
# End /etc/aliases
EOF

The /etc/aliases file that was just created, the main.cf and the master.cf must be personalized for your system. The aliases file needs your non-root login identity so mail addressed to root can be forwarded to you at the user level. The main.cf file needs your fully qualified hostname. All of these edits can be done with sed commands entered into the console with appropriate substitutions of your non-root login name for [user] and your fully qualified hostname for [localhost.localdomain]. You will find the main.cf file is self documenting, so load it into your editor to make the changes you need for your situation.

cp /etc/aliases /etc/aliases.bak
cp /etc/postfix/main.cf /etc/postfix/main.cf.bak
cp /etc/postfix/master.cf /etc/postfix/master.cf.bak
sed "s/LOGIN/[user]/" /etc/aliases.bak > /etc/aliases
sed "s/#myhostname = host.domain.tld/myhostname = \ 
	[localhost.localdomain]/" \
	/etc/postfix/main.cf.bak > /etc/postfix/main.cf
/usr/bin/newaliases
/usr/sbin/postfix start

Postfix init.d script

To automate the running of Postfix, use following command to create the init.d script:

cat > /etc/rc.d/init.d/postfix << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/postfix

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in

        start)
        echo "Starting Postfix..."
        loadproc postfix start
        ;;

        stop)
        echo "Stopping Postfix..."
        loadproc postfix stop
        ;;
		
        reload)
        echo "Reloading Postfix..."
        loadproc postfix reload
        ;;

        restart)
        $0 stop
        sleep 1
        $0 start
        ;;

        *)
        echo "Usage: $0 {start|stop|reload|restart}"
        exit 1
        ;;
esac

# End $rc_base/init.d/postfix
EOF
chmod 755 /etc/rc.d/init.d/postfix

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/postfix ../rc0.d/K25postfix &&
ln -sf ../init.d/postfix ../rc1.d/K25postfix &&
ln -sf ../init.d/postfix ../rc2.d/K25postfix &&
ln -sf ../init.d/postfix ../rc3.d/S35postfix &&
ln -sf ../init.d/postfix ../rc4.d/S35postfix &&
ln -sf ../init.d/postfix ../rc5.d/S35postfix &&
ln -sf ../init.d/postfix ../rc6.d/K25postfix

Contents

The Postfix package contains bounce , cleanup, error, flush, lmtp, local, mailq, master, newaliases, nqmgr, pickup, pipe, postalias, postcat, postconf, postdrop, postfix, postkick, postlock, postlog, postmap, postqueue, postsuper, qmgr, qmqpd, sendmail, showq, smtp, smtpd, spawn, trivial-rewrite, and virtual.


Description

postfix

postfix is the program that starts and stops the mail delivery system.


master

master is the resident process that runs bounce, cleanup, error, flush, lmtp, local, nqmgr, pickup, pipe, qmgr, qmqpd, showq, smtp, smtpd, spawn, trivial-rewrite and virtual on demand. These programs are not designed to work as user commands.


postqueue

postqueue implements the Postfix user interface for queue management. It implements all the operations that are traditionally available via the sendmail command.


sendmail

sendmail implements the Postfix to Sendmail compatibility interface. mailq and newaliases are symlinks to sendmail.


showq

showq will emulate the mailq command when the Postfix mail system is not running.


postsuper

postsuper does maintenance jobs on the Postfix queue.


postalias

postalias creates, queries or updates Postfix alias databases.


postcat

postcat prints the contents of a Postfix queue file in human-readable form.


postconf

postconf prints or changes the value of configuration parameters.


postdrop

postdrop creates a file in the maildrop directory and copies its standard input to the file.


postkick

postkick makes the mail system private IPC accessible for use in shell scripts.


postlock

postlock locks a file for exclusive access and executes a command on that file.


postlog

postlog implements a logging interface for use in shell scripts.


postmap

postmap creates, queries or updates Postfix lookup tables.


qmail-1.03

Introduction to qmail

The qmail package contains Dan Bernstein's Mail Transport Agent (MTA). qmail provides local and remote mail delivery/relaying.


Package information


Installation of qmail

qmail needs certain user and group account to be added before installation of the software. Add the users and groups with the following commands:

mkdir /var/qmail &&
groupadd nofiles &&
useradd -g nofiles -d /var/qmail/alias alias &&
useradd -g nofiles -d /var/qmail qmaild &&
useradd -g nofiles -d /var/qmail qmaill &&
useradd -g nofiles -d /var/qmail qmailp &&
groupadd qmail &&
useradd -g qmail -d /var/qmail qmailq &&
useradd -g qmail -d /var/qmail qmailr &&
useradd -g qmail -d /var/qmail qmails

Install qmail by running the following commands:

patch -Np1 -i ../qmail-1.03.errno.patch &&
make setup check &&
./config-fast `hostname` &&
cd /var/qmail &&
touch .qmail-postmaster .qmail-mailer-daemon .qmail-root &&
chmod 644 .qmail-* &&
ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail &&
mv /var/qmail/boot/home /var/qmail/rc &&
for mandir in 1 5 7 8; do mv /var/qmail/man/man$mandir/* \
    /usr/man/man$mandir; done &&
rm -rf /var/qmail/man

Configuring qmail

Config files

/etc/inetd.conf and boot scripts


Configuration Information

If inetd is used, the following command will add the qmaild entry to /etc/inetd.conf:

echo "smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env \
tcp-env /var/qmail/bin/qmail-smtpd" >> /etc/inetd.conf

If xinetd is used, the following command will add the qmaild entry to /etc/xinetd.conf:

cat >> /etc/xinetd.conf << "EOF"
service smtp
{
    disable = no
    identifier              = smtp-local
    socket_type             = stream
    protocol                = tcp
    wait                    = no
    user                    = qmaild
    server                  = /var/qmail/bin/tcp-env
    server_args             = /var/qmail/bin/qmail-smtpd
    env                     = RELAYCLIENT=
    only_from               = 127.0.0.1
    log_on_failture         += USERID
}
EOF

To automate the running of qmail, use following command to create the init.d script:

cat > /etc/rc.d/init.d/qmail << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/qmail

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in

        start)
        echo "Starting Qmail..."
	/var/qmail/rc &
        ;;

        stop)
        echo "Stopping Qmail..."
        killall qmail-send
        ;;
		
        restart)
        $0 stop
        sleep 1
        $0 start
        ;;

        *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac

# End $rc_base/init.d/qmail
EOF
chmod 755 /etc/rc.d/init.d/qmail

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/qmail ../rc0.d/K25qmail &&
ln -sf ../init.d/qmail ../rc1.d/K25qmail &&
ln -sf ../init.d/qmail ../rc2.d/K25qmail &&
ln -sf ../init.d/qmail ../rc3.d/S35qmail &&
ln -sf ../init.d/qmail ../rc4.d/S35qmail &&
ln -sf ../init.d/qmail ../rc5.d/S35qmail &&
ln -sf ../init.d/qmail ../rc6.d/K25qmail

Configuring mailers to work with qmail

Configuration information for some commonly used MUAs can be found in the /var/qmail/doc/INSTALL.mbox file. Most MUAs can be configured to use qmail Mailbox format buy putting the following in ~/.profile:

MAIL=$HOME/Mailbox; export MAIL


Contents

The qmail package contains bouncesaying, condredirect, except, forward, maildir2mbox, maildirmake, maildirwatch, mailsubj, preline, qbiff, qreceipt, qmail-clean, qmail-inject, qmail-local, qmail-pop3d, qmail-popup, qmail-qstat, qmail-send, qmail-smtpd and qmail-start.


Description

bouncesaying

bouncesaying processes, possibly bouncing, incoming messages.


condredirect

condredirect processes, possibly redirecting incoming messages.


except

except reverses the exit code of a program.


forward

forward forwards new mail to one or more addresses.


maildir2mbox

maildir2mbox moves current email from an maildir-format directory to an mbox-format file.


maildirmake

maildirmake create a maildir format directory for incoming mail.


maildirwatch

maildirwatch watches a users maildir and prints a new mail summary every 30 seconds.


mailsubj

mailsubj sends a mail message with a subject supplied on the command-line. The body of the message is read from standard input.


preline

preline prepends lines to a message.


qbiff

qbiff announces new mail as soon as it arrives.


qreceipt

qreceipt responds to delivery notice requests.


qmail-clean

qmail-clean cleans up the queue directory.


qmail-inject

qmail-inject preprocesses and sends a mail message.


qmail-local

qmail-local delivers or forwards mail messages.


qmail-pop3d

qmail-pop3d accesses users' pop3 mail accounts.


qmail-popup

qmail-popup reads pop3 usernames and passwords.


qmail-qstat

qmail-qstat summarizes mail queue statistics.


qmail-send

qmail-send delivers mail from the message queue.


qmail-smtpd

qmail-smtpd receives mail via SMTP.


qmail-start

qmail-start enables mail delivery services, spawning qmail-send, qmail-lspawn, qmail-rspawn, and qmail-clean.


Sendmail-8.12.10

Introduction to Sendmail

The Sendmail package contains a Mail Transport Agent (MTA).


Package information


Sendmail dependencies


Installation of Sendmail

Before building Sendmail, we need to create users, groups and directories that sendmail uses with the following commands:

groupadd smmsp &&
groupadd mail &&
useradd -g smmsp -G mail smmsp &&
chmod 1777 /tmp &&
chmod 1777 /var/mail &&
mkdir /var/spool/mqueue

Install Sendmail with the following commands:

cat > devtools/Site/site.config.m4 << "EOF"
define(`confMANGRP',`root')
define(`confMANOWN',`root')
define(`confSBINGRP',`root')
define(`confUBINGRP',`root')
define(`confUBINOWN',`root')
EOF
cd sendmail &&
sh Build &&
cd ../cf/cf &&
cp generic-linux.mc sendmail.mc &&
mkdir /etc/mail &&
sh Build sendmail.mc &&
sh Build install-cf &&
cd ../../ &&
sh Build install

Configuring Sendmail

Config files

/etc/mail/*


Configuration Information

echo `hostname` > /etc/mail/local-host-names
cat > /etc/mail/aliases << "EOF"
postmaster: root
MAILER-DAEMON: root
EOF
cd /etc/mail &&
cp -R  /usr/src/sendmail-8.12.10/cf/* . &&
cp -R  /usr/src/sendmail-8.12.10/cf/cf/submit.mc . &&
cp -R  /usr/src/sendmail-8.12.10/cf/cf/sendmail.mc . &&
newaliases -v

To start and stop Sendmail on system boot/shutdown create the sendmail boot script with the following commands:

Note: The -qNm option, where N is number of minutes, controls how often Sendmail will process the mail queue. A default of 5 minutes is used here. Individual workstation users may want to set this as low as 1 minute, large installations handling more mail will want to set it higher.

cat > /etc/rc.d/init.d/sendmail << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/sendmail

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in

        start)
        echo "Starting sendmail..."
        loadproc /usr/sbin/sendmail -bs -bd -q5m start
        ;;

        stop)
        echo "Stopping Sendmail..."
        killproc sendmail
        ;;
		
	status)
	statusproc sendmail
	;;
	
        restart)
        $0 stop
        sleep 1
        $0 start
        ;;

        *)
        echo "Usage: $0 {start|stop|status|restart}"
        exit 1
        ;;
esac

# End $rc_base/init.d/sendmail
EOF
chmod 755 /etc/rc.d/init.d/sendmail

Create the run level symlinks with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/sendmail ../rc0.d/K25sendmail &&
ln -sf ../init.d/sendmail ../rc1.d/K25sendmail &&
ln -sf ../init.d/sendmail ../rc2.d/K25sendmail &&
ln -sf ../init.d/sendmail ../rc3.d/S35sendmail &&
ln -sf ../init.d/sendmail ../rc4.d/S35sendmail &&
ln -sf ../init.d/sendmail ../rc5.d/S35sendmail &&
ln -sf ../init.d/sendmail ../rc6.d/K25sendmail

Contents

The Sendmail package contains mail.local, rmail, smrsh, editmap, makemap, mailq, newaliases, sendmail, vacation, praliases and mailstats.


Description

mail.local

mail.local appends its standard input to a user's mail file.


rmail

rmail interprets incoming mail received via UUCP.


smrsh

smrsh is a restricted shell for Sendmail.


editmap

editmap queries and edits Sendmail map files.


makemap

makemap creates Sendmail map files.


mailq

mailq prints a summary of waiting mail messages.


newaliases

newaliases rebuilds /etc/mail/aliases.db.


sendmail

sendmail is the Sendmail mail transport agent.


vacation

vacation is an email auto responder.


praliases

praliases displays current Sendmail aliases.


mailstats

mailstats displays Sendmail statistics.


Exim-4.24

Introduction to Exim

The Exim package contains a Mail Transport Agent written by the University of Cambridge, released under the GNU Public License.


Package information


Exim dependencies


Installation of Exim

Before building Exim, we need to create the group and user exim which will run the exim daemon:

groupadd exim &&
useradd -d /dev/null -g exim -s /bin/false exim

Install Exim with the following commands:

sed -e 's/^BIN_DIR.*$/BIN_DIRECTORY=\/usr\/sbin/' src/EDITME | \
  sed -e 's/^CONF.*$/CONFIGURE_FILE=\/etc\/exim.conf/' | \
  sed -e 's/^EXIM_USER.*$/EXIM_USER=exim/' | \
  sed -e 's/^EXIM_MONITOR/#EXIM_MONITOR/' > Local/Makefile &&
make &&
make install &&
cp doc/exim.8 /usr/share/man/man8 &&
ln -s exim-4.24-1 /usr/sbin/exim &&
ln -s exim /usr/sbin/sendmail

Command explanations

sed -e ... > Local/Makefile: Many of Exim's configuration options are compiled in. Here, we specify the minimum set of options, BIN_DIRECTORY, CONFIGURE_FILE and EXIM_USER. We also defer building the Exim monitor program, which requires the X Window System support, by commenting out the EXIM_MONITOR line in the Makefile.

ln -s exim /usr/sbin/sendmail: Create a link to sendmail for applications which need it. Exim will accept most Sendmail command-line options.


Configuring Exim

Config files

/etc/exim.conf, /etc/aliases


Configuration Information

Create the Exim configuration files with the following commands:

cat >> /etc/aliases << "EOF"
postmaster: root
MAILER-DAEMON: root
EOF
exim -v -bi &&
/usr/sbin/exim -bd -q1m

Note: To protect an existing /etc/aliases file, we will append these aliases to it if it exists. This file should be checked and duplicate aliases removed, if present.

To start and stop Exim on system boot/shutdown create the exim boot script with the following commands:

cat > /etc/rc.d/init.d/exim << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/exim

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in

        start)
        echo "Starting exim..."
        loadproc /usr/sbin/exim -bd -q1m
        ;;

        stop)
        echo "Stopping exim..."
        killproc exim
        ;;
		
	status)
	statusproc exim
	;;
	
        restart)
        $0 stop
        sleep 1
        $0 start
        ;;

        *)
        echo "Usage: $0 {start|stop|status|restart}"
        exit 1
        ;;
esac

# End $rc_base/init.d/exim
EOF
chmod 755 /etc/rc.d/init.d/exim

Create the run level symlinks with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/exim ../rc0.d/K25exim &&
ln -sf ../init.d/exim ../rc1.d/K25exim &&
ln -sf ../init.d/exim ../rc2.d/K25exim &&
ln -sf ../init.d/exim ../rc3.d/S35exim &&
ln -sf ../init.d/exim ../rc4.d/S35exim &&
ln -sf ../init.d/exim ../rc5.d/S35exim &&
ln -sf ../init.d/exim ../rc6.d/K25exim

Contents

The Exim package contains exim, exim_dumpdb, exim_fixdb, exim_tidydb, exinext, exiwhat, exim_dbmbuild, exicyclog, exigrep, eximstats, exiqsumm, exiqgrep, exim_lock and exim_checkaccess.


Description

exim

exim is the Mail Transport Agent daemon.


exim_dumpdb

exim_dumpdb writes the contents of exim databases to the standard output.


exim_fixdb

exim_fixdb modifies data in exim databases.


exim_tidydb

exim_tidydb removes old records from exim databases.


exinext

exinext queries remote host retry times.


exiwhat

exiwhat queries running exim processes.


exim_dbmbuild

exim_dbmbuild creates and rebuilds exim databases.


exicyclog

exicyclog cycles exim log files.


exigrep

exigrep searches exim log files.


eximstats

eximstats generates mail statistics from exim log files.


exiqsumm

exiqsumm produces a summary of the messages on the mail queue.


exiqgrep

exiqgrep is an utility for selective queue listing.


exim_lock

exim_lock locks a mailbox file.


exim_checkaccess

exim_checkaccess states whether a given recipient address from a given host is acceptable or not.


Qpopper-4.0.5

Introduction to Qpopper

The Qpopper package contains a POP3 mail server.


Package information


Qpopper dependencies


Installation of Qpopper

Install Qpopper with the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring Qpopper

Configuration Information

If you use inetd, the following command will add the qpopper entry to /etc/inetd.conf:

echo "pop stream tcp nowait root /usr/sbin/popper popper" >> \
/etc/inetd.conf &&
echo "pop 110/tcp" >> /etc/services &&
killall inetd || inetd &&
echo "local0.notice;local0.debug        /var/log/POP.log" >> \
/etc/syslog.conf &&
killall -HUP  syslogd

Issue a killall -HUP inetd to reread the changed inetd.conf file.

If you use xinetd, the following command will add the qpopper entry to /etc/xinetd.conf:

cat >> /etc/xinetd.conf << "EOF"
     service pop
     {
          port        = 110
          socket_type = stream
          protocol    = tcp
          wait        = no
          user        = root
          passenv     = PATH
          server      = /usr/sbin/popper
         server_args = popper
     }
EOF

Issue a killall -HUP xinetd to reread the changed xinetd.conf file.


Contents

The Qpopper package contains qpopper.


Description

popper

popper is the POP3 server daemon.


Courier-0.43.2

Introduction to Courier

The Courier package contains a Mail Transport Agent (MTA). This is useful for sending email to other users of your host machine. It can also be configured to be a central mail server for your domain or a mail relay agent. The Courier packages also includes a web-based email interface, IMAP, IMAP-SSL, POP3, and POP3-SSL. The configuration listed below will allow users with PAM and virtual-users in a MySQL Database access to email.


Package information


Installation of Courier

Before you compile the program, you need to create users and groups that will be expected to be in place when the install script executes. Add the users and groups with the following commands:

groupadd courier &&
useradd -c 'Courier Mail Server -d /dev/null -g courier -s /bin/false courier

Install courier by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc/courier --with-piddir=/var/run \
--libexecdir=/usr/sbin --datadir=/usr/share/courier \
--localstatedir=/var/spool/courier --disable-root-check --with-db=gdbm \
--with-mailuser=courier --withmailgroup=courier \
--enable-workarounds-for-imap-client-bugs \
--with-ispell=/usr/bin/aspell &&
make &&
make install &&
make install-configure

Command explanations

--sysconfdir=/etc/courier: Specifies the directory where Courier's configuration files are installed.

--with-piddir=/var/run: Specifies the directory where Courier's PID files are stored when Courier is active.

--libexecdir=/usr/sbin: libexecdir contains programs and libraries that cannot be directly executed from the command-line.

--datadir=/usr/share/courier: Specifies the directory where miscellaneous shell scripts, Perl scripts, and data files will be installed.

--localstatedir=/var/lib/courier: Specifies the directory that will hold the mail queue, and other temporary data. This option defaults to the subdirectory var in the directory specified by the --prefix option.

--disable-root-check: Allows Courier to be built as the root user.

--with-db=gbbm: Courier requires either the GDBM or the DB database library. GDBM is used if both are present. This option forces the selection of the database library.

--with-mailuser=courier: All except two Courier daemons run as a non-privileged user. This option specifies the userid that Courier will install and run as.

--withmailgroup=courier: like --with-mailuser, but specifies the group ID.

--enable-workarounds-for-imap-client-bugs: there are several confirmed bugs in some IMAP clients that do not properly implement the IMAP4rev1 protocol. This option enables some workarounds for those buggy IMAP clients. NOTE: make check will fail if this option is used. You should first configure without this option, and if all post-configuration tests succeed, rerun configure with this option and recompile.

--with-ispell=/usr/bin/aspell: Courier's webmail server can use spell checking, if the aspell program is available. If configure finds ispell, spell checking is enabled. If aspell is not in the current search path, use --with-ispell=program to explicitly set the location of aspell.


Configuring Courier

Config files

/etc/courier/authmysqlrc


Configuration Information

Make the following changes in this file if you are utilizing MySQL:

MYSQL_SERVER            localhost
MYSQL_USERNAME          courier
MYSQL_PASSWORD          (your choice) 
MYSQL_SOCKET            /tmp/mysql.sock
MYSQL_PORT              3306
MYSQL_DATABASE          courier-mail
MYSQL_USER_TABLE        users
MYSQL_CLEAR_PWFIELD     clear
DEFAULT DOMAIN          (your domain)
MYSQL_QUOTA_FIELD       quota

If you utilize PAM:

cat > /etc/pam.d/esmtp << "EOF
# Begin /etc/pam.d/esmtp

auth            required                pam_unix.so try_first_pass
account         required                pam_unix.so
session         required                pam_unix.so

# End /etc/pam.d/esmtp
EOF
cat > /etc/pam.d/pop3 << "EOF
# Begin /etc/pam.d/pop3

auth            required                pam_unix.so try_first_pass
account         required                pam_unix.so
session         required                pam_unix.so

# End /etc/pam.d/pop3
EOF
cat > /etc/pam.d/imap << "EOF
# Begin /etc/pam.d/imap

auth            required                pam_unix.so try_first_pass
account         required                pam_unix.so
session         required                pam_unix.so

# End /etc/pam.d/imap
EOF
cat > /etc/pam.d/webmail << "EOF
# Begin /etc/pam.d/webmail

auth            required                pam_unix.so try_first_pass
account         required                pam_unix.so
session         required                pam_unix.so

# End /etc/pam.d/webmail
EOF

This command will create the mysql database for authentication:

mysqladmin -uroot -p[password] create courier-mail

This command will setup the table users for the courier-mail database:

mysql -uroot -p[password] courier-mail

        CREATE TABLE users (
        id                    char(128) DEFAULT '' NOT NULL,
        crypt                 char(128) DEFAULT '' NOT NULL,
        clear                 char(128) DEFAULT '' NOT NULL,
        name                  char(128) DEFAULT '' NOT NULL,
        uid                   int(10) unsigned DEFAULT '65534' NOT NULL,
        gid                   int(10) unsigned DEFAULT '65534' NOT NULL,
        home                  char(255) DEFAULT '' NOT NULL,
        quota                 char(255) DEFAULT '' NOT NULL,
        KEY id (id(128))
        );

This will add the courier user that we specified earlier in the authmysql file:

mysql -uroot -p[password] mysql

grant all privileges on *.* to courier@localhost identified by '[password]' with grant option;

General Settings for Mail

You will need to create the following files with the contents specified.

/etc/courier/defaultdomain

cat > /etc/courier/defaultdomain << "EOF"
[yourdomain]
EOF

/etc/courier/me

cat > /etc/courier/me << "EOF"
[servername.yourdomain]
EOF

/etc/courier/locals

cat > /etc/courier/locals << "EOF"
localhost
[yourdomain]
EOF

/etc/courier/esmtpacceptmailfor.dir/system

cat >/etc/courier/esmtpacceptmailfor.dir/system << "EOF"
localhost
[yourdomain]
EOF

You will also need to edit the aliases file and change the following entry.

/etc/courier/aliases/system

postmaster: [your administrator email]

If you want to deny access from some hosts from sending mail you will need to edit the /etc/courier/smtpaccess/default.

After the above steps are completed you will need to run the following commands:

makesmtpaccess
makehosteddomains
makealiases

SMTP/SMTMP-SSL Configuration

This section will enable the SMTP Server from Courier

/etc/courier/esmtpd

ESMTPDSTART=YES

/etc/courier/esmtpd-ssl

ESMTPDSSLSTART=YES

POP3/POP3-SSL Configuration

This section will enable the POP3 Server from Courier

/etc/courier/pop3d

POP3DSTART=YES

/etc/courier/pop3d-ssl

POP3DSLLSTART=YES

IMAP/IMAP-SSL Configuration

This section will enable the IMAP Server from Courier

/etc/courier/imapd

IMAPDSTART=YES

/etc/courierd/imapd-ssl

IMAPDSSLSTART=YES

Creating Mail directories for System Users

This section will explain on how to create MailDirs for your system users.

cd /home/[username]
maildirmake Maildir
chown [username].[username] Maildir -R

Setup for Virtual users

This section will explain how to setup Maildir for your virtual users.

echo "vmailman:x:9000:9000:Virtual Mailman:/home/vmailman:/bin/bash" >> /etc/passwd
echo "vmailman:x:9000:" >> /etc/group

Now to setup the maildir for these virtual users.

cd /home/vmailman
mkdir [virtual_user]
cd [virtual_user]
maildirmake Maildir
chown vmailman.vmailman Maildir -R

Add the virtual user to the MySQL database. You need to enter at least on version of the password either clear text or encrypted.

mysql -ucourier -p[password] courier-mail

insert into users values('[virtual_users]@[domain.com],
'[encrypted password or blank]','[clear text password or blank]',
'[User's Name]',9000,9000,'[location of Maildir]','[Quota in Bytes']);

example

insert into users values ('blfsuser@linuxfromscratch.org','
','password','BLFS User',9000,9000,'/home/vmailman/blfsuser','');

Setup for Web-based Email

This section will explain how to setup Courier Web-based email system.

You will need to copy the file webmail from /usr/sbin/courier/webmail/webmail to your cgi-bin directory of your Apache server.

cp -a /usr/sbin/courier/webmail/webmail /var/www/cgi-bin

You will then need to copy the images to a directory under your htdocs directory of your Apache server. The directory needs to be named webmail or you need to specify it during the configure phase with --enable-imageurl=/url.

cp -a /usr/share/courier/sqwebmail/images /var/www/htdocs/webmail

Setup for Web-based Email

This section will explain how to setup Courier Web-based administration system.

You will need to copy the file webadmin from /usr/sbin/courier/webmail/webmin to your cgi-bin directory of your Apache server.

cp -a /usr/sbin/courier/webmail/webadmin /var/www/cgi-bin

/etc/courier/webadmin/password

cat > /etc/courier/webadmin/password << "EOF"
[password]
EOF

If you are not using SSL on your Apache server, you will need to add /etc/courier/webadmin/unsecureok, so you will be able to use your web based administration tool.

touch /etc/courier/webadmin/unsecureok

Courier init.d script

The startup script from the Courier package is the easiest to use. It will automatically create missing data files, and SSL certificates if they are missing. To install the init.d file for Courier you will need to use the follow commands:

cp /usr/src/courier-0.43.2/courier.sysvinit /etc/rc.d/init.d/courier &&
chmod 755 /etc/rc.d/init.d/courier

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/courier ../rc0.d/K25courier &&
ln -sf ../init.d/courier ../rc1.d/K25courier &&
ln -sf ../init.d/courier ../rc2.d/K25courier &&
ln -sf ../init.d/courier ../rc3.d/S35courier &&
ln -sf ../init.d/courier ../rc4.d/S35courier &&
ln -sf ../init.d/courier ../rc5.d/S35courier &&
ln -sf ../init.d/courier ../rc6.d/K25courier

Contents

The Courier package contains cancelmsg, courier-config, couriermlm, couriertls, deliverquota, dotforward, imapd, lockmail, mailbot, maildirkw, maildrop, mailq, makedat, makemime, mimegpg, preline, reformail, reformime, rmail, sendmail, testmxlookup, courier, courierfilter, courierlogger, couriertcpd, esmtpd, esmtpd-msa, esmtp-ssl, filterctl, imapd, imapd-ssl, makeacceptmailfor, makealiases, makehosteddomains, makepercentrelay, makesmtpacces, makesmtpaccess-msa, makeuserdb, makeuucpneighbors, mksmtpcert, mkimapdcert, mkpop3cert, pop3d, pop3d-ssl, pw2userdb, showconfig, showmodules, userdb, userdbpw, webgpg, authdaemon, authdaemon.mysql, authdaemon.plain, aliascombine, aliascreate, aliasexp, courierd, courierpop3d, courierpop3login, imaplogin, makedatprog, pcpd, submit, submitmkdir, webadmin, webmail, courierdsn, addcr, authend, authstate, courieresmtp, courieresmtpd, courierfax, courierdeliver, courierlocal, courieruucp, perlfilter, dupfilter.


Description

cancelmsg

cancelmsg removes a message from the mail queue.


couriermlm

couriermlm is the Courier mailing list manager.


lockmail

lockmail is a helper utility for working with mailbox files..


mailbot

mailbot reads an E-mail message on standard input and creates an E-mail message replying to the original message's sender..


maildirkw

maildirkw modifies Courier-IMAP compatible maildir message keywords.


maildrop

maildrop is a replacement local mail delivery agent that includes a mail filtering language.


mailq

mailq displays a list of all messages that have not been delivered yet.


reformail

reformail program reads a message on standard input, reformats it in some way, and writes the message to standard output.


reformime

reformime is a utility for reformatting MIME messages.


sendmail

sendmail command reads an E-mail message and delivers the message to its recipients. This sendmail command is part of the Courier mail server, although it attempts to emulate the behavior of the original sendmail MTA.


testmxlookup

testmxlookup lists the names and IP addresses of mail relays that receive mail for the domain. This is useful in diagnosing mail delivery problems..


courier

courier Courier is a modular multi-protocol E-mail transport agent. The courier command is an administrative command, and most of its options are only available to the superuser..


courierfilter

courierfilter commands install or uninstall global mail filters. Global mail filters are used to selectively block unwanted mail.


filterctl

filterctl commands install or uninstall global mail filters. Global mail filters are used to selectively block unwanted mail.


makeacceptmailfor

makeacceptmailfor Build a list of domains to accept mail for from the /etc/courier/esmtpacceptmailfor.dirdirectory.


makealiases

makealiases Build a list of aliases from /etc/courier/aliases or /etc/courier/aliasdir directories.


makehosteddomains

makehostedomains Build a database of hosted domains from hosteddomains .


makepercentrelay

makepercentrelay Build a list of %-relayed domains from percentrelay.dir directory.


makesmtpaccess

makesmtpacces Build ESMTP server access file from /etc/courier/smtpaccess directory.


makesmtpaccess-msa

makesmtpaccess-msa Build ESMTP server access file from /etc/courier/smtpaccess directory. This esmtp list is for the MSA protocol.


makeuucpneighbors

makeuucpneighbors Builds a list of UUCP recipient's using /etc/courier/uucpneighbors .


showconfig

showconfig Shows the current Courier configuration.


showmodules

showmodules Shows the current Courier modules.


authdaemon

authdaemon Courier Authentication Library.


.


Chapter 23. Other Server Software

Here you will find many ways to share your machine with the rest of the world or your local network. Before installing any packages in this chapter, you need to be sure you understand what the package does and how to set it up correctly. It might also be helpful to learn about the consequences of an improper setup so that you can analyze the risks.


BIND-9.2.2

Introduction to BIND

The BIND package provides a DNS server and client utilities.


Package information


Installation of BIND

Install BIND by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Configuring BIND

Config files

named.conf, root.hints, 127.0.0, rndc.conf


Configuration Information

We will configure BIND to run in a chroot jail as an unprivileged user (named). This configuration is more secure in that a DNS compromise can only affect a few files in the named user's HOME directory.

First we create the unprivileged user and group named:

groupadd -g 200 named &&
useradd -m -g named -u 200 -s /bin/false named

Then we set up some files, directories and devices needed by BIND:

cd /home/named &&
mkdir -p dev etc/namedb/slave var/run &&
mknod /home/named/dev/null c 1 3 &&
mknod /home/named/dev/random c 1 8 &&
chmod 666 /home/named/dev/{null,random} &&
mkdir /home/named/etc/namedb/pz &&
cp /etc/localtime /home/named/etc

Create the named.conf file from which named will read the location of zone files, root name servers and secure DNS keys:

cat > /home/named/etc/named.conf << "EOF"
 options {
     directory "/etc/namedb";
    pid-file "/var/run/named.pid";
    statistics-file "/var/run/named.stats";
       
 };
 controls {
     inet 127.0.0.1 allow { localhost; } keys { rndc_key; };
 };
 key "rndc_key" {
     algorithm hmac-md5;
     secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
 };
 zone "." {
     type hint;
     file "root.hints";
 };
 zone "0.0.127.in-addr.arpa" {
     type master;
     file "pz/127.0.0";
 };
EOF

Create a zone file with the following contents:

cat > /home/named/etc/namedb/pz/127.0.0 << "EOF"
$TTL 3D
@      IN      SOA     ns.local.domain. hostmaster.local.domain. (
                        1       ; Serial
                        8H      ; Refresh
                        2H      ; Retry
                        4W      ; Expire
                        1D)     ; Minimum TTL
                NS      ns.local.domain.
1               PTR     localhost.
EOF

Create the root.hints file with the following commands:

Note: Caution must be used to insure no leading spaces in this file.

cat > /home/named/etc/namedb/root.hints << "EOF"
.                       6D  IN      NS      A.ROOT-SERVERS.NET.
.                       6D  IN      NS      B.ROOT-SERVERS.NET.
.                       6D  IN      NS      C.ROOT-SERVERS.NET.
.                       6D  IN      NS      D.ROOT-SERVERS.NET.
.                       6D  IN      NS      E.ROOT-SERVERS.NET.
.                       6D  IN      NS      F.ROOT-SERVERS.NET.
.                       6D  IN      NS      G.ROOT-SERVERS.NET.
.                       6D  IN      NS      H.ROOT-SERVERS.NET.
.                       6D  IN      NS      I.ROOT-SERVERS.NET.
.                       6D  IN      NS      J.ROOT-SERVERS.NET.
.                       6D  IN      NS      K.ROOT-SERVERS.NET.
.                       6D  IN      NS      L.ROOT-SERVERS.NET.
.                       6D  IN      NS      M.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.     6D  IN      A       198.41.0.4
B.ROOT-SERVERS.NET.     6D  IN      A       128.9.0.107
C.ROOT-SERVERS.NET.     6D  IN      A       192.33.4.12
D.ROOT-SERVERS.NET.     6D  IN      A       128.8.10.90
E.ROOT-SERVERS.NET.     6D  IN      A       192.203.230.10
F.ROOT-SERVERS.NET.     6D  IN      A       192.5.5.241
G.ROOT-SERVERS.NET.     6D  IN      A       192.112.36.4
H.ROOT-SERVERS.NET.     6D  IN      A       128.63.2.53
I.ROOT-SERVERS.NET.     6D  IN      A       192.36.148.17
J.ROOT-SERVERS.NET.     6D  IN      A       192.58.128.30
K.ROOT-SERVERS.NET.     6D  IN      A       193.0.14.129
L.ROOT-SERVERS.NET.     6D  IN      A       198.32.64.12
M.ROOT-SERVERS.NET.     6D  IN      A       202.12.27.33
EOF

The root.hints file is a list of root name servers. This file must be updated periodically with the dig utility. Consult the BIND 9 Administrator Reference Manual for details.

Create the rndc.conf with the following commands:

cat > /etc/rndc.conf << "EOF"
key rndc_key {
algorithm "hmac-md5";
    secret
    "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
    };
options {
    default-server localhost;
    default-key    rndc_key;
};
EOF

The rndc.conf file contains information for controlling named operations with the rndc utility.

Create or modify resolv.conf to use the new name server with the following commands:

Note: Replace yourdomain.com with your own valid domain name.

cp /etc/resolv.conf /etc/resolv.conf.bak &&
cat > /etc/resolv.conf << "EOF"
search yourdomain.com
nameserver 127.0.0.1
EOF

Set permissions on the chroot jail with the following command:

chown -R named.named /home/named

Create the BIND boot script:

cat > /etc/rc.d/init.d/bind << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/bind
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
	start)
		echo "Starting named..."
		loadproc /usr/sbin/named -u named -t /home/named -c \
		        /etc/named.conf
		;;
	stop)
		echo "Stopping named..."
		killproc /usr/sbin/named
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
   reload)
                echo "Reloading named..."
                /usr/sbin/rndc -c /etc/rndc.conf reload
                ;;
			       		
	status)
		statusproc /usr/sbin/named
		;;
	*)
		echo "Usage: $0 {start|stop|restart|status}"
		exit 1
		;;
esac
# End $rc_base/init.d/bind
EOF

Add the run level symlinks:

chmod 754 /etc/rc.d/init.d/bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc0.d/K49bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc1.d/K49bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc2.d/K49bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc3.d/S22bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc4.d/S22bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc5.d/S22bind &&
ln -s  /etc/rc.d/init.d/bind /etc/rc.d/rc6.d/K49bind

Now start BIND with the new boot script:

/etc/rc.d/init.d/bind start

Testing BIND

Test out the new BIND 9 installation. First query the local host address with dig:

dig -x 127.0.0.1

Now try an external name lookup, taking note of the speed difference in repeated lookups due to the caching. Run the dig command twice on the same address:

dig beyond.linuxfromscratch.org &&
dig beyond.linuxfromscratch.org
You can see almost instantaneous results with the named caching lookups. Consult bind-9.2.2/doc/arm/Bv9ARM.html, the BIND Administrator Reference Manual for further configuration options.


Contents

The BIND package contains dig, host, rndc, rndc-confgen, named-checkconf, named-checkzone, lwresd, named, dnssec-signzone, dnssec-signkey, dnssec-keygen, dnssec-makekeyset and nsupdate.


Description

dig

dig interrogates DNS servers.


host

host is a utility for DNS lookups.


rndc

rndc controls the operation of BIND.


rndc-confgen

rndc-confgen generates rndc.conf files.


named-checkconf

named-checkconf checks the syntax of named.conf files.


named-checkzone

named-checkzone checks zone file validity.


lwresd

lwresd is a caching-only name server for local process use.


named

named is the name server daemon.


dnssec-signzone

dnssec-signzone generates signed versions of zone files.


dnssec-signkey

dnssec-signkey signs zone file key sets.


dnssec-keygen

dnssec-keygen is a key generator for secure DNS.


dnssec-makekeyset

dnssec-makekeyset generates a key set from one or more keys created by dnssec-keygen.


nsupdate

nsupdate is used to submit DNS update requests.


Running a CVS server

Running a CVS server

This section will describe how to set up, administer and secure a CVS server.


template dependencies


Setting up a CVS server.

We will discuss setting up a CVS server using OpenSSH as the remote access method. Other access methods, including :pserver: and :server: will not be used for write access to the CVS repository. The :pserver: method sends clear text passwords over the network and the :server: method is not supported in all CVS ports. Instructions for anonymous, read only CVS access using :pserver: can be found at the end of this section.

Configuration of our CVS server consists of four steps:


1. Create a repository.

Create a new CVS repository with the following commands, logged in as root:

mkdir /cvsroot &&
chmod 1777 /cvsroot &&
export CVSROOT=/cvsroot &&
cvs init

2. Import source code into the repository.

Import a source module into the repository with the following commands, issued from a user account on the same machine as the CVS repository:

export CVSROOT=/cvsroot &&
cd sourcedir &&
cvs import -m "repository test" cvstest vendortag releasetag

3. Verify local repository access.

Test access to the CVS repository from the same user account with the following command:

cvs co cvstest

4. Verify remote repository access.

Test access to the CVS repository from a remote machine using a user account that has ssh access to the CVS server with the following commands:

Note: Replace [servername] with the IP address or host name of the CVS repository machine. You will be prompted for the user's shell account password before CVS checkout can continue.

export CVS_RSH=/usr/bin/ssh &&
cvs -d:ext:[servername]:/cvsroot co cvstest

Configuring CVS for anonymous read only access.

CVS can be set up to allow anonymous read only access using the :pserver: method by logging on as root and executing the following commands:

(grep anonymous /etc/passwd || useradd anonymous -s /bin/false) &&
echo anonymous: > /cvsroot/CVSROOT/passwd &&
echo anonymous > /cvsroot/CVSROOT/readers

If you use inetd, the following command will add the pserver entry to /etc/inetd.conf:

echo "2401  stream  tcp  nowait  root  /usr/bin/cvs cvs -f \
        --allow-root=/cvsroot pserver" >> /etc/inetd.conf

Issue a killall -HUP inetd to reread the changed inetd.conf file.

If you use xinetd, the following command will add the pserver entry to /etc/xinetd.conf:

cat >> /etc/xinetd.conf << "EOF"
     service cvspserver
     {
          port        = 2401
          socket_type = stream
          protocol    = tcp
          wait        = no
          user        = root
          passenv     = PATH
          server      = /usr/bin/cvs
         server_args = -f --allow-root=/cvsroot pserver
     }
EOF

Issue a killall -HUP xinetd to reread the changed xinetd.conf file.

Testing anonymous access to the new repository requires an account on another machine that can reach the CVS server via network. No account on the CVS repository is needed. To test anonymous access to the CVS repository log in to another machine as an unprivileged user and execute the following command:

cvs -d:pserver:anonymous@[servername]:/cvsroot co cvstest

Note: Replace [servername] with the IP address or hostname of the CVS server


Command explanations

mkdir /cvsroot: Create the CVS repository directory.

chmod 1777 /cvsroot: Sticky bit permissions for CVSROOT.

export CVSROOT=/cvsroot: Specify new CVSROOT for all cvs commands.

cvs init: Initialize the new CVS repository.

cvs import -m "repository test" cvstest vendortag releasetag: All source code modules must be imported into the CVS repository before use, with the cvs import command. the -m flags specifies an initial descriptive entry for the new module. the "cvstest" parameter is the name used for the module in all subsequent cvs commands. the "vendortag" and "releasetag" parameters are used to further identify each CVS module and are mandatory whether used or not.

(grep anonymous /etc/passwd || useradd anonymous -s /bin/false): Check for an existing anonymous user and create one if not found.

echo anonymous: > /cvsroot/CVSROOT/passwd : Add the anonymous user to the CVS passwd file, which is unused for anything else in this configuration.

echo anonymous > /cvsroot/CVSROOT/readers: Add the anonymous user to the CVS readers file, a list of users who have read only access to the repository.


DHCP-3.0pl2

Introduction to DHCP

The DHCP package contains both the client and server programs for DHCP. dhclient (the client) is useful for connecting your computer to a network which uses DHCP to assign network addresses. dhcpd (the server) is useful for assigning network addresses on your private network.


Package information


Installation of DHCP

Note: You must have Packet Socket support compiled in the kernel and Socket Filtering either compiled in or as a kernel module.

Install DHCP by running the following commands:

./configure &&
make &&
make LIBDIR=/usr/lib INCDIR=/usr/include install

Command explanations

LIBDIR=/usr/lib INCDIR=/usr/include: This command installs the library and include files in /usr instead of /usr/local.


Configuring DHCP

Config files

/etc/dhclient.conf


Configuration Information

Information on configuring the DHCP client can be found in Chapter 14.

Note that you only want to start the DHCP server if you want to issue LAN addresses over your network. The DHCP client doesn't need this script to be used. Also note that this script is coded for the eth1 interface, which may need to be modified for your hardware configuration. With that in mind the DHCP init.d script can be created using the following commands.

cat > /etc/rc.d/init.d/dhcp << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/dhcp

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting DHCP Server..."
                loadproc dhcpd -q eth1
                ;;

        stop)
                echo "Stopping DHCP Server..."
                killproc dhcpd
                ;;

        reload)
                echo "Reloading DHCP Server..."
                reloadproc dhcpd
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                statusproc dhcpd
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/dhcp
EOF
chmod 755 /etc/rc.d/init.d/dhcp

The lease file must exist on startup. The following command will satisfy that requirement:

touch /var/state/dhcp/dhcpd.leases

The follow commands will create a base configuration file for a DHCP server. There are several options that you may want to add (information that is passed back to the DHCP client) and those are covered in the man pages for dhcp.conf.

cat > /etc/dhcpd.conf << "EOF"
default-lease-time 72000;
max-lease-time 144000;
ddns-update-style ad-hoc;

subnet 192.168.5.0 netmask 255.255.255.0 {
  range 192.168.5.10 192.168.5.240;
  option broadcast-address 195.168.5.255;
  option routers 192.168.5.1;
}
EOF

All addresses should be changed to meet your circumstance.


Contents

The DHCP package contains dhclient, dhcpd and dhcrelay .


Description

dhclient

dhclient is the implementation of the DHCP client.


dhcpd

dhcpd implements Dynamic Host Configuration Protocol (DHCP) and Internet Bootstrap Protocol (BOOTP) requests for network addresses.


dhcrelay

dhcrelay provides a means to accept DHCP and BOOTP requests on a subnet without a DHCP server and relay them to a DHCP server on another subnet.


Leafnode-1.9.43

Introduction to Leafnode

Leafnode is an NNTP server designed for small sites to provide a local USENET spool.


Package information


Leafnode dependencies

Required

pcre-4.3


Installation of Leafnode

Create the group and user news, if not present:

groupadd news &&
useradd -g news news

Install Leafnode by running the following commands:

./configure --prefix=/usr --localstatedir=/var \
    --sysconfdir=/etc/news --with-lockfile=/var/lock/fetchnews.lck &&
make &&
make install &&
ldconfig &&
make update

Installation command explanations

--localstatedir=/var: Change the default spool directory of /usr/var.

--sysconfdir=/etc/news: leafnode reads its configuration data from a file called config which will be created in /etc/news to avoid any potential conflict with other packages.

make update: Create an initial /etc/news/config.example file, which must be renamed to /etc/news/config.


Configuring Leafnode

Config files

/etc/leafnode/config, /etc/inetd.conf and /etc/xinetd.conf

Leafnode may be configured to use inetd by adding an entry to the /etc/inetd.conf file with the following command:

echo "nntp stream tcp nowait news /usr/sbin/tcpd /usr/sbin/leafnode" \
>> /etc/inetd.conf

Alternatively, Leafnode may be configured to use xinetd by adding an entry to the /etc/xinetd.conf file with the following command:

cat >> /etc/xinetd.conf << "EOF" 
        service nntp
        {
           flags           = NAMEINARGS NOLIBWRAP
           socket_type     = stream
           protocol        = tcp
           wait            = no
           user            = news
           server          = /usr/sbin/tcpd
           server_args     = /usr/sbin/leafnode
           instances       = 7
           per_source      = 3
        }
EOF

The /etc/news/config file must be edited to reflect the name of the upstream NNTP provider. Copy the example configuration file to /etc/news/config and save the original for reference:

cp /etc/news/config.example /etc/news/config

Change the
server = 
entry to reflect your news provider.

The NNTPSERVER environment variable must be set to 127.0.0.1 to prevent news clients from reading news from the upstream feed, add the following to /etc/profile or $HOME/.bash_profile:

export NNTPSERVER=127.0.0.1

Contents

The Leafnode package contains leafnode-version, leafnode, applyfilter, texpire, checkgroups, fetchnews and newsq.


Description

leafnode-version

leafnode-version prints the leafnode version.


leafnode

leafnode is the NNTP server daemon.


applyfilter

applyfilter filters newsgroup articles according to regular expressions.


texpire

texpire expires old articles and unread groups.


checkgroups

checkgroups inserts newsgroup titles into the newsgroup database.


fetchnews

fetchnews sends posted articles to and retrieves new articles from an upstream news server.


newsq

newsq shows articles waiting to be sent upstream.


OpenSSH-3.7.1p2

Introduction to OpenSSH

The OpenSSH package contains ssh clients and the sshd daemon. This is useful for encrypting all traffic over a network.


Package information


OpenSSH dependencies


Optional

X11-ssh-askpass and Linux-PAM-0.77


Installation of OpenSSH

OpenSSH runs as two processes when connecting to other computers. The first process is a privileged process and controls the issuance of privileges as necessary. The second process communicates with the network. Additional installation steps are necessary to set up the proper environment which are performed by the following commands:

mkdir /var/empty &&
chown root:sys /var/empty &&
groupadd sshd &&
useradd -c 'sshd privsep' -d /var/empty -g sshd -s /bin/false sshd

Install OpenSSH by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc/ssh \
   --libexecdir=/usr/sbin --with-md5-passwords &&
make &&
make install 

Command explanations

--sysconfigdir=/etc/ssh: This prevents the configuration files from going to /usr/etc.

--with-md5-passwords: This is required if you made the changes recommended by the shadowpasswd_plus LFS hint on your SSH server when you installed the Shadow Password Suite or if you access a SSH server that authenticates by user passwords encrypted with md5.

--libexecdir=/usr/sbin: OpenSSH puts programs called by programs in /usr/libexec . sftp-server is a sshd utility and ssh-askpass is a ssh-add utility that is installed as a link to X11-ssh-askpass. Both of these should go in /usr/sbin not /usr/libexec.


Configuring OpenSSH

Config files

/etc/ssh/ssh_config, /etc/ssh/sshd_config

There are no required changes in either of these files. However you may wish to view them to make changes for appropriate security to your system. Configuration information can be found in the man pages for sshd, ssh and ssh-agent


sshd init.d script

Note that you only want to start the sshd server if you want to be able to ssh into your machine. The ssh client doesn't need this script to be used. Having said that, if you want to run the ssh daemon, the OpenSSH daemon init.d script can be created using the following commands:

cat > /etc/rc.d/init.d/sshd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/sshd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
	        echo "Starting SSH Server..."
	        loadproc /usr/sbin/sshd
	        ;;

	stop)
	        echo "Stopping SSH Server..."
	        killproc /usr/sbin/sshd
	        ;;

	reload)
	        echo "Reloading SSH Server..."
	        reloadproc /usr/sbin/sshd
	        ;;
	     
	restart)
	        $0 stop
	        sleep 1
	        $0 start
	        ;;

	status)
	        statusproc /usr/sbin/sshd
	        ;;

	*)
	        echo "Usage: $0 {start|stop|reload|restart|status}"
	        exit 1
	        ;;
esac

# End $rc_base/init.d/sshd
EOF
chmod 755 /etc/rc.d/init.d/sshd

Create the symbolic links to this file in the relevant rc.d directories with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/sshd ../rc0.d/K30sshd &&
ln -sf ../init.d/sshd ../rc1.d/K30sshd &&
ln -sf ../init.d/sshd ../rc2.d/K30sshd &&
ln -sf ../init.d/sshd ../rc3.d/S30sshd &&
ln -sf ../init.d/sshd ../rc4.d/S30sshd &&
ln -sf ../init.d/sshd ../rc5.d/S30sshd &&
ln -sf ../init.d/sshd ../rc6.d/K30sshd

Contents

The OpenSSH package contains ssh, sshd, ssh-agent, ssh-add, sftp, scp, ssh-keygen, sftp-server and ssh-keyscan.


Description

ssh

The basic rlogin/rsh-like client program.


sshd

The daemon that permits you to login.


ssh-agent

An authentication agent that can store private keys.


ssh-add

Tool which adds keys to the ssh-agent.


sftp

FTP-like program that works over SSH1 and SSH2 protocol.


scp

File copy program that acts like rcp.


ssh-keygen

Key generation tool.


sftp-server

SFTP server subsystem.


ssh-keyscan

Utility for gathering public host keys from a number of hosts.


rsync-2.5.6

Introduction to rsync

The rsync package contains the rsync utility. This is useful for synchronizing large file archives over a network.


Package information


Installation of rsync

For security reasons, running rsync server as an unprivileged user and group is encouraged.

groupadd rsyncd &&
useradd -c rsyncd -d /home/rsync -g rsyncd -s /bin/false rsyncd

Install rsync by running the following commands:

./configure --prefix=/usr &&
make &&
make install 

Command explanations

--prefix=/usr : This installs rsync in /usr instead of /usr/local


Configuring rsync

Config files

/etc/rsyncd.conf

This is a simple download-only configuration. See the rsyncd man-page for additional options (i.e. user authentication).

cat > /etc/rsyncd.conf << "EOF"
# This is a basic rsync configuration file
# It exports a single module without user authentication.

motd file = /home/rsync/welcome.msg
use chroot = yes

[localhost]
	path = /home/rsync
	comment = Default rsync module
	read only = yes
	list = yes
	uid = rsyncd
	gid = rsyncd

EOF

rsyncd init.d script

Note that you only want to start the rsync server if you want to provide a rsync archive on your machine. The rsync client doesn't need this script to be used. Having said that, if you want to run the rsync daemon, the rsync daemon init.d script can be created using the following commands:

cat > /etc/rc.d/init.d/rsyncd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/rsyncd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
	start)
		echo "Starting RSYNC Server..."
		loadproc /usr/bin/rsync --daemon --compress
		;;

	stop)
		echo "Stopping RSYNC Server..."
		killproc /usr/bin/rsync
		;;

	reload)
		echo "Reloading RSYNC Server..."
		reloadproc /usr/bin/rsync
		;;
            
	restart)
		$0 stop
		sleep 1
		$0 start
		;;

	status)
		statusproc /usr/bin/rsync
		;;

	*)
		echo "Usage: $0 {start|stop|reload|restart|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/rsyncd
EOF
chmod 755 /etc/rc.d/init.d/rsyncd

Create the symbolic links to this file in the relevant rc.d directories with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/rsyncd ../rc0.d/K30rsyncd &&
ln -sf ../init.d/rsyncd ../rc1.d/K30rsyncd &&
ln -sf ../init.d/rsyncd ../rc2.d/K30rsyncd &&
ln -sf ../init.d/rsyncd ../rc3.d/S30rsyncd &&
ln -sf ../init.d/rsyncd ../rc4.d/S30rsyncd &&
ln -sf ../init.d/rsyncd ../rc5.d/S30rsyncd &&
ln -sf ../init.d/rsyncd ../rc6.d/K30rsyncd

Contents

The rsync package contains rsync.


Description

rsync

rsync is a replacement for rcp (and scp) that has many more features. It uses the "rsync algorithm" which provides a very fast method for remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand.


OpenLDAP-2.1.22

Introduction to OpenLDAP

The OpenLDAP package provides an open source implementation of the Lightweight Directory Access Protocol.


Package information


OpenLDAP dependencies


Installation of OpenLDAP

Install OpenLDAP by running the following commands:

./configure --prefix=/usr --libexecdir=/usr/sbin \
    --sysconfdir=/etc --localstatedir=/var \
    --disable-debug --enable-ldbm &&
make depend &&
make &&
make test &&
make install

Command explanations

--sysconfdir=/etc: Sets the configuration file directory to avoid the default of /usr/etc.

--libexecdir=/usr/sbin: Puts the server executables in /usr/sbin instead of /usr/libexec.

--enable-ldbm: Build slapd with primary database back end using either Berkeley DB or GNU Database Manager.

--disable-debug: Disable debugging code.

make test: Validate correct build of the package.


Configuring OpenLDAP

Config files

/etc/openldap/*


Configuration Information

The only configuration needed for OpenLDAP is to run ldconfig. The LDAP server can be started by /usr/sbin/slapd as described in the man page slapd(8).

Data can be added to the LDAP database via ldapadd. There are other programs that can use the database. For more information see the appropriate man page.


Contents

The OpenLDAP package contains ldapadd, ldapcompare, ldapdelete, ldapmodify, ldapmodrdn, ldappasswd, ldapsearch, ldapwhoami, slapadd, slapcat, slapd, slapindex, slappasswd, slurpd, liblber and libldap.


Description

ldapadd

ldapadd opens a connection to an LDAP server, binds and adds entries.


ldapcompare

ldapcompare opens a connection to an LDAP server, binds and performs a compare using specified parameters.


ldapdelete

ldapdelete opens a connection to an LDAP server, binds and deletes one or more entries.


ldapmodify

ldapmodify opens a connection to an LDAP server, binds and modifies entries.


ldapmodrdn

ldapmodrdn opens a connection to an LDAP server, binds and modifies the RDN of entries.


ldappasswd

ldappasswd is a tool to set the password of an LDAP user.


ldapsearch

ldapsearch opens a connection to an LDAP server, binds and performs a search using specified parameters.


ldapwhoami

ldapwhoami open a connection to an LDAP server, binds and performs a whoami operation.


slapadd

slapadd is used to add entries specified in LDAP Directory Interchange Format (LDIF) to a slapd database.


slapcat

slapcat is used to generate an LDAP LDIF output based upon the contents of a slapd database.


slapd

slapd is the stand-alone LDAP server.


slapindex

slapindex is used to regenerate slapd indices based upon the current contents of a database.


slappasswd

slappasswd is an OpenLDAP password utility.


slurpd

slurpd is the stand-alone LDAP replication server.


liblber and libldap

These libraries support the LDAP programs and provide functionality for other programs interacting with LDAP.


Samba-2.2.8a

Introduction to Samba

The Samba package provides file and print services to SMB/CIFS clients.


Package information


Installation of Samba

Install Samba by running the following commands:

cd source &&
mkdir -p /etc/samba/private &&
mkdir -p /var/cache/samba &&
./configure \
   --prefix=/usr \
   --sysconfdir=/etc \
   --localstatedir=/var \
   --with-piddir=/var/run \
   --with-fhs \
   --with-smbmount &&
make &&
make install &&

rm -rf /usr/private &&
echo "swat 901/tcp" >> /etc/services &&
echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" >> \
   /etc/inetd.conf

Installation command explanations

mkdir -p /etc/samba/private
mkdir -p /var/cache/samba
Directories needed for proper operation of the smbd and nmbd daemons.

--prefix=/usr: Sets the prefix for almost all the file paths to /usr.

--sysconfdir=/etc: Sets the configuration file directory to avoid the default of /usr/etc.

--localstatedir=/var: Sets the variable data directory to avoid the default of /usr/var.

--with-fhs: Assigns all other file paths in a manner compliant with the Filesystem Hierarchy Standard (FHS).

--with-smbmount: Orders the creation of an extra binary for use by the mount command so that mounting remote SMB (windows) shares becomes no more complex than mounting remote NFS shares.

rm -rf /usr/private: Removes a directory erroneously created by source/scripts/installbin.sh during the make install.


Configuring Samba

We will configure one Samba server (SAMBABOX) to act as a primary domain controller, as well as configure one domain client running Windows 2000 Server(WIN2KBOX) and acting as a member server of the domain. Detailed instructions will be given for adding WIN2KBOX to the domain due to the extra steps necessary. Instructions for adding Windows 95/98/XP clients can be found in the newly installed documentation by pointing a web browser to:

file:///usr/share/samba/swat/using_samba/ch03_01.html#ch03-55770.

Config files

/etc/samba/smb.conf, /etc/rc.d/init.d/samba

First we set up some directories needed by Samba :

mkdir /var/lib/samba &&
mkdir /var/lib/samba/netlogon &&
mkdir /var/lib/samba/ntprofile &&
mkdir /var/lib/samba/profiles &&
chmod -R 1777 /var/lib/samba

And the Samba configuration file:

cat > /etc/samba/smb.conf << "EOF"
[global]
    netbios name = SAMBABOX
    workgroup = DOMAIN01
    os level = 64
    preferred master = yes
    domain master = yes
    local master = yes
    security = user
    encrypt passwords = yes
    domain logons = yes
    log file = /var/log/log.%m
    log level = 1
    logon path = \\%N\home\%u
    logon drive = H:
    logon home = \\homeserver\%u
    logon script = logon.cmd
[netlogon]
      path = /var/lib/samba/netlogon
      read only = yes
      write list = ntadmin
[profiles]
      path = /var/lib/samba/ntprofile
      read only = no
      create mask = 0600
      directory mask = 0700
; World writable share for testing
[tmp]
comment = Temporary file space
        path = /tmp
        read only = no
        public = yes
[home]
comment = Users' home directories
        path = /home
        read only = no
        public = no
EOF

Now add the machine trust account for WIN2KBOX:

/usr/sbin/useradd -g 100 -d /dev/null -c \
    "machine nickname" -s /bin/false win2kbox$ &&
passwd -l win2kbox$ &&
smbpasswd -a -m win2kbox

Create the Samba boot script:

cat > /etc/rc.d/init.d/samba << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/samba
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
	start)
		echo "Starting nmbd..."
		loadproc /usr/sbin/nmbd -D
		echo "Starting smbd..."
		loadproc /usr/sbin/smbd -D
		;;
	stop)
		echo "Stopping smbd..."
		killproc /usr/sbin/smbd
		echo "Stopping nmbd..."
		killproc /usr/sbin/nmbd
		;;
	reload)
		echo "Reloading smbd..."
		reloadproc /usr/sbin/smbd
		echo "Reloading nmbd..."
		reloadproc /usr/sbin/nmbd
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	status)
		statusproc /usr/sbin/nmbd
		statusproc /usr/sbin/smbd
		;;
	*)
		echo "Usage: $0 {start|stop|reload|restart|status}"
		exit 1
		;;
esac
# End $rc_base/init.d/samba
EOF

Add the run level symlinks:

chmod 754 /etc/rc.d/init.d/samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc0.d/K48samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc1.d/K48samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc2.d/K48samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc3.d/S24samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc4.d/S24samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc5.d/S24samba &&
ln -s  /etc/rc.d/init.d/samba /etc/rc.d/rc6.d/K48samba

Now, we'll use our new boot script to start Samba :

/etc/rc.d/init.d/samba start

We have to add the SAMBABOX root account to the Samba user list first in order to join WIN2KBOX to the DOMAIN01 domain:

smbpasswd -a root

After starting Samba and adding root to the Samba user list, the first machine we'll join to DOMAIN01 will be WIN2KBOX, the Windows 2000 Server box we created the machine trust account for. On WIN2KBOX:

1.  Right click on My Computer.
2.  Click on Properties.
3.  Click on the Network Identification notebook tab.
4.  Click on the Properties button.
5.  In the Computer Name: edit field enter WIN2KBOX.
6.  Click on the Domain: radio button and enter DOMAIN01 in the edit
    field and click OK.
7.  When presented with the Domain Username And Password dialog box,
    enter root and root's password on SAMBABOX and click OK.
8.  After the machine trust is negotiated, click the OK button in the
    dialog box welcoming you to the DOMAIN01 domain.
9.  Click OK in the reboot reminder dialog box.
10. Click OK to close the System Properties window.
11. Click Yes to reboot WIN2KBOX.

Add a new user to the DOMAIN01 domain.

Before logging on to WIN2KBOX, we will create a new user with the following commands:

useradd -m win2kuser01 &&
passwd win2kuser01 &&
smbpasswd -a win2kuser01

Logging on to DOMAIN01.

Now we will log on the domain as our newly created user as follows:

1. Press Ctrl-Alt-Del to bring up the Log On to Windows dialog box.
2. Enter the win2kuser01 name and password.
3. Select DOMAIN01 from the Log on to: combination box and click OK.

Add the swat entry to /etc/serviceswith the following command:

echo "swat            901/tcp" >> /etc/services

If inetd is used, the following command will add the swat entry to /etc/inetd.conf:

echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" \
    >> /etc/inetd.conf

If xinetd is used, the following command will add the swat entry to /etc/xinetd.conf:

cat >> /etc/xinetd.conf << "EOF"
service swat
{
    port            = 901
    socket_type     = stream
    wait            = no
    only_from       = 127.0.0.1
    user            = root
    server          = /usr/sbin/swat
    log_on_failure  += USERID
}
EOF

The Samba Web Administration Tool, SWAT, can be launched with the following command on SAMBABOX:

lynx http://localhost:901

Note: Be sure inetd is running, and issue a killall -HUP inetd before starting SWAT.

The Lynx browser is used in this demonstration, but is not necessary.


Configuration command explanations

cat > /etc/samba/smb.conf << "EOF" : Create a default Samba configuration file. This configuration will allow Samba to act as a Primary Domain Controller for a Microsoft Windows based network. If this is not desired, a simpler default smb.conf file is bundled with the Samba distribution. See the samba2.2.8a/examples/smb.conf.default file. Primary Domain Controller configuration is slightly more complicated than ordinary member server configuration, so instructions for PDC configuration will be given here.

cat > /etc/rc.d/init.d/samba << "EOF": Create the Samba boot script, used to start and stop Samba automatically on machine startup and shutdown.

/usr/sbin/useradd -g 100 -d /dev/null -c \
    "Win2k Server" -s /bin/false win2kbox$
This command creates a machine trust account, necessary only for Windows 2000/NT servers to authenticate to our new PDC. Machine trust accounts are not necessary for Win95/98 clients.

echo "swat 901/tcp" >> /etc/services: Register the swat service to run on port 901.

echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" >> /etc/inetd.conf: Instruct inetd where to find and how to run swat.

ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc3.d/S600samba etc.: Create the Samba boot scripts, used to start and stop Samba automatically on machine startup and shutdown.


Contents

The Samba package contains make_smbcodepage, make_unicodemap, mount.smbfs, nmbd, nmblookup, rpcclient, smbcacls, smbclient, smbcontrol, smbd, smbpasswd, smbspool, smbstatus, swat, testparm, testprns, wbinfo and winbindd.


Description

make_smbcodepage

make_smbcodepage converts text descriptions of code pages to binary code page files and vice versa.


make_unicodemap

make_unicodemap converts text Unicode map files to binary, for use in mapping characters to 16 bit Unicode.


mount.smbfs

mount.smbfs provides /bin/mount with a way to mount remote windows (or samba) fileshares.


nmbd

nmbd is the Samba NetBIOS name server.


nmblookup

nmblookup is used to query NetBIOS names and map them to IP addresses.


rpcclient

rpcclient is used to execute MS-RPC client side functions.


smbcacls

smbcacls is used to manipulate NT access control lists.


smbclient

smbclient is a SMB/CIFS access utility, similar to FTP.


smbcontrol

smbcontrol is used to control running smbd , nmbd and winbindd daemons.


smbd

smbd is the main Samba daemon.


smbpasswd

smbpasswd changes a user's Samba password.


smbspool

smbspool sends a print job to an SMB printer.


smbstatus

smbstatus reports current Samba connections.


swat

swat is the Samba Web Administration Tool.


testparm

testparm checks an smb.conf file for proper syntax.


testprns

testprns tests printer names.


wbinfo

wbinfo queries a running winbindd daemon.


winbindd

winbindd resolves names from NT servers.


xinetd-2.3.12

Introduction to xinetd

xinetd is the eXtended InterNET services Daemon, a secure replacement for inetd.


Package information


Installation of xinetd

Install xinetd by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Command explanations

./configure --prefix=/usr: Change the default installation directory of /usr/local.


Configuring xinetd

Config files

/etc/xinetd.conf


Configuration Information

Create the xinetd.conf file with the following commands:

cp /etc/xinetd.conf /etc/xinetd.conf.bak

Insure the path to all daemons is /usr/sbin, rather than the default path of /usr/etc:

sed -e 's/etc/sbin/g' xinetd/sample.conf > /etc/xinetd.conf

The format of the /etc/xinetd.conf is documented in the xinetd.conf man page. Further information can be found at http://www.xinetd.org.

Create the xinetd boot script:

cat > /etc/rc.d/init.d/xinetd << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/xinetd
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
source /etc/sysconfig/rc
source $rc_functions
case "$1" in
	start)
		echo "Starting xinetd..."
		loadproc /usr/sbin/xinetd
		;;
	stop)
		echo "Stopping xinetd..."
		killproc /usr/sbin/xinetd
		;;
	reload)
		echo "Reloading xinetd..."
		killall -HUP xinetd
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	status)
		statusproc /usr/sbin/xinetd
		;;
	*)
		echo "Usage: $0 {start|stop|reload|restart|status}"
		exit 1
		;;
esac
# End $rc_base/init.d/xinetd
EOF
chmod 754 /etc/rc.d/init.d/xinetd

Add the run level symlinks:

ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc0.d/K49xinetd &&
ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc1.d/K49xinetd &&
ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc2.d/K49xinetd &&
ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc3.d/S23xinetd &&
ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc4.d/S23xinetd &&
ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc5.d/S23xinetd &&
ln -s  /etc/rc.d/init.d/xinetd /etc/rc.d/rc6.d/K49xinetd

Now, we'll use our new boot script to start xinetd:

/etc/rc.d/init.d/xinetd start

Checking the /var/log/daemon.log file should prove quite entertaining. This file may contain entries similar to the following:

Aug 22 21:40:21 dps10 xinetd[2696]: Server /usr/sbin/in.rlogind is not
executable [line=29]
Aug 22 21:40:21 dps10 xinetd[2696]: Error parsing attribute server -
DISABLING SERVICE [line=29]
Aug 22 21:40:21 dps10 xinetd[2696]: Server /usr/sbin/in.rshd is not
executable [line=42]

These errors are due to the fact that we don't have most of the servers that xinetd is trying to control installed yet.


Contents

The xinetd package contains xinetd, itox and xconv.pl.


Description

xinetd

xinetd is the Internet services daemon.


itox

itox is a utility used for converting inetd.conf files to xinetd.conf format.


xconv.pl

xconv.pl is a Perl script used for converting inetd.conf files to xinetd.conf format, similar to itox.

VII. Content Serving

Table of Contents
24. Databases
25. Web serving

Chapter 24. Databases

This chapter includes databases that range from single-user read/write to industrial database servers with transaction support. Generally, you will be sent here to satisfy dependencies to other applications although building a SQL server on a base LFS system is entirely possible.


Berkeley DB-4.1.25

Introduction to Berkeley DB

The Berkeley DB package contains programs and utilities used by many other applications for database related functions.


Package information


Installation of Berkeley DB

Install Berkeley DB by running the following commands:

cd build_unix &&
../dist/configure --prefix=/usr \
    --enable-compat185 \
    --enable-cxx &&
make &&
make docdir=/usr/share/doc/db-4.1.25 install

Note: If you wish to enable Java support in Berkeley DB-4.1.25, add --enable-java to the configure options. Java support is needed if you plan to use system installed Berkeley DB when compiling OpenOffice.


Command explanations

cd build_unix && ../dist/configure --prefix=/usr --enable-compat185: This replaces the normal ./configure command as Berkeley DB comes with the various build directories for different platforms.

make docdir=/usr/share/doc/db-4.1.25 install: This installs the documentation in the correct place.


Configuring Berkeley DB

Configuration Information

If you recompile Perl after installing Berkeley DB-4.1.25 you will need to apply the perl-5.8.0-db-4.1.patch patch available at http://downloads.linuxfromscratch.org/blfs-patches.


Contents

The Berkeley DB package contains db_archive, db_checkpoint, db_deadlock, db_dump, db_load, db_printlog, db_recover, db_stat, db_upgrade and db_verify.


Description

db_archive

db_archive prints the pathnames of log files that are no longer in use.


db_checkpoint

db_checkpoint is a daemon process used to monitor and checkpoint database logs.


db_deadlock

db_deadlock is used to abort lock requests when deadlocks are detected.


db_dump

db_dump converts database files to a flat file format readable by db_load.


db_load

db_load is used to create database files from flat files created with db_dump.


db_printlog

db_printlog converts database log files to human readable text.


db_recover

db_recover is used to restore a database to a consistent state after a failure.


db_stat

db_stat displays database environment statistics.


db_upgrade

db_upgrade is used to upgrade database files to a newer version of Berkeley DB.


db_verify

db_verify is used to run consistency checks on database files.


Berkeley DB-3.3.11

Introduction to Berkeley DB-3.3.11

The Berkeley DB package contains version 3.3.11 of the Berkeley Database.


Package information


Installation of Berkeley DB

Install Berkeley DB by running the following commands:

cd build_unix &&
../dist/configure --prefix=/opt/db-3.3 --enable-compat185 &&
make &&
make docdir=/opt/db-3.3/doc/Berkeley-DB install &&
cd /opt/db-3.3/lib/ &&
rm -f libdb.so &&
for i in $(ls); do mv $i /usr/lib; ln -sf /usr/lib/$i; done &&
cd /opt/db-3.3/include/ &&
sed 's/^DB185/DB/' db_185.h > db_185.h.new &&
mv db_185.h.new db_185.h &&
ln -nsf /opt/db-3.3/include /usr/include/db3

Command explanations

sed 's/^DB185/DB/' /usr/include/db_185.h > /usr/include/db_185.h.new: Change the DB185 database pointer to DB.


Contents

The Berkeley DB package contains db_archive, db_checkpoint, db_deadlock, db_dump, db_load, db_printlog, db_recover, db_stat, db_upgrade and db_verify.


Description

db_archive

db_archive prints the pathnames of log files that are no longer in use.


db_checkpoint

db_checkpoint is a daemon process used to monitor and checkpoint database logs.


db_deadlock

db_deadlock is used to abort lock requests when deadlocks are detected.


db_dump

db_dump converts database files to a flat file format readable by db_load.


db_load

db_load is used to create database files from flat files created with db_dump.


db_printlog

db_printlog converts database log files to human readable text.


db_recover

db_recover is used to restore a database to a consistent state after a failure.


db_stat

db_stat displays database environment statistics.


db_upgrade

db_upgrade is used to upgrade database files to a newer version of Berkeley DB.


db_verify

db_verify is used to run consistency checks on database files.


MySQL-4.0.15

Introduction to MySQL

MySQL is a widely used and fast SQL database server. It is a client/server implementation that consists of a server daemon and many different client programs and libraries.


Package information


MySQL dependencies


Installation of MySQL

For security reasons, running the server as an unprivileged user and group is strongly encouraged:

groupadd mysql &&
useradd -c mysql -d /dev/null -g mysql -s /bin/false mysql

Build and install MySQL by running the following commands:

cp configure configure.old &&
sed -e "s%mysql-test/Makefile%%" -e "s% mysql-test%%" configure.old > configure &&
./configure --prefix=/usr \
            --sysconfdir=/etc \
            --libexecdir=/usr/sbin \
            --localstatedir=/var/lib/mysql \
            --enable-thread-safe-client \
            --enable-local-infile \
            --without-debug \
            --without-bench &&
make &&
make install

Command explanations

sed -e "s%mysql-test/Makefile%%" -e "s% mysql-test%%" configure.old > configure: This sed is used to disable the mysql test suite.


Configuring MySQL

Config files

/etc/my.cnf, ~/.my.cnf


Configuration Information

There are several default configurations file available in /usr/share/mysql which you can use.

cp /usr/share/mysql/my-medium.cnf /etc/my.cnf

We can now install a database and change the ownership to the unprivileged user and group.

mysql_install_db
chown -R mysql:mysql /var/lib/mysql

Further configuration requires that the mysql server be running:

mysqld_safe --user=mysql 2>&1 >/dev/null &

A default installation does not setup a password for the administrator. So here we will login and set one. We strongly suggest changing 'new-password' to your own.

mysql -uroot mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.51-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> UPDATE user SET password=password('new-password') WHERE user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> EXIT;
bye

Now that we are done with the configuration of the server, we can shut it down.

kill `pidof -x mysqld_safe mysqld`

MySQL init.d script

To automate the running of MySQL, use the following command to create the init.d script:

cat > /etc/rc.d/init.d/mysql << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting MySQL daemon..."
                /usr/bin/mysqld_safe --user=mysql 2>&1 >/dev/null &
                evaluate_retval
                ;;

        stop)
                echo "Stopping MySQL daemon..."
                killproc mysqld
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                statusproc /usr/sbin/mysqld
                ;;

        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/
EOF
chmod 755 /etc/rc.d/init.d/mysql

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/mysql ../rc0.d/K26mysql &&
ln -sf ../init.d/mysql ../rc1.d/K26mysql &&
ln -sf ../init.d/mysql ../rc2.d/K26mysql &&
ln -sf ../init.d/mysql ../rc3.d/S34mysql &&
ln -sf ../init.d/mysql ../rc4.d/S34mysql &&
ln -sf ../init.d/mysql ../rc5.d/S34mysql &&
ln -sf ../init.d/mysql ../rc6.d/K26mysql

Contents

The MySQL package contains comp_err, isamchk, isamlog, msql2mysql, my_print_defaults, myisamchk, myisamlog, myisampack, mysql, mysql_config, mysql_convert_table_format, mysql_explain_log, mysql_find_rows, mysql_fix_extensions, mysql_fix_privilege_tables, mysql_install, mysql_install_db, mysql_secure_installation, mysql_setpermission, mysql_tableinfo, mysql_waitpid, mysql_zap, mysqlacess, mysqladmin, mysqlbinlog, mysqlbug, mysqlcheck, mysqld, mysqld_multi, mysqld_safe, mysqldump, mysqldumpslow, mysqlhotcopy, mysqlimport, mysqlmanager-pwgen, mysqlmanagerc, mysqlshow, mysqltest, pack_isam, perror, replace, resolve_stack_dump, resolveip, libdbug, libheap, libmerge, libmyisam, libmyisammrg, libmysqlclient, libmystrings, libmysys, libnisam and libvio.


Description

A package listing would be several pages long, we suggest consulting the MySQL documentation for full details, instead.

Certain MySQL support programs may require the Perl DBI modules to be installed to function properly.


PostgreSQL-7.3.4

Introduction to PostgreSQL

PostgreSQL is an advanced object-relational database management system (ORDBMS), derived from the Berkeley Postgres database management system.


Package information


PostgreSQL dependencies


Installation of PostgreSQL

Install PostgreSQL with the following commands:

./configure --prefix=/usr &&
make &&
make install

Initialize a database cluster with the following commands:

mkdir -p /var/pgsql/data &&
useradd -d /var/pgsql/data postgres &&
chown postgres /var/pgsql/data &&
su - postgres -c '/usr/bin/initdb -D /var/pgsql/data'

Start the database server with the following command:

su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > \
        /var/pgsql/data/logfile 2>&1 &'

Now we can create a database and verify the installation:

su - postgres -c '/usr/bin/createdb test'
echo "create table t1 ( name varchar(20), state_province varchar(20) );" \
                | (su - postgres -c '/usr/bin/psql test ')
		
echo "insert into t1 values ('Billy', 'NewYork');" \
                | (su - postgres -c '/usr/bin/psql test ')
echo "insert into t1 values ('Evanidus', 'Quebec');" \
	        | (su - postgres -c '/usr/bin/psql test ')
echo "insert into t1 values ('Jesse', 'Ontario');" \
                | (su - postgres -c '/usr/bin/psql test ')
		
echo "select * from t1;" | (su - postgres -c '/usr/bin/psql test')

Command explanations

useradd -d /var/pgsql/data postgres: Add an unprivileged user to run the database server. Running the server as root is dangerous, and moreover simply will not work.

su - postgres -c '/usr/bin/initdb -D /var/pgsql/data': Initialize the database tablespace. This command may not be executed by root.

su - postgres -c '/usr/bin/postmaster -D /var/pgsql/data > /var/pgsql/data/logfile 2>&1 &': Start the database server. User postgres must execute this command as well.

createdb test, create table t1 , insert into t1 values..., select * from t1: Create a database, add a table to it, insert some rows into the table and select them to verify that the installation is working properly.


Configuring PostgreSQL

Config files

$PGDATA/pg_ident.con, $PGDATA/pg_hba.conf, $PGDATA/postgresql.conf

The PGDATA environment variable is used to distinguish database clusters from one another by setting it to the value of the directory which contains the cluster desired. The three configuration files exist in every PGDATA/ directory. Details on the format of the files and the options that can be set in each can be found in file:///usr/share/doc/postgresql/html/index.html.

Create the boot script with the following:

cat > /etc/rc.d/init.d/postgresql << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/postgresql

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting PostgreSQL daemon..."
		su - postgres -c '/usr/bin/pg_ctl start -W -D /var/pgsql/data \
                               -l /var/pgsql/data/logfile -o "-i" '
                evaluate_retval
                ;;

        stop)
                echo "Stopping PostgreSQL daemon..."
                /usr/bin/pg_ctl stop -m smart -D /var/pgsql/data
		evaluate_retval
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                /usr/bin/pg_ctl status -D /var/pgsql/data
                ;;

        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/
EOF
chmod 755 /etc/rc.d/init.d/postgresql

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/postgresql ../rc0.d/K26postgresql &&
ln -sf ../init.d/postgresql ../rc1.d/K26postgresql &&
ln -sf ../init.d/postgresql ../rc2.d/K26postgresql &&
ln -sf ../init.d/postgresql ../rc3.d/S34postgresql &&
ln -sf ../init.d/postgresql ../rc4.d/S34postgresql &&
ln -sf ../init.d/postgresql ../rc5.d/S34postgresql &&
ln -sf ../init.d/postgresql ../rc6.d/K26postgresql

Contents

The PostgreSQL package contains clusterdb, createdb, createlang, createuser, dropdb, droplang, dropuser, ecpg, initdb, initlocation, ipcclean, pg_config, pg_controldata, pg_ctl, pg_dump, pg_dumpall, pg_encoding, pg_id, pg_resetxlog, pg_restore, postgres, postmaster, psql, vacuumdb, libecpg, libpq and various charset modules.


Description

clusterdb

clusterdb is a utility for reclustering tables in a PostgreSQL database.


createdb

createdb creates a new PostgreSQL database.


createlang

createlang defines a new PostgreSQL procedural language.


createuser

createuser defines a new PostgreSQL user account.


dropdb

dropdb removes a PostgreSQL database.


droplang

droplang removes a PostgreSQL procedural language.


dropuser

dropuser removes a PostgreSQL user account.


ecpg

ecpg is the embedded SQL preprocessor.


initdb

initdb create a new database cluster.


initlocation

initlocation creates a secondary database storage area.


ipcclean

ipcclean removes share memory and semaphores left over by an aborted database server.


pg_config

pg_config retrieves PostgreSQL version information.


pg_controldata

pg_controldata returns information initialized during initdb, such as the catalog version and server locale.


pg_ctl

pg_ctl controls stopping and starting the database server.


pg_dump

pg_dump dumps database data and metadata into scripts which are used to recreate the database.


pg_dumpall

pg_dumpall recursively calls pg_dump for each database in a cluster.


pg_resetxlog

pg_resetxlog clears the write-ahead log and optionally resets some fields in the pg_control file.


pg_restore

pg_restore creates databases from dump files created by pg_dump.


postgres

postgres is a single user database server, generally used for debugging.


postmaster

postmaster is the multi-user database daemon.


psql

psql is a console based database shell.


vacuumdb

vacuumdb compacts databases and generates statistics for the query analyzer.


Chapter 25. Web serving

This chapter includes applications that respond to requests originating from the Internet. Specifically covered are HTTP requests and FTP requests.


Apache-2.0.47

Introduction to Apache

The Apache package contains an open-source HTTP server. It is useful for creating local intranet web sites or running huge web serving operations.


Package information


Installation of Apache

For security reasons, running the server as an unprivileged user and group is strongly encouraged.

groupadd apache &&
useradd -c apache -d /dev/null -g apache -s /bin/false apache

The following patch will define the layout of destination directories and, among them, the build directory at /usr/lib/apache/build. This will allow the modules added to Apache to be configured without errors. Apply the patch:

patch -Np1 -i ../httpd-2.0.47-config.patch

Build and install Apache by running the following commands:

./configure --enable-layout=LFS \
            --enable-mods-shared=all &&
make &&
make install

Command explanations

--enable-mods-shared=all: We want modules to be compiled and used as Dynamic Shared Objects (DSOs) so they can be included and excluded from the server using the run-time configuration directives.


Configuring Apache

Config files

/etc/apache/*


Configuration Information

The main configuration file is called httpd.conf. See http://httpd.apache.org/docs-2.0/configuring.html for detailed instructions on customizing your Apache HTTP server.

To automate the running of Apache, use the following command to create the init.d script:

cat > /etc/rc.d/init.d/apache << "EOF"
#!/bin/bash

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting Apache daemon..."
                /usr/sbin/apachectl -k start
                evaluate_retval
                ;;

        stop)
                echo "Stopping Apache daemon..."
                /usr/sbin/apachectl -k stop
                evaluate_retval
                ;;

        restart)
                echo "Restarting Apache daemon..."
                /usr/sbin/apachectl -k restart
                evaluate_retval
                ;;

        status)
                statusproc /usr/sbin/httpd
                ;;
                
        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
                ;;
esac
EOF
chmod 755 /etc/rc.d/init.d/apache

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/apache ../rc0.d/K28apache &&
ln -sf ../init.d/apache ../rc1.d/K28apache &&
ln -sf ../init.d/apache ../rc2.d/K28apache &&
ln -sf ../init.d/apache ../rc3.d/S32apache &&
ln -sf ../init.d/apache ../rc4.d/S32apache &&
ln -sf ../init.d/apache ../rc5.d/S32apache &&
ln -sf ../init.d/apache ../rc6.d/K28apache

Contents

The Apache package provides ab, apachectl, apr-config, apu-config, apxs, checkgid, dbmmanage, htdbm, htdigest, htpasswd, httpd, instdso.sh, logresolve, rotatelogs, libapr, libaprutil and various modules.


Description

ab

ab is a tool for benchmarking your Apache HTTP server.


apachectl

apachectl is a front end to the Apache HTTP server which is designed to help the administrator control the functioning of the Apache httpd daemon.


apxs

apxs is a tool for building and installing extension modules for the Apache HTTP server.


dbmmanage

dbmmanage is used to create and update the DBM format files used to store usernames and password for basic authentication of HTTP users.


htdigest

htdigest is used to create and update the flat-files used to store usernames, realm and password for digest authentication of HTTP users.


htpasswd

htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users.


httpd

httpd is the Apache HTTP server program.


instdso.sh

instdso.sh is a script which installs Apache DSO modules.


logresolve

logresolve is a post-processing program to resolve IP-addresses in Apache's access log files.


rotatelogs

rotatelogs is a simple program for use in conjunction with Apache's piped log file feature.


PHP-4.3.3

Introduction to PHP

PHP is the PHP Hypertext Preprocessor. Primary used in dynamic web sites, it allows for programming code to be directly embedded into the HTML code.


Package information


Installation of PHP

Install PHP by running the following commands:

./configure --prefix=/usr --with-apxs2=/usr/sbin/apxs \
    --with-config-file-path=/etc --with-openssl=/usr \
    --with-zlib=/usr --enable-bcmath --with-bz2=/usr \
    --with-curl --enable-ftp --with-gd --with-jpeg-dir=/usr \
    --enable-gd-native-ttf --with-db4 --with-png-dir=/usr \
    --with-freetype-dir=/usr --with-gettext --with-mysql=/usr \
    --with-ncurses --sysconfdir=/etc &&
make &&
make install &&
cp php.ini-dist /etc/php.ini

Note: PHP has many more configure options that will enable support for certain things. You can use ./configure --help to see a full list of the available options. Also, use of the PHP web site is highly recommended, as their online docs are very good.


Configuring PHP

Config files

/etc/php.ini, /etc/pear.conf


Configuration Information

To enable PHP support in the Apache web server, a new AddType directive must be added to the httpd.conf file:

AddType application/x-httpd-php .php

Also, it can be useful to add an entry for index.php to the DirectoryIndex directive of the httpd.conf file.


ProFTPD-1.2.8p

Introduction to ProFTPD

The ProFTPD package contains a secure and highly configurable FTP daemon. This is useful for serving large file archives over a network.


Package information


ProFTPD dependencies


Installation of ProFTPD

For security reasons, running ProFTPD as an unprivileged user and group is encouraged.

groupadd proftpd &&
useradd -c proftd -d /home/ftp -g proftpd -s /bin/false proftpd

Install ProFTPD by running the following commands:

install_user=proftpd install_group=proftpd \
   ./configure --prefix=/usr --sysconfdir=/etc \
   --localstatedir=/var &&
make &&
make install 

Command explanations

install_user=proftpd install_groud=proftpd : Specify the user and group identity for ProFTPD.

--prefix=/usr : This installs ProFTPD in /usr instead of /usr/local.

--sysconfigdir=/etc : This prevents the configuration files from going to /usr/etc.

--localstatedir=/var : This uses /var instead of /usr/var for lock and log files.


Configuring ProFTPD

Config files

/etc/proftpd.conf

This is a simple, download-only sample configuration. See the ProFTPD documentation in /usr/share/doc/proftpd and consult the website at http://www.proftpd.net/ for example configurations.

cat > /etc/proftpd.conf << "EOF"
# This is a basic ProFTPD configuration file
# It establishes a single server and a single anonymous login.

ServerName			"ProFTPD Default Installation"
ServerType			standalone
DefaultServer			on

# Port 21 is the standard FTP port.
Port				21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances			30

# Set the user and group that the server normally runs at.
User				proftpd
Group				proftpd

# Normally, we want files to be overwritable.
<Directory /*>
  AllowOverwrite		on
</Directory>

# A basic anonymous configuration, no upload directories.
<Anonymous ~proftpd>
  User				proftpd
  Group				proftpd
  # We want clients to be able to login with "anonymous" as well as "proftpd"
  UserAlias			anonymous proftpd

  # Limit the maximum number of anonymous logins
  MaxClients			10

  # We want 'welcome.msg' displayed at login, and '.message' displayed
  # in each newly chdired directory.
  DisplayLogin			welcome.msg
  DisplayFirstChdir		.message

  # Limit WRITE everywhere in the anonymous chroot
  <Limit WRITE>
    DenyAll
  </Limit>
</Anonymous>
EOF

proftpd init.d script

cat > /etc/rc.d/init.d/proftpd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/proftpd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
	        echo "Starting FTP Server..."
	        loadproc /usr/sbin/proftpd
	        ;;

	stop)
	        echo "Stopping FTP Server..."
	        killproc /usr/sbin/proftpd
	        ;;

	reload)
	        echo "Reloading FTP Server..."
	        reloadproc /usr/sbin/proftpd
	        ;;
	     
	restart)
	        $0 stop
	        sleep 1
	        $0 start
	        ;;

	status)
	        statusproc /usr/sbin/proftpd
	        ;;

	*)
	        echo "Usage: $0 {start|stop|reload|restart|status}"
	        exit 1
	        ;;
esac

# End $rc_base/init.d/proftpd
EOF
chmod 755 /etc/rc.d/init.d/proftpd

Create the symbolic links to this file in the relevant rc.d directories with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/proftpd ../rc0.d/K50proftpd &&
ln -sf ../init.d/proftpd ../rc1.d/K50proftpd &&
ln -sf ../init.d/proftpd ../rc2.d/K50proftpd &&
ln -sf ../init.d/proftpd ../rc3.d/S50proftpd &&
ln -sf ../init.d/proftpd ../rc4.d/S50proftpd &&
ln -sf ../init.d/proftpd ../rc5.d/S50proftpd &&
ln -sf ../init.d/proftpd ../rc6.d/K50proftpd

Contents

The ProFTPD package contains ftpcount, ftpshut, ftptop, ftpwho and proftpd.


Description

ftpcount

ftpcount shows current number of connections.


ftpshut

ftpshut shuts down all proftpd servers at a given time.


ftptop

ftptop displays running status on connections.


ftpwho

ftpwho shows current process information for each session.


proftpd

proftpd the daemon itself.

VIII. X + Window Managers


Chapter 26. X Window Environment

This chapter contains a graphical user environment.


XFree86-4.3.0.1

Introduction to XFree86

XFree86 is a freely redistributable open-source implementation of the X Window System. XFree86 provides a client/server interface between display hardware (the mouse, keyboard, and video displays) and the desktop environment while also providing both the windowing infrastructure and a standardized application interface (API).


Package information


XFree86 dependencies

Required

libpng-1.2.5.


Recommended

The following packages are included in the XFree86 package, however they are updated more often than the XFree86 package and are highly recommended: expat-1.95.6, FreeType-2.1.5 and Fontconfig-2.2.1

Note: If you choose to not install these separate packages, the host.def file below will have to be modified to instruct XFree86 build them.


Download Instructions

There are several files that need to be fetched from the download location:

  • X430src-1.tgz

  • X430src-2.tgz

  • X430src-3.tgz

  • X430src-4.tgz

  • X430src-5.tgz

  • X430src-6.tgz

  • X430src-7.tgz

You should also download the patch file: ftp://ftp.xfree86.org/pub/XFree86/4.3.0/fixes/4.3.0-4.3.0.1.diff.gz

The first three packages are the XFree86 programs, the fourth and fifth are fonts, the sixth is normal documentation, and the seventh is hardcopy documentation. There are also two packages doctools-1.3.1.tgz, which contain programs to regenerate hardcopy documentation, and utils-1.1.0.tgz, which contain GNU TAR and zlib which are already installed on an LFS system.

To check your downloads for integrity, download the SUMS.md5sum file. Then:
md5sum X430src* > md5sums &&
diff md5sums SUMS.md5sum
The only differences you should see are for README, doctools-1.3.1.tgz, and utils-1.1.0.tgz files if you did not download them.

The fixes subdirectory also has a SUMS.md5sum and this can be checked against the patch file:
md5sum 4.3.0-4.3.0.1.diff.gz

After unpacking the X430src-?.tgz files, change to the xc directory and run:
gunzip 4.3.0-4.3.0.1.diff.gz &&
patch -Np1 -i 4.3.0-4.3.0.1.diff


Installation of XFree86

Kernel Compilation Settings

If you have an Intel P6 (Pentium Pro, Pentium II and later) it is recommended that you compile MTRR (Memory Type Range Registers) support into the kernel. The kernel can map Cyrix and AMD CPUs to the MTRR interface so selecting this option is useful for those processors also. This option is found in the "Processor type and features" menu. It can increase performance of image write operations 2.5 times or more on PCI or AGP video cards.

In the "Character Devices" section, enable AGP Support and select the chipset support on your motherboard. If you do not know the chipset, you may select all the chip types at the expense of extra kernel size. You can usually determine your motherboard's chipset by doing:
cat /proc/pci

In the "Character Devices" section, disable Direct Rendering Manager unless you have a Direct Rendering Infrastructure (DRI) supported video card. A complete list of DRI supported video cards can be found at http://dri.sourceforge.net in the Status section. Currently, supported cards include those from 3dfx (Voodoo, Banshee), 3Dlabs, ATI (Rage Pro, Rage 128, Radeon 7X00, Radeon 2), Intel (i810, i815), and Matrox (G200, G400, G450). Additionally NVidia provides their own closed source binary drivers. If you do enable DRI here, make sure you select the video card(s) you want to support as a module.

If you made any changes to the kernel configuration, recompile with
make dep &&
make bzImage &&
make modules &&
make modules_install

Copy /usr/src/linux/arch/i386/boot/bzImage and /usr/src/linux/System.map to /boot, edit /etc/lilo.conf appropriately and run lilo. If you use grub, edit /boot/grub/grub.conf and add the new kernel to the boot menu.

Note: If you build XFree86 in a chroot environment, make sure the kernel version of the base system and the target system are the same. This is especially important if you enabled DRI support as a module as instructed above.


Creating host.def

Although XFree86 will compile without a host.def file, the following file is recommended for customizing the installation. Start from the xc directory.

Note: The host.def file is a C file, not the usual configuration file. If you make any changes, be sure the comment characters (/* and */) are balanced. Most of the entries in the file below are commented out with the default settings shown.

cat > config/cf/host.def << "EOF"
/* Begin XFree86 host.def file */

/* System Related Information.  If you read and configure only one
 * section then it should be this one.  The Intel architecture defaults are 
 * set for a i686 and higher.  Axp is for the Alpha architecture and Ppc is  
 * for the Power PC.  Note that there have been reports that the Ppc 
 * optimization line causes segmentation faults during build.  If that 
 * happens, try building without the DefaultGcc2PpcOpt line.  **************/

/* #define DefaultGcc2i386Opt  -O2 -fomit-frame-pointer -march=i686 */
/* #define DefaultGcc2AxpOpt   -O2 -mcpu=ev6 */
/* #define DefaultGcc2PpcOpt   -O2 -mcpu=750 */

/* The following definitions are normally set properly by XFree86's scripts.
 * You can uncomment them if you want to make sure. ************************/
 
/* #define HasMTRRSupport      YES  */ /* Enabled in kernel see kernel docs*/
/* #define HasMMXSupport        NO  */ /* Any i586 or above */
/* #define HasKatmaiSupport     NO  */ /* PIII SSE instructions */
/* #define Has3DNowSupport      NO  */ /* AMD instructions */


/* This setting reduces compile time a little by omitting rarely used input 
 * devices.  You can find the complete list in config/cf/xfree86.cf ********/
 
#define XInputDrivers                 mouse void

/* VIDEO DRIVERS ***********************************************************/

/* If you are sure you only want the drivers for one or a few video cards,
 * you can delete the drivers you do not want. *****************************/ 


#define XF86CardDrivers  mga glint nv tga s3 s3virge sis rendition \
                         neomagic i740 tdfx savage \
                         cirrus vmware tseng trident chips apm \
                         GlideDriver fbdev i128 nsc \
                         ati i810 AgpGartDrivers DevelDrivers ark \
                         cyrix siliconmotion \
                         vesa vga \
                         dummy XF86OSCardDrivers XF86ExtraCardDrivers


/* FONT SERVER AND LIBRARY SETTINGS ****************************************/

/* These settings are the defaults   ***************************************/

/* #define BuildFontServer          YES  */ /* For Ghostscript Print Server*/
/* #define SharedLibFont            YES  */
/* #define CompressAllFonts         YES  */
/* #define GzipFontCompression      YES  */

/* These settings ensure we use our libraries ******************************/
#define HasFreetype2             YES
#define HasFontconfig            YES
#define HasExpat                 YES
#define HasLibpng                YES
#define HasZlib                  YES

/* The font path can be redefined in the XF86Config file *******************/

/*
#define DefaultFontPath                $(FONTDIR)/misc/,$(FONTDIR)/75dpi/,\
$(FONTDIR)/100dpi/,$(FONTDIR)/Type1,$(FONTDIR)/local,\
$(FONTDIR)/TrueType,$(FONTDIR)/CID,$(FONTDIR)/Speedo
*/


/* INTERNATIONAL FONTS.  Change to YES if you need any of them.  These  are
 * the defaults. ***********************************************************/

/* #define BuildCyrillicFonts            NO  */
/* #define BuildArabicFonts              NO  */
/* #define BuildISO8859_6Fonts           NO  */
/* #define BuildGreekFonts               NO  */
/* #define BuildISO8859_7Fonts           NO  */
/* #define BuildHebrewFonts              NO  */
/* #define BuildISO8859_8Fonts           NO  */
/* #define BuildKOI8_RFonts              NO  */
/* #define BuildJapaneseFonts            NO  */
/* #define BuildJISX0201Fonts            NO  */
/* #define BuildKoreanFonts              NO  */
/* #define BuildChineseFonts             NO  */

/* DOCUMENTATION SETTINGS **************************************************/

/* These setting are the defaults. *****************************************/

/* #define BuildLinuxDocHtml             NO  */  /* X Docs in Html format */
/* #define BuildLinuxDocPS               NO  */  /* PostScript format */
/* #define BuildAllSpecsDocs             NO  */  /* Various docs */
/* #define BuildHtmlManPages             NO  */

/* GENERAL SETTINGS: You generally want to leave these alone when
 * building X on an LFS system *********************************************/

#define GccWarningOptions         -pipe /* Speed up compiles */
#define TermcapLibrary            -lncurses
#define XprtServer                YES /* Needed by realplayer */
#define XnestServer               YES
#define XAppLoadDir               EtcX11Directory/app-defaults
#define VarLibDir                 /var/lib
#define XFree86Devel               NO
#define FSUseSyslog               YES
#define ThreadedX                 YES
#define HasPam                     NO        
#define SystemManDirectory        /usr/share/man  /* Instead of /usr/man */
#define HasLibCrypt               YES
#define InstallXinitConfig        YES
#define InstallXdmConfig          YES
#define ForceNormalLib            YES
#define BuildSpecsDocs             NO

/* End XFree86 host.def file */
EOF

Edit the file for your hardware and desires.


Build Commands

Install XFree86 by running the following commands:

WORLDOPTS="" make World 2>&1 | tee xfree-compile.log &&
make install &&
make install.man &&
ln -sf /usr/X11R6/bin /usr/bin/X11 &&
ln -sf /usr/X11R6/lib/X11 /usr/lib/X11 &&
ln -sf /usr/X11R6/include/X11 /usr/include/X11

Updating Direct Rendering Infrastructure (DRI)

If you have one of the supported DRI cards and have enabled DRI kernel modules as explained above, you now need to update the kernel modules to ensure they are compatible with the current version of XFree86. To do this, perform the following:

cd programs/Xserver/hw/xfree86/os-support/linux/drm/kernel && 
make  CC=/opt/gcc-2.95.3/bin/gcc -f Makefile.linux  && 
mkdir -p /lib/modules/`uname -r`/kernel/drivers/char/drm/  && 
cp gamma.o radeon.o sis.o r128.o i810.o i830.o mga.o tdfx.o \
    /lib/modules/`uname -r`/kernel/drivers/char/drm/  && 
depmod -a

Warning

If you recompile or upgrade your kernel, you will need to re-copy the appropriate driver module(s) to the kernel module library and rerun depmod.

Note: If you created AGP support as a module when compiling the kernel, you may have to add a line to /etc/modules.conf to ensure the agpgart module is loaded. For instance, the AGP version of the Radeon video card will use the radeon.o driver. It will need to have the line
below radeon agpgart
in /etc/modules.conf to enable DRI support.


Command explanations

WORLDOPTS="" make World 2>&1 | tee xfree-compile.log: This command runs multiple makefiles to completely rebuild the system. WORLDOPTS="" disables the default setting to continue after encountering an error. 2>&1 redirects error messages to the same location as normal output. The tee command allows viewing of the output while logging the results to a file.

Note: When rebuilding XFree86, a separate command that may be used if only minor changes are made to the sources is make Everything. This does not automatically remove generated files and only rebuilds those files or programs that are out of date.

ln -sf /usr/X11R6/bin /usr/bin/X11, ln -sf /usr/X11R6/lib/X11 /usr/lib/X11, and ln -sf /usr/X11R6/include/X11 /usr/include/X11: These commands are present to enable other (broken) packages to build against XFree86. We do this even though the Filesystem Hierarchy Standard says: "In general, software must not be installed or managed via the above symbolic links. They are intended for utilization by users only."

make CC=/opt/gcc-2.95.3/bin/gcc -f Makefile.linux: This builds the XFree86 compatible kernel modules using the same compiler used to compile the kernel.

cp gamma.o radeon.o sis.o r128.o i810.o i830.o mga.o tdfx.o /lib/modules/`uname -r`/kernel/drivers/char/drm/: Put the kernel module(s) where the kernel can find them. You only need to copy the driver you need to support your video card.

depmod -a: Update the modules.dep file for module management.


Configuring XFree86

Edit /etc/ld.so.conf and add /usr/X11R6/lib. Run
ldconfig

Add /usr/X11R6/bin to your PATH environment variable in .bash_profile. The statement should look something like PATH=$PATH:/usr/X11R6/bin and be placed before the export PATH statement.

Run
source ~/.bash_profile

Set up your mouse:
cd /dev
ln -s psaux mouse
Adjust the symbolic link as necessary for other types of mice. For instance, a serial mouse on the first serial port would be linked to ttyS1.

Create the XF86Config file with
cd ~
XFree86 -configure
The screen will go black and you may hear some clicking of the monitor. This command will create a file, XF86Config.new in your home directory.

Edit XF86Config.new to suit your system. The details of the file are located in the man page man XF86Config. Some things you may want to do are:

  • Section "Files". Change the order of the font paths searched. You may want to put 100dpi fonts ahead of 75dpi fonts if your system normally comes up closer to 100 dots per inch. You may want to remove some font directories completely.

  • Section "Monitor". Specify the VertRefresh and HorizSync values if the system does not automatically detect the monitor and its values.

  • Section "InputDevice". You may want to change the keyboard autorepeat rate by adding Option "Autorepeat" "250 30".

  • Section "Device". You may want to set some of the options available for your selected video driver. A description of the driver parameters is in the man page for your driver.

  • Section "Screen". Add a DefaultDepth statement such as: DefaultDepth 16. In the SubSection for your default depth, add a modes line such as: Modes "1280x1024" "1024x768". The first mode listed will normally be the starting resolution.

Test the system with
XFree86 -xf86config ~/XF86Config.new
You will only get a gray background with an X-shaped mouse cursor, but it confirms the system is working. Exit with Control-Alt-Backspace. If the system does not work, take a look at /var/log/XFree86.0.log to see what went wrong.

Move the configuration file to its final location
mv ~/XF86Config.new /etc/X11/XF86Config

Create .xinitrc
cat > ~/.xinitrc << "EOF"
# Begin .xinitrc file
xterm  -g 80x40+0+0   &
xclock -g 100x100-0+0 &
twm
EOF
This provides an initial screen with an xterm and a clock that is managed by a simple window manager, Tab Window Manager. For details of twm, see the man page.

Start X with
startx
to get basic functional X Window System.


Contents

The XFree86 package contains the X Window System for Linux (and other operating systems). It includes the X server, fonts, xterm, a simple window manager (twm), various utilities, video output drivers, and various input drivers including the mouse and keyboard.

XFree86 also contains libraries and header files for development of the X Window System programs.


Description

Note: The following list of programs is not comprehensive. The full list is in /usr/X11R6/bin. For additional information about these programs, see the respective man page.


XFree86

XFree86 is the X11R6 implementation of the X Window System server.


xf86config

xf86config is an interactive program for generating an XF86Config file for use with XFree86 X servers.


xf86cfg

xf86cfg is a tool to configure XFree86 that can be used to either write the initial configuration file or make customizations to the current configuration.


startx

startx is a script to initialize the X session. It runs xinit.


xinit

xinit is used to start the X Window System server.


twm

twm is a Tab Window Manager for the X Window System.


xterm

xterm is a terminal emulator for X.


xwininfo

xwininfo is a window information utility for X.


x11perf

x11perf is an X11 server performance test program.


xlsfonts

xlsfonts is a program to list fonts available to the X server.


xvidtune

xvidtune is a video mode tuner for XFree86.


xload

xload is a system load average display for X.


xcalc

xcalc is a scientific calculator for X.


xclock and oclock

Clock programs for X.


xmodmap

xmodmap is a utility for modifying keymaps and pointer button mappings in X.


XFree86 Components

Checking Direct Rendering Infrastructure (DRI) Installation

DRI is a framework for allowing software to access graphics hardware in a safe and efficient manner. It is installed in XFree86 by default if you have a supported video card. To check if DRI is installed properly, check the log file /var/log/XFree86.0.log for statements like:

(II) R128(0): Direct rendering enabled

From an xterm, run glxinfo and look for the phrase:

direct rendering: Yes

You can also run the test program glxgears. This program brings up a window with three gears turning. The xterm will display how many frames were drawn every five seconds so this is a reasonable benchmark. The window is scalable, and the frames drawn per second is highly dependent on the size of the window.

For troubleshooting problems, check the DRI Users Guide at http://dri.sourceforge.net/doc/DRIuserguide.html.


Adding TrueType fonts to XFree86

TrueType font support is built into XFree86. The following items need to be completed to make the fonts available.

  • Establish a directory for the fonts and move any TrueType fonts you want into that directory.

  • Create the fonts.scale and fonts.dir files in the TrueType font directory.

  • Ensure the TrueType module is loaded in XF86Config.

  • Ensure the FontPath in XF86Config contains the TrueType font directory.


Establish a TrueType font directory

The build of XFree86 as given above automatically creates a TrueType font directory: /usr/X11R6/lib/X11/fonts/TTF. This directory already has some TrueType fonts and is set up correctly. If this directory is satisfactory, copy any other TrueType fonts you want into that directory. If not, create a new directory, preferably in the /usr/X11R6/lib/X11/fonts/ directory and put your TrueType fonts there.


Create fonts.scale and fonts.dir

Now change to the directory where you have your TrueType fonts and run
mkfontscale &&
mkfontdir


Ensure TrueType is loaded in XF86Config

The "Module" section should look like:
Section "Module"
        ...
        Load  "freetype"
        ...
EndSection


Ensure the FontPath in XF86Config points to the TrueType font directory

The "Files" section should look like
Section "Files"
        ...
        FontPath "/usr/X11R6/lib/X11/fonts/[TrueTypeDir]/"
        ...
EndSection


Update the font cache files

Finally, to update all the font cache files specified in /etc/fonts/fonts.conf, run
fc-cache

XFree86 will now be able to use TrueType fonts when it is restarted. You can check to see if the new fonts are available with the xlsfonts or xfontsel program.

Note: You should re-run mkfontscale and mkfontdir any time you add or delete TrueType fonts. You should also rerun fc-cache each time you add or remove any fonts.


Setting up keyboards

In this version of XFree86, it has been reported that non-Latin keyboard layouts do not include Latin configurations as was previous practice. To set up a keyboard for Latin and non-Latin input, change the XkbLayout keyboard driver option in the InputDevice section of the XF86Config file. For example:

   Section "InputDevice"
     Identifier          "Keyboard0"
     Driver              "Keyboard"
     Option "XkbModel"   "pc105"
     Option "XkbLayout"  "en_US,ru"
     Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
   EndSection

In this example, you can use the Alt-Shift combination to switch between keyboard layouts and use the Scroll Lock LED to indicate when the second layout is active.


Setting up XDM

xdm provides a graphical logon capability and is normally set up in /etc/inittab. Most of the information you need to customize xdm is found in its man page. To execute xdm during bootup, change the initdefault level to 5 and add the following lines to /etc/inittab:

# Run xdm as a separate service
x:5:respawn:/usr/X11R6/bin/xdm -nodaemon


Using XFree86 Resources

There are many options that can be set in XFree86 and X clients via resources. Typically resources are set in the ~/.Xresources file.

The layout of the ~/.Xresources file consists if a list of specifications in the form of

object.subobject[.subobject...].attribute: value

Typically, components of a resource specification are linked together by either tight, represented by a dot (.), or loose, represented by an asterisk (*), bindings. A tight binding indicates that the components on either side of the dot must be directly next to each other as defined in a specific implementation. An asterisk is a wildcard character that means that any number of levels in a defined hierarchy can be between the components. For example, XFree86 offers two new cursors: redglass and whiteglass. To use one of these resources, you need to add the following line:

Xcursor.theme: whiteglass

However, you can specify the background for all clients with:

*background: blue

More specific resource variables will override less specific names.

Resource definitions can be found in the man pages for each respective client.

In order to load your resources, the xrdb program must be called with the appropriate parameters. Typically, the first time resources are loaded, you use:

xrdb -load <filename>

To add resources to XFree86's database in memory use:

xrdb -merge <filename>

The xrdb instruction is usually placed in ~/.xinitrc or ~/.xsession. To get more information, see the xrdb man page.


Chapter 27. X Libraries

This chapter does not contain libraries that are required to run X. It does contain libraries that enhance X. The enhancement is as simple as font support or as complex as libraries that sit between X and applications that run on X whose purpose is to standardize the look and feel and inter-process communications so that applications written by different programmers end up looking and acting similarly. They also assist programmers by supplying common elements.


FreeType-2.1.5

Introduction to FreeType2

The FreeType2 package contains a library to allow XFree86 to properly render TrueType fonts.


Package information


Installation of FreeType2

Install FreeType2 by running the following commands:

cp include/freetype/config/ftoption.h include/freetype/config/ftoption.h.orig &&
sed -e "s%\/\* #define  TT_CONFIG_OPTION_BYTECODE_INTERPRETER \*\/%#define  TT_CONFIG_OPTION_BYTECODE_INTERPRETER%" \
include/freetype/config/ftoption.h.orig > include/freetype/config/ftoption.h &&
./configure --prefix=/usr &&
make &&
make install

Command explanations

sed ... include/freetype/config/ftoption.h: We are enabling the TrueType bytecode interpreter before building the library.


Contents

The FreeType2 package contains libfreetype libraries.


Description

FreeType2 libraries

FreeType2 libraries add TrueType font capabilities to XFree86.


Fontconfig-2.2.1

Introduction to Fontconfig

The Fontconfig package is a library for configuring and customizing font access.


Package information

Note: The numbering system of Fontconfig is unusual. The beta versions of the package are numbered with a 9x in the last portion of the release number. This means that 2.2.90 is a beta release and the most current release is of the form 2.2.1


Fontconfig dependencies


Installation of Fontconfig

Install Fontconfig by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Configuring Fontconfig

Configuration Information

The configuration file for Fontconfig is /etc/fonts/fonts.conf. Generally you do not want to edit this file. To put a new font directory in the configuration, update the file, /etc/fonts/local.conf with your local information. The default location of fonts in Fontconfig is:

  • /usr/share/fonts

  • ~/.fonts

Because we have not built XFree86 yet, put the following directory entries into /etc/fonts/local.conf:

  • <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>

  • <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>

  • <dir>/usr/X11R6/lib/X11/fonts/truetype</dir>

The Fontconfig program will automatically search the above directories and all subdirectories for needed fonts.

Note: X also includes an internal (and older) version of Fontconfig and unless it is explicitly disabled when building XFree86, the internal version is created leaving two slightly incompatible libraries on your system. It is recommended that you only install one version.


Contents

The Fontconfig package contains the libfontconfig library, fc-cache, and fc-list.


Description

fc-cache

fc-cache is a command to create font information caches.


fc-list

fc-list is a command to list fonts.


Qt-3.2.1

Introduction to Qt

The Qt package contains a C++ GUI library. This is useful for creating graphical applications or executing graphical applications that are dynamically linked to the Qt library.


Package information


Qt dependencies


Installation of Qt

./configure -prefix /opt/qt-3.2.1 -qt-gif -system-libpng \
   -system-libmng -system-zlib -system-libjpeg -no-g++-exceptions \
   -thread &&
make &&
make install &&
ln -sfn /opt/qt-3.2.1 /opt/qt &&
ln -s /opt/qt/lib/libqt-mt.so /opt/qt/lib/libqt.so &&
cp -r doc/man /opt/qt/doc &&
cp -r examples /opt/qt/doc

Note: The build time for Qt is quite long. If you want to save some time and don't want the tutorials and examples, change the first make line above to:

make sub-tools


Command explanations

-prefix /opt/qt-3.2.1: This command sets up the install destination.

-qt-gif: This command adds support for gif files to the libraries.

-system-libpng -system-libmng -system-zlib -system-libjpeg: This command forces the library to use the shared libraries that are on your system instead of recreating its own set of support libraries for these functions.

-no-g++-exceptions: This command disables the exceptions coding generated by the C++ compiler.

-thread: This command compiles the library to support multi-threading.

ln -sfn /opt/qt-3.2.1 /opt/qt: This command standardizes the location of the Qt libraries to the ld.so.conf entry described below.

ln -s /opt/qt/lib/libqt-mt.so /opt/qt/lib/libqt.so: This command allows configure scripts to find a working Qt installation.

cp -r doc/man /opt/qt/doc: This command installs the man directory which is missed by make install.

cp -r examples /opt/qt/doc: This command installs the examples directory which is missed by make install.


Configuring Qt

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory /opt/qt/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. The following command will add it if it is missing:

cat >> /etc/ld.so.conf << "EOF"
# Begin qt addition to /etc/ld.so.conf

/opt/qt/lib

# End qt addition
EOF
ldconfig

You need to add the path for the Qt man pages to the man.conf file. This can be done with the following command:

cat >> /etc/man.conf << "EOF"
# Begin qt addition to man.conf

MANPATH /opt/qt/doc/man

# End qt addition to man.conf
EOF

Contents

The Qt package contains the libqt-mt libraries and libqui libraries.


Description

Qt library

The Qt/X11 library contains API's necessary to use KDE programs.


GTK+-1.2.10

Introduction to GTK+

The GTK+ package contains GTK+ Libraries. This is useful for creating graphical user interfaces for applications.


Package information


Installation of GTK+

Install GTK+ by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

--sysconfdir=/etc: This installs the configuration files into /etc instead of /usr/etc.

--with-xinput=xfree: This configuration flag is necessary to utilize alternative input devices.


Contents

The GTK+ package contains libgtk-1.2 libraries.


Description

GTK+ Libraries

GTK+ Libraries provide the API to implement graphical user interfaces.


Pango-1.2.5

Introduction to Pango

The Pango package contains the libpango library. This is useful for the layout and rendering of text.


Package information


Installation of Pango

In order for Pango to find xft2, the PKG_CONFIG_PATH must include /usr/X11R6/lib/pkgconfig. This is a good place to add it if you haven't already. Specific instructions for modifying this variable can be found in the configuration section of pkgconfig-0.15.0.

Install Pango by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

--sysconfdir=/etc: This switch installs the configuration files into /etc instead of /usr/etc.

--enable-gtk-doc: This switch will rebuild the API documentation during the make command.


Contents

The Pango package contains libpango libraries.


Description

Pango libraries

Pango libraries contain low level layout rendering routines, a high level driver for laying out entire blocks of text, and routines to assist in editing internationalized text.


ATK-1.2.4

Introduction to ATK

The ATK package contains the ATK libraries. They are useful for allowing accessibility solutions to be available for all GTK2 applications.


Package information


ATK dependencies

Required

GLib-2.2.3


Installation of ATK

Install ATK by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Command explanations

--enable-gtk-doc: This switch will rebuild the API documentation during the make command.


Contents

The ATK package contains libatk libraries.


Description

ATK Libraries

ATK libraries contain the API used by assistive technologies in order to interact with the desktop and applications.


GTK+-2.2.4

Introduction to GTK+

The GTK+ package contains GTK+ Libraries. This is useful for creating graphical user interfaces for applications.


Package information


Installation of GTK+

Install GTK+ by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

--sysconfdir=/etc: This switch installs the configuration files into /etc instead of /usr/etc.

--enable-gtk-doc: This switch will rebuild the API documentation during the make command.


Contents

The GTK+ package contains libgtk-x11-2.0 libraries.


Description

GTK+ Libraries

GTK+ Libraries provide the API to implement graphical user interfaces.


LessTif-0.93.46

Introduction to LessTif

The LessTif package contains an Open Source version of OSF/Motif(R).


Package information


LessTif dependencies


Installation of LessTif

Install LessTif by running the following commands:

./configure --prefix=/usr \
    --enable-build-20 \
    --enable-build-21 \
    --disable-debug \
    --enable-production \
    --disable-build-tests \
    --with-xdnd &&
make &&
make install

Command explanations

--enable-build-20: Build the Motif 2.0 compatible version of the LessTif libraries.

--enable-build-21: Also build the Motif 2.1 compatible versions.

--disable-debug: Do not generate debugging information.

--enable-production: Build the release version of the LessTif libraries.

--disable-build-tests: Do not build the test/ tree (see Testing LessTif).

--with-xdnd: Enable XDND GNOME compatibility support.


Configuring LessTif

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Testing LessTif

It is advisable to test the installation of LessTif with the test suite located in lesstif-0.93.46/test. It is not required to install any of the resulting binaries to validate the installation, the following commands, executed from the source directory, will suffice:

cd test &&
./configure &&
make

Contents

The LessTif package contains >LessTif libraries.


Description

lesstif libraries

LessTif libraries are an OSF/Motif(R) source code compatible library for X Window System.


startup-notification-0.5

Introduction to startup-notification

The startup-notification package contains startup-notification libraries. These are useful for building a consistent manner to notify the user through the cursor that the application is loading.


Package information


startup-notification dependencies


Installation of startup-notification

Install startup-notification by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The startup-notification package contains libstartup-notification libraries.


Description

startup-notification libraries

startup-notification libraries provide the functions to assist applications in communicating with the cursor system to provide feedback to the user that the application is loading.


Chapter 28. Window Managers

Window Mangers and Desktop Environments are the primary user interfaces into the X Window System. A window manager is a program that controls the appearance of windows and provides the means by which the user can interact with them. A Desktop Environment provides a more complete interface to the operating system, and provides a range of integrated utilities and applications.

There are many Window Mangers available. Some of the more well known ones include fvwm2, Window Maker, AfterStep, Enlightenment, Sawfish, and Blackbox.

The Desktop Environments available for Linux are GNOME, KDE, and XFce.

Choosing a Window Manager or Desktop Environment is highly subjective. The choice depends on the look and feel of the packages, the resources (RAM, disk space) required, and the utilities included. One web site that provides a very good summary of what is available, screenshots, and their respective features is Window Managers for X.

In this chapter, the installation instructions of several Window Managers and one lightweight Desktop Environment are presented. Later in the book, both KDE and GNOME have their own Parts.


sawfish-1.3

Introduction to sawfish

The sawfish package contains a window manager. This is useful for organizing and displaying windows where all window decorations are configurable and all user-interface policy is controlled through the extension language.


Package information


Installation of sawfish

Install sawfish by running the following commands:

./configure --prefix=/usr --libexec=/usr/sbin --infodir=/usr/share/info \
  --with-gnome-prefix=/opt/gnome-2.2 &&
make &&
make install

Command explanations

--with-audiofile: This command directs sawfish to use libaudiofile for sound manipulation.

--with-esd: This command directs sawfish to use the Enlightened Sound Daemon.

--with-gnome-prefix=/opt/gnome-2.2: This command directs sawfish to GNOME's directory.


Configuring sawfish

Configuration Information

Be sure to backup your current .xinitrc before proceeding.

cat >> ~/.xinitrc << "EOF"
exec sawfish
EOF

Contents

The sawfish package contains sawfish.


Description

sawfish

sawfish is the extensible window manager using a Lisp-based scripting language.


Fluxbox-0.9.5

Introduction to Fluxbox

The Fluxbox package contains a windows manager.


Package information


Fluxbox dependencies


Installation of Fluxbox

Install Fluxbox by running the following commands:

./configure --prefix=/usr --enable-kde --enable-gnome &&
make &&
make install

Command explanations

--enable-kde: This command activates Fluxbox's ability to allow KDE tray icons to be placed in the slit.

--enable-gnome: This command activates Fluxbox's ability to support GNOME.


Configuring Fluxbox

Config files

~/.fluxbox/init, ~/.fluxbox/keys, ~/.fluxbox/menu


Configuration Information

Be sure to backup your current .xinitrc before proceeding.

cat >> ~/.xinitrc << "EOF">
exec fluxbox
EOF
mkdir ~/.fluxbox &&
cp /usr/share/fluxbox/init ~/.fluxbox/init &&
cp /usr/share/fluxbox/keys ~/.fluxbox/keys &&
cp /usr/share/fluxbox/menu ~/.fluxbox/menu 

Menu Items are added by editing~/.fluxbox/menu. The syntax is explained on the fluxbox man page.


Contents

The Fluxbox package contains fluxbox, bsetbg and bsetroot.


Description

fluxbox

fluxbox is a window manager for X11 based on Blackbox 0.61.0.


bsetbg

bsetbg is a utility that sets the background image. It needs display, Esetroot, wmsetbg, xv, qiv or xsri to be used.


bsetroot

bsetroot is a Blackbox utility to change root window appearance.


Metacity-2.4.55

Introduction to Metacity

The Metacity package contains a window manager. This is useful for organizing and displaying windows.


Package information


Metacity dependencies


Installation of Metacity

Install Metacity by running the following commands:

./configure --prefix=/usr --libexec=/usr/sbin --sysconfdir=/etc &&
make &&
make install

Configuring Metacity

Configuration Information

Be sure to backup your current .xinitrc before proceeding.

cat >> ~/.xinitrc << "EOF"
xterm &
exec metacity
EOF

Contents

The Metacity package contains metacity.


Description

metacity

metacity is a window manager used mainly by GNOME.


XFce-4.0.0

Introduction to XFce

The XFce package contains a lightweight desktop environment.


Package information


Installation of XFce

XFce now distributes as a TAR ball of base packages and module packages. These instructions will only cover the bare minimum to run the application. The remaining modules would all follow the same pattern which will soon become obvious.

Install XFce by running the following commands:

cd src &&
tar -xzvf libxfce4util-4.0.0 &&
cd libxfce4util-4.0.0 &&
./configure --prefix=/usr &&
make &&
make install &&
cd .. &&
tar -xzvf libxfcegui4-4.0.0 &&
cd libxfcegui4-4.0.0 &&
./configure --prefix=/usr &&
make &&
make install &&
cd .. &&
tar -xzvf libxfce4mcs-4.0.0 &&
cd libxfce4mcs-4.0.0 &&
./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install &&
cd .. &&
tar -xzvf xfce-mcs-manager-4.0.0 &&
cd xfce-mcs-manager-4.0.0 &&
./configure --prefix=/usr &&
make &&
make install &&
cd .. &&
tar -xzvf xfwm4-4.0.0 &&
cd xfwm4r-4.0.0 &&
./configure --prefix=/usr &&
make &&
make install &&
cd .. &&
tar -xzvf xfdesktop-4.0.0 &&
cd xfdesktop-4.0.0 &&
./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install &&
cd .. &&
tar -xzvf xfce4-panel-4.0.0 &&
cd xfce4-panel-4.0.0 &&
./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install &&
cd .. &&
tar -xzvf xfce-utils-4.0.0 &&
cd xfce-utils-4.0.0 &&
./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Modules not installed above are: dbh-1.0.15 (required for xffm), gtk-xfce-engine-2.1.6, xfce-mcs-plugins, xfce4-iconbox, xfce4-mixer, xfce4-systray, sxfce4-themes, xfce4-toys, xfce4-trigger-launcher, xffm, xffm-icons, xfprint, and xfwm4-themes.


Configuring XFce

Config files

~/.xinitrc


Configuration Information

Be sure to backup your current .xinitrc before proceeding.

cat >> ~/.xinitrc << "EOF">
xfce-mcs-manager
xfwm4 --daemon
xftaskbar4 &
xfdesktop &
exec xfce4-panel
EOF

Contents

The XFce package contains xfce-mcs-manager, xfce4-about, xfce-setting-show, xfce4-panel, xfdesktop, xfhelp4, xflock4, xfmountdev4, xfrun4, xfsamba4, xftaskbar4, xfterm4, xftrash4, xftree4, xfwm4 and libxfce4mcs, libxfce4util, and libxfcegui4 libraries.


Description

xfce-mce-manager

xfce-mce-manager is the settings manager for XFce.


xfce4-about

xfce4-about displays the about box.


xfce-setting-show

xfce_setting-show displays the settings for XFce.


xfce4-panel

xfce4-panel is the panel manager for XFce. It contains the launcher, clock, mail check, desktop switcher and separator programs.


xfdesktop

xfdesktop is the desktop manager for XFce.


xfhelp4

xfhelp4 is script that launches a HTML browser to display online documentation.


xflock4

xflock4 is a script used to lock the current screen during drag and drop actions.


xfmountdev4

xfmountdev4 mounts a device on the specified mount point and launches xftree4, then unmounts the device when xftree4 finishes.


xfrun4

xfrun4 is the program launcher for XFce.


xfsamba4

xfsamba4 is Samba front end for XFce.


xftaskbar4

xftaskbar4 is the taskbar manager for XFce.


xfterm4

xfterm4 is a small terminal wrapper to be used as a drag and drop action for the XFce front panel.


xftrash4

xftrash4 is a small script to be used as a drag and drop action for the XFce front panel.


xftree4

xftree4 is the file manager for XFce.


xfwm4

xfwm4 is a window manager for X11.

IX. KDE

Introduction to KDE

KDE is a comprehensive desktop environment that builds on XFree86 and QT to provide a window manager and many user tools, including a browser, word processor, spreadsheet, presentation package, games, and numerous other utilities. It provides extensive capabilities for customization.

We divide the KDE instructions into two parts. The first part, the core packages, are needed for the rest of KDE to work. The second part presents additional packages which provide functionality in various areas (multimedia, graphics etc).

As the instructions for compiling and installing KDE were developed, the options to configure were examined and the parameters presented are the most likely to compile correctly. In each of the packages, one other option to configure can be added: --enable-final. This option can speed up the build process, but requires a lot of memory. If you have less than 256MB of RAM, this option may cause swapping and significantly slow compilation.

KDE also has many internationalization packages in the form of: kde-i18n-xx-3.1.4.tar.bz2 where the xx is a two to five letter code for the country covered. We do not cover the installation of these packages here.

All the KDE packages are comprised of various components. The default is to install most of the components. If specific components are to be eliminated, the official way is to set the variable DO_NOT_COMPILE. This comes in handy when there are problems compiling a particular component.

DO_NOT_COMPILE="component1 component2" \
./configure --prefix=/opt/kde...

The core KDE packages also honor this variable, but omitting components from the core packages is not advisable since it may result in an incomplete KDE installation.


Chapter 29. KDE Core Packages

aRts-1.1.4

Introduction to aRts

The Analog Real-time Synthesizer (aRts) provides sound support for KDE. It provides necessary libraries for kdelibs.


Package information


aRts dependencies

Required

Qt-3.2.1


Installation of aRts

Before starting the build, ensure you have the QTDIR environment variable set:

export QTDIR=/opt/qt

Install aRts by running the following commands:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
     --disable-dependency-tracking &&
make &&
make install &&
ln -sfn /opt/kde-3.1.4 /opt/kde

Note: Another configure option is --enable-final. This option can speed up the build process, but requires a lot of memory. If you have less than 256MB of RAM, this option may cause swapping and significantly slow compilation.


Command explanations

--prefix=/opt/kde-3.1.4 : This option tells the process to install the package in /opt/kde-3.1.4. We put aRts here because this package is required before installing KDE.

--disable-debug : This option causes the system to be compiled without debugging code.

--disable-dependency-tracking : This option speeds up one time builds.

ln -sfn /opt/kde-3.1.4 /opt/kde : This command creates a link for access to KDE. If a newer version of KDE is released, the new system can be built by changing the --prefix location and then set up by changing the link as this command does.


Configuring aRts

Configuration Information

The library directory /opt/kde/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. The following command will add it if it is missing:

cat >> /etc/ld.so.conf << "EOF"
# Begin kde addition to /etc/ld.so.conf

/opt/kde/lib

# End kde addition
EOF
ldconfig

kdelibs-3.1.4

Introduction to kdelibs

This package includes libraries that are central to the development and execution of a KDE program, as well as internationalization files for these libraries, misc HTML documentation, theme modules and regression tests.


Package information


Installation of kdelibs

Install kdelibs with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
     --disable-dependency-tracking --with-alsa --enable-fast-malloc=full &&
make &&
make install

Command explanations

--prefix=/opt/kde-3.1.4 : This option tells the process to install the package in /opt/kde-3.1.4.

--disable-debug : This option causes the system to be compiled without debugging code.

--disable-dependency-tracking : This option speeds up one time builds.

--with-alsa : This option tells the build process to search for and use Alsa for sound support.

--enable-fast-malloc=full : This option tells KDE programs to use an internal memory allocation scheme optimized for KDE.


Contents

kdelibs provides numerous libraries needed by KDE programs.


kdebase-3.1.4

Introduction to kdebase

kdebase is the second mandatory package (besides kdelibs) for the K Desktop Environment. It provides various applications and infrastructure files and libraries.


Package information


Installation of kdebase

Check to see if /lib/libmisc.la exists. If not, run:

ln -sf /usr/lib/libmisc.la /lib/libmisc.la

Install kdebase with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
     --disable-dependency-tracking --disable-lametest --with-shadow &&
make &&
make install

Command explanations

--disable-lametest : Do not search for and use lame support. This package provides MP3 encoding. Omit this option if you installed lame.

--with-shadow : Use shadow password support.


Contents

Major programs in kdebase include kdesktop, kaddressbook, kappfinder, kcontrol, kdeprint, kdm, kfind, khelpcenter, khotkeys, kicker, klipper, kmenuedit, konqueror, konsole, kscreensaver and ktip


Description

kdesktop

kdesktop is the program that handles desktop icons, popup menus, and the screensaver system.


kaddressbook

kaddressbook is a simple addressbook.


kappfinder

kappfinderis an utility to add non-KDE applications to K-menu.


kcontrol

kcontrolis KDE Control Center.


kdeprint

kdeprint provides Print job administration.


kdm

kdm is the KDE Display manager (a replacement for xdm.


kfind

kfind is an utility to find files.


khelpcenter

khelpcenter is the KDE help tool.


khotkeys

khotkeys handles hot keys for KDE.


kicker

kicker is the KDE control panel.


klipper

klipper is a clipboard utility.


kmenuedit

kmenuedit is an utility to rearrange or add items to the K-menu.


konqueror

konqueror is a filesystem and Web browser.


konsole

konsole is a highly configurable X terminal emulator.


kscreensaver

kscreensaver is a program to set up screensavers.


ktip

ktip is a wizard to provide hints and KDE information.


Configuring the core KDE packages

First add /opt/kde/bin to your PATH environment variable:

export PATH=$PATH:/opt/kde/bin

Then create an .xinitrc file to start KDE:

echo "exec startkde" > ~/.xinitrc

and ensure all libraries can be found with:

ldconfig

At this point you can bring up KDE with:

startx

Chapter 30. KDE Additional Packages

kdemultimedia-3.1.4

Introduction to kdemultimedia

Package information


kdemultimedia dependencies

Required

kdebase-3.1.4


Installation of kdemultimedia

Install kdemultimedia with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking --with-arts-alsa &&
  sed -i -e 's/strings -ansi/strings/' kaudiocreator/Makefile &&
  sed -i -e 's/strings -ansi/strings/' kioslave/audiocd/Makefile &&
  sed -i -e 's/-ansi//' kscd/libwm/Makefile &&
make &&
make install

Command explanations

--with-arts-alsa : Use the ALSA support built into aRts.

sed -i -e 's/strings -ansi/strings/' kaudiocreator/Makefile : Remove -ansi from gcc parameters to work around a broken header in the kernel. The broken file is asm/byteorder.h, where a parameter is used, but not defined, when -ansi is specified.

sed -i -e 's/strings -ansi/strings/' kioslave/audiocd/Makefile : Remove -ansi from gcc parameters to work around a broken header in the kernel.

sed -i -e 's/-ansi//' kscd/libwm/Makefile : Remove -ansi from gcc parameters to work around a broken header in the kernel.


Configuring kdemultimedia

There is no explicit configuration for the kde multimedia package, however Kscd needs to find the CD drive. The default is /dev/cdrom which may not exist on your system. The easiest way to do this is to create a symbolic link to this from your CD drive (e.g. /dev/hdc, /dev/scd0, etc):
cd /dev &&
ln -s "CD Drive" /dev/cdrom


Contents

The KDE Multimedia package provides kaboodle, noatun, timidity, kmidi, kmix, kscd and aktion.


Description

kaboodle

kaboodle is a multimedia player.


noatun

noatun is another multimedia player.


timidity

timidity is a midi player.


kmidi

kmidi is a front end for timidity.


kmix

kmix is a sound mixer.


kscd

kscd is a CD player.


aktion

aktion is a video player.


kdenetwork-3.1.4

Introduction to kdenetwork

Package information


kdenetwork dependencies

Required

kdebase-3.1.4


Installation of kdenetwork

Install kdenetwork with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Configuring kdenetwork

There is no explicit configuration for the kde network package, however individual packages need to be set up with user information.


Contents

The KDE Network package provides kmail, knewsticker, knode, kppp, ksirc, kit and korn.


Description

kmail

kmail is a mail client.


knewsticker

knewsticker is a news applet for the KDE Application Launcher Panel.


knode

knode is a news reader.


kppp

kppp is a dial-up utility.


ksirc

ksirc is a chat client.


kit

kit is an AOL messaging client (AIM).


korn

korn is a mail notification utility.


kdegraphics-3.1.4

Introduction to kdegraphics

Package information


kdegraphics dependencies


Installation of kdegraphics

Install kdegraphics with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Graphics package provides kcoloredit, kdvi, kfax, kfract, kghostview, kiconedit, kooka, kpaint, kruler, ksnapshot, kuickshow and kview.


Description

kcoloredit

kcoloredit is a color pallette editor.


kdvi

kdvi is a DVI viewer.


kfax

kfax is a FAX viewer.


kfract

kfract is a fractal generator.


kghostview

kghostview is a PS/PDF viewer.


kiconedit

kiconedit is an icon editor.


kooka

kooka is a raster image scan program.


kpaint

kpaint is a paint program.


kruler

kruler is a screen ruler.


ksnapshot

ksnapshot is a screen capture program.


kuickshow

kuickshow is an image viewer.


kview

kview is another image viewer.


kdepim-3.1.4

Introduction to kdepim

Package information


kdepim dependencies

Required

kdebase-3.1.4


Optional

pilot-link


Installation of kdepim

Install kdepim with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE PIM package provides kalarm, kandy, karm, knotes, korganizer, kpilot and libical.


Description

kalarm

kalarm is a system to provide reminder messages.


kandy

kandyis a program to synchronize mobile phone numbers.


karm

karm is a personal time tracker.


knotes

knotes is a popup notes utility.


korganizer

korganizer is a personal calendar/todo system.


kpilot

kpilot is a program to synchronize a Palm-Pilot.


libical

libical is a calendar library.


kdeadmin-3.1.4

Introduction to kdeadmin

Package information


kdeadmin dependencies

Required

kdebase-3.1.4


Optional

RPM and Linux-PAM-0.77


Installation of kdeadmin

Install kdeadmin with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking --with-shadow &&
make &&
make install

Command explanations

--with-shadow : This option allows use of shadow passwords.


Contents

The KDE Admin package provides kpackage, kcron, kuser, kwuftpd and ksysv.


Description

kpackage

kpackage is a package manager.


kcron

kcron is a task scheduler.


kuser

kuser is a graphical user manager.


kwuftpd

kwuftpd is a FTPD editor.


ksysv

ksysv is a Sys V-Init editor.


kdegames-3.1.4

Introduction to kdegames

kdegames is a compilation of various games.


Package information


kdegames dependencies

Required

kdebase-3.1.4


Installation of kdegames

Install kdegames with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Games package provides kasteroids, kbounce, kfouleggs, ksirtet, ksmiletris, ksnakerace, kspaceduel, ktron, kbackgammon, kbattleship, kblakbox, kmahjongg, kreversi, kwin4, kenolaba, shisensho, kpoker, lieutnant, patience, katomic, kjumpingcube, kmines, ksokoban, kolorlines, konquest and samegame.


kdeutils-3.1.4

Introduction to kdeutils

Package information


kdeutils dependencies

Required

kdebase-3.1.4


Installation of kdeutils

Install kdeutils with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Utils package provides kcalc, charselectapplet, arc, kdepasswd, kdf, kedit, kfloppy, khexeditor, kjots, kljtool, klpq and ktimer.


Description

kcalc

kcalc is a scientific calculator.


charselectapplet

charselectapplet is a character selector applet.


arc

arc is an archiving tool.


kdepasswd

kdepasswd is a password managing utility.


kdf

kdf is a disk usage viewer.


kedit

kedit is a text editor.


kfloppy

kfloppy is a floppy formatter.


khexeditor

khexeditor is a binary editor.


kjots

kjots is a note taker.


kljtool

kljtool is a HP Laserjet control panel.


klpq

klpq displays print job queues.


ktimer

ktimer is a task scheduler.


kdeedu-3.1.4

Introduction to kdeedu

Package information


kdeedu dependencies

Required

kdebase-3.1.4


Installation of kdeedu

Install kdeedu with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Edu package provides keduca, kgeo, klettres, kstars, ktouch and kvoctrain.


Description

keduca

keduca - tests and exams.


kgeo

kgeo is an interactive geometry tutorial.


klettres

klettres is an alphabet tutor (French).


kstars

kstars is a desktop planetarium.


ktouch

ktouch is a touch typing tutor.


kvoctrain

kvoctrain is a vocabulary trainer.


kdeartwork-3.1.4

Introduction to kdeartwork

kdeartwork contains additional themes, screensaver, sounds, wallpapers and widget styles for KDE.


Package information


kdeartwork dependencies

Required

kdebase-3.1.4


Installation of kdeartwork

Install kdeartwork with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Artwork package provides kscreensaver.


Description

kscreensaver

kscreensaver is the KDE screensaver.


kdetoys-3.1.4

Introduction to kdetoys

Package information


kdetoys dependencies

Required

kdebase-3.1.4


Installation of kdetoys

Install kdetoys with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Toys package provides amor, kaphorism, kmoon, kodo, kteatime and ktux.


Description

amor

amor - Amusing Misuse of Resources.


kaphorism

kaphorism - aphorisms.


kmoon

kmoon is a Moon phase indicator.


kodo

kodo measures your desktop mileage.


kteatime

kteatime times your tea brewing.


ktux

ktux - small Tux crossing stars.


kdeaddons-3.1.4

Introduction to kdeaddons

kdeaddons contains additional plugins and scripts for some KDE applications.


Package information


kdeaddons dependencies


Installation of kdeaddons

Install kdeaddons with:

./configure --prefix=/opt/kde-3.1.4 --disable-debug \
    --disable-dependency-tracking &&
make &&
make install

Contents

The KDE Addons package provides konqueror and noatun plugins, kicker applets and newskicker scripts.

X. GNOME

Introduction to GNOME

This chapter attempts to install a complete GNOME-2.2 desktop environment and a limited GNOME 1.4 library environment that is sufficient to run GNOME 1.4 applications included in this book. The order of the pages are meant to follow the build order defined by the GNOME development team as published in the release notes, with two exceptions. If a package is in the release notes build list, but not in this chapter, it has been installed elsewhere in the book.

The installation of GNOME-2.2 is a large undertaking and one we would like to see you complete with the least amount of stress. One of our first goals in this installation is to protect your previously installed software, especially if you are testing GNOME on your machine. GNOME-2.2 packages utilize the --prefix= option for configure, so we will use that and an Environment variable (GNOME_PREFIX) to add flexibility to the install.

If you know that you want GNOME as your desktop, it is recommended that you install with --prefix=/usr. If you are not sure that you are going to keep GNOME on your installation, it is recommended that you install with --prefix=/opt/gnome-2.2. Setting the Environment variable and the additional edits required by the second option are covered on the pre-installation page.

If you choose the second option, removal of GNOME-2.2 is as easy as removing the edits from the pre-installation page and issuing the following command:

rm /opt/gnome-2.2 -r 

If your system was completely built per LFS and BLFS instructions, you have a very good chance of using GNOME-2.2 after your first install. If you are a typical LFS user, you have made modifications to the instructions along the way knowing that you have to take those modifications into account on future installations. You should have no problems integrating GNOME-2.2 into your unique setup, but you will have 28 to 33 packages installed before you can run GNOME through any testing (assuming your window manager is preinstalled and tested). We would anticipate that you will be rebuilding GNOME at least once to make adjustments for your setup.

If you are building a GNOME 1.4 desktop environment, you would install only those libraries in the GNOME 1.4 chapter and any dependencies listed on those pages, whether labeled or not. GNOME packages without pages are simply installed with:
./configure --prefix=/opt/gnome &&
make &&
make install
These instructions are simplistic to facilitate removal of GNOME 1.4 from BLFS systems when it is no longer necessary. These instructions may be refined later to comply with BLFS standards for file locations, specifically /opt/gnome/etc to /etc and /opt/gnome/var to /var. You should consider using the GNOME 1.4 hint located at http://hints.linuxfromscratch.org/hints if you have no interest in GNOME-2.2.

GNOME-2.2 dependencies

Required

XFree86-4.3.0.1, GTK+-2.2.4, libpng-1.2.5, libjpeg-6b, libtiff-3.5.7 and popt-1.7

Optional

libxml2-2.5.11, libxslt-1.0.33, DocBook XML DTD-4.2, DocBook XSL Stylesheets-1.62.4 and FAM-2.6.10


Chapter 31. GNOME Libraries

Pre-installation configuration

Set an Environment variable to resolve the prefix destination.

If GNOME is your desktop of choice:

export GNOME_PREFIX=/usr

If you want to try-out GNOME:

export GNOME_PREFIX=/opt/gnome-2.2

The try-out group will also need to make all the following configuration changes:

Add to your system or personal profile:

export PATH=$PATH:/opt/gnome-2.2/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/gnome-2.2/lib/pkgconfig
export GNOME_LIBCONFIG_PATH=/usr/lib

Add to your /etc/ld.so.conf:

cat >> /etc/ld.so.conf << "EOF"
# Begin gnome addition to /etc/ld.so.conf

/opt/gnome-2.2/lib

# End gnome addition
EOF

Add to your /etc/man.conf:

cat >> /etc/man.conf << "EOF"
# Begin gnome addition to man.conf

MANPATH /opt/gnome-2.2/man

# End gnome addition to man.conf
EOF

GTK-Doc-1.0

Introduction to GTK-Doc

The GTK-Doc package contains a code documentor. This is useful for extracting specially formatted comments from the code to create API documentation. This package is optional, if it is not installed, packages will not build the documentation. This does not mean that you will not have any documentation, if GTK-Doc is not available, the install process will copy pre-built documentation to your system.


Package information


Installation of GTK-Doc

Install GTK-Doc by running the following commands:

./configure --prefix=/usr &&
make install

Contents

The GTK-Doc package contains gtkdoc-fixxref, gtkdoc-mkdb, gtkdoc-mkhtml, gtkdoc-mkman, gtkdoc-mktmpl, gtkdoc-scan, gtkdoc-scangobj and gtkdoc-scanobj.


Description

These are all Perl scripts used by Makefile scripts to generate documentation for the package.


linc-1.0.3

Introduction to linc

The linc package contains a library that eases the task of writing networked servers and clients. This is used by ORBit to handle message transmissions and receptions.


Package information


linc dependencies


Installation of linc

Install linc by running the following commands:

./configure --prefix=$GNOME_PREFIX --with-openssl --disable-gtk-doc &&
make &&
make install

Command explanations

--with-openssl: This switch compiles linc with OpenSSL support.

--disable-gtk-doc: This switch will prevent the rebuilding of the API documentation during the make command.


Contents

The linc package contains liblinc libraries.


Description

liblinc libraries

liblinc libraries provide the functions to take care of connection initiation and maintenance, and the details of various transports (IPv4, Unix domain sockets, IPv6 and IrDA).


libIDL-0.8.2

Introduction to libIDL

The libIDL package contains libraries for Interface Definition Language files. This is a specification for defining portable interfaces.


Package information


libIDL dependencies

Required

GLib-2.2.3


Installation of libIDL

Install libIDL by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The libIDL package contains libIDL libraries.


Description

libIDL libraries

libIDL libraries provide the functions to create and maintain trees of CORBA Interface Definition Language (IDL) files.


ORBit2-2.6.2

Introduction to ORBit2

The ORBit2 package contains a high-performance CORBA Object Request Broker. This allows programs to send requests and receive replies from other programs.


Package information


ORBit2 dependencies


Installation of ORBit2

Install ORBit2 by running the following commands:

ldconfig &&
./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The ORBit2 package contains libORBit-2 and libORBitCosNaming-2 libraries.


Description

libORBit-2

libORBit-2 is the CORBA API.


libORBitCosNaming

No description available.


intltool-0.26

Introduction to intltool

The intltool package contains an internationalization tool. This is useful for extracting translatable strings from source files, collecting the extracted strings with messages from traditional source files (<source directory>/<package>/po) and merging the translations into XML, .desktop and OAF files.


Package information


Installation of intltool

Install intltool by running the following commands:

./configure --prefix=/usr --mandir=/usr/share/man &&
make &&
make install

Contents

The intltool package contains intltoolize, intltool-update, intltool-extract, intltool-merge, intltool-prepare and intltool-unicodify.


Description

intltoolize

intltoolize prepares a package to use intltool.


intltool-update

intltool-update updates the po template files and merges them with the translations.


intltool-extract

intltool-extract generates header files that can be read by gettext.


intltool-merge

intltool-merge merges translated strings into various file types.


intltool-prepare

intltool-prepare updates pot files and merges them with translation files.


intltool-unicodify

intltool-unicodify is the i18n Unicode encoding utility.


Bonobo Activation-2.2.2

Introduction to Bonobo Activation

The Bonobo Activation package contains libbonobo-activation libraries. This is the new Object Activation Framework (OAF) for GNOME.


Package information


Bonobo Activation dependencies

Required

ORBit2-2.6.2


Installation of Bonobo Activation

Install Bonobo Activation by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--sysconfdir=/etc/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--disable-gtk-doc: This switch will prevent the rebuilding of documentation during the make command.


Contents

The Bonobo Activation package contains libbonobo-activation libraries.


Description

libbonobo-activation

No description available.


libbonobo-2.2.3

Introduction to libbonobo

The libbonobo package contains libbonobo libraries. This is a component and compound document system for GNOME.


Package information


libbonobo dependencies


Installation of libbonobo

Install libbonobo by running the following commands:

./configure --prefix=$GNOME_PREFIX --disable-gtk-doc  &&
make &&
make install 

Contents

The libbonobo package contains libbonobo libraries.


Description

libbonobo libraries

libbonobo libraries are a set of language and system independent CORBA interfaces for creating reusable components and compound documents.


GConf-2.2.1

Introduction to GConf

The GConf package contains a configuration database system.


Package information


GConf dependencies


Installation of GConf

Install GConf by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--sysconfdir=/etc/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc. This installation controls all future installations of schemas, changes in location, including eliminating this command must be consistent.

--disable-gtk-doc: This switch will prevent the rebuilding of documentation during the make command.


Contents

The GConf package contains libgconf libraries.


Description

libgconf libraries

libgconf libraries provide the functions necessary to maintain the configuration database.


GNOME MIME Data-2.2.1

Introduction to GNOME MIME Data

The GNOME MIME Data package contains the base set of file types and applications for GNOME.


Package information


Installation of GNOME MIME Data

Install GNOME MIME Data by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME MIME Data package contains $GNOME_PREFIX/share/icons, $GNOME_PREFIX/share/application-registry and $GNOME_PREFIX/share/mime-info.


Description

icons

icons contains all the default document type icons.


application-registry

application-registry contains the application mime database.


mime-info

mime-info contains the mime description database.


GNOME Virtual File System-2.2.5

Introduction to GNOME Virtual File System

The GNOME Virtual File System package contains virtual file system libraries. This is used as one of the foundations of the Nautilus file manager.


Package information


Installation of GNOME Virtual File System

Install GNOME Virtual File System by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--disable-gtk-doc: This switch will prevent the rebuilding of documentation during the make command.


Contents

The GNOME Virtual File System package contains libgnomevfs libraries.


Description

libgnomevfs libraries

No description available.


libgnome-2.2.3

Introduction to libgnome

The libgnome package contains the libgnome library.


Package information


Installation of libgnome

Install libgnome by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--sysconfdir=/etc/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--disable-gtk-doc: This switch prevents the rebuilding of documentation during the make command.


Contents

The libgnome package contains libgnome libraries.


Description

libgnome libraries

libgnome libraries are the non-GUI portion of the GNOME libraries.


libart_lgpl-2.3.11

Introduction to libart_lgpl

The libart_lgpl package contains the libart libraries. This is useful for high-performance 2D graphics.


Package information


Installation of libart_lgpl

Install libart_lgpl by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libart_lgpl package contains libart_lgpl libraries.


Description

libart_lgpl libraries

libart_lgpl library is used as the anti-aliased render engine for libgnomecanvas.


libglade-2.0.1

Introduction to libglade

The libglade package contains libglade libraries. This is useful for loading Glade interface files in a program at runtime.


Package information


libglade dependencies


Optional

Python-2.3.2 if compiled utilizing expat-1.95.6, GTK-Doc-1.0 and DocBook SGML DTD-3.1


Installation of libglade

Install libglade by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Command explanations

--enable-gtk-doc: This switch can be added to rebuild the HTML documentation.


Contents

The libglade package contains libglade libraries.


Description

libglade libraries

libglade libraries contain the functions necessary to load Glade interface files.


libgnomecanvas-2.2.1

Introduction to libgnomecanvas

The libgnomecanvas package contains libgnomecanvas libraries.


Package information


libgnomecanvas dependencies


Installation of libgnomecanvas

Install libgnomecanvas by running the following commands:

./configure --prefix=$GNOME_PREFIX --disable-gtk-doc &&
make &&
make install

Command explanations

--disable-gtk-doc: This switch will prevent the rebuilding of the API documentation during the make command.


Contents

The libgnomecanvas package contains libgnomecanvas libraries.


Description

libgnomecanvas libraries

No description available.


libbonoboui-2.2.2

Introduction to libbonoboui

The libbonoboui package contains libbonoboui libraries.


Package information


Installation of libbonoboui

Install libbonoboui by running the following commands:

./configure --prefix=$GNOME_PREFIX --disable-gtk-doc &&
make &&
make install

Contents

The libbonoboui package contains libbonoboui libraries.


Description

libbonoboui libraries

libbonoboui libraries are the GUI portion of the Bonobo libraries.


GNOME Icon Theme-1.0.6

Introduction to GNOME Icon Theme

The GNOME Icon Theme package contains an assortment of scalable and non-scalable icons of different sizes and themes.


Package information


Installation of GNOME Icon Theme

Install GNOME Icon Theme by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The GNOME Icon Theme package contains icons.


libgnomeui-2.2.2

Introduction to libgnomeui

The libgnomeui package contains libgnomeui libraries.


Package information


Installation of libgnomeui

Install libgnomeui by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--disable-gtk-doc: This switch prevents rebuilding the documentation during the make command.


Contents

The libgnomeui package contains libgnomeui libraries.


Description

libgnomeui libraries

libgnomeui libraries is the GUI portion of the GNOME libraries.


libwnck-2.2.2

Introduction to libwnck

The libwnck package contains a Window Navigator Construction Kit.


Package information


libwnck dependencies


Installation of libwnck

Install libwnck by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The libwnck package contains libwnck libraries.


Description

libwnck libraries

libwnck libraries contain functions for writing pagers and task lists.


GTK Engines-2.2.0

Introduction to GTK Engines

The GTK Engines package contains three themes for GTK2.


Package information


GTK Engines dependencies

Required

GTK+-2.2.4


Installation of GTK Engines

Install GTK Engines by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The GTK Engines package contains engines libraries and theme files.


Description

engines libraries

engines libraries are manager systems for specific themes.


theme files

Theme files included are Pixmap, Metal and Redmond95.


GTK ThinIce Engine-2.0.2

Introduction to GTK ThinIce Engine

The GTK ThinIce Engine package contains theme sets.


Package information


GTK ThinIce Engine dependencies

Required

GTK+-2.2.4


Installation of GTK ThinIce Engine

Install GTK ThinIce Engine by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The GTK ThinIce Engine package contains themes.


GNOME Themes-2.2.2

Introduction to GNOME Themes

The GNOME Themes package contains several more theme sets.


Package information


GNOME Themes dependencies


Installation of GNOME Themes

Install GNOME Themes by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The GNOME Themes package contains themes.


ScrollKeeper-0.3.12

Introduction to ScrollKeeper

The ScrollKeeper package contains a cataloging system for documentation. This is useful for managing documentation metadata and providing an API to help browsers find, sort and search the document catalog.


Package information


ScrollKeeper dependencies


Installation of ScrollKeeper

Install ScrollKeeper by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc \
--localstatedir=/var --disable-static \
--with-omfdirs=/usr/share/omf:/opt/gnome/share/omf:\
/opt/kde/share/omf:/opt/gnome-2.2/share/omf &&
make &&
make install

Command explanations

--sysconfdir=/etc: This switch puts the configuration files in /etc/scrollkeeper.

--localstatedir=/var: This switch puts ScrollKeeper's database directory in /var/lib/scrollkeeper.

--disable-static: This switch prevents the static library from being built.

--omfdirs=/usr/share/omf:/opt/gnome/share/omf:/opt/kde/share/omf:/opt/gnome-2.2/share/omf: This switch sets all the locations for OMF files for scrollkeeper.


Contents

The ScrollKeeper package contains libscrollkeeper libraries and utility scripts.


Description

scrollkeeper libraries

libscrollkeeper libraries provide the API necessary for help browsers to interact with documentation written to utilize ScrollKeeper.


utility scripts

utility scripts for performing installation, building, getting and updating of table of contents files.


VTE-0.10.29

Introduction to VTE

The VTE package contains a termcap file implementation for terminal emulators.


Package information


VTE dependencies


Installation of VTE

Install VTE by running the following commands:

./configure --prefix=/usr --libexecdir=/usr/sbin --disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=/usr/sbin: This switch puts libexec files in /usr/sbin instead of /usr/libexec.

--disable-gtk-doc: This switch prevents the building of documentation as the directories are currently empty and will cause errors in the make command if this switch is missing.


Contents

The VTE package contains libvte libraries, vte and gnome-pty-helper


Description

vte libraries

libvte libraries provide the functions necessary to implement a "termcap file" for terminal emulators.


vte

vte is a test application for the vte libraries.


gnome-pty-helper

No description available.


libgtop-2.0.2

Introduction to libgtop

The libgtop package contains the GNOME top libraries.


Package information


libgtop dependencies

Required

GLib-2.2.3


Installation of libgtop

Install libgtop by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The libgtop package contains libgtop libraries.


Description

libgtop libraries

libgtop libraries contain the functions that allow access to System performance data.


GAIL-1.2.2

Introduction to GAIL

The GAIL package contains the GNOME Accessibility Implementation Libraries.


Package information


GAIL dependencies


Installation of GAIL

Install GAIL by running the following commands:

./configure --prefix=$GNOME_PREFIX --disable-gtk-doc &&
make &&
make install

Contents

The GAIL package contains libgailutil libraries.


Description

libgailutil libraries

libgailutil libraries provide the functions that solve accessibility problems in a consistent manner across GNOME.


AT SPI-1.1.9

Introduction to AT SPI

The AT SPI package contains Assistive Technology Service Provider Interface. This is useful for redirecting UI events to accessible applications and adaptive/assistive technologies.


Package information


AT SPI dependencies


Installation of AT SPI

Install AT SPI by running the following commands:

patch -Np1 -i ../at-spi-1.1.9-lspi.patch &&
./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--disable-gtk-doc: This switch prevent the rebuilding of the documentation during the make command.


Contents

The AT SPI package contains libcspi libraries, libspi libraries and at-spi-registryd


Description

libcspi libraries

No description available.


libspi libraries

No description available.


at-spi-registryd

at-spi-registryd is the registry daemon that allows communication between the UI and assistance devices.


libgail-gnome-1.0.2

Introduction to libgail-gnome

The libgail-gnome package contains a binder between GAIL and GNOME.


Package information


libgail-gnome dependencies


Installation of libgail-gnome

Install libgail-gnome by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The libgail-gnome package contains libgail-gnome libraries.


Description

libgail-gnome libraries

No description available.


librsvg-2.2.5

Introduction to librsvg

The librsvg package contains librsvg libraries.


Package information


librsvg dependencies


Optional

libgsf-1.8.2


Installation of librsvg

Install librsvg by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome --disable-gtk-doc &&
make &&
make install

Contents

The librsvg package contains librsvg libraries.


Description

librsvg libraries

librsvg libraries provide the functions to render Scalable Vector Graphics (SVG).


EEL-2.2.4

Introduction to EEL

The EEL package contains the Eazel Extensions Library. This is a collection of widgets and extensions to the GNOME platform.


Package information


EEL dependencies


Installation of EEL

Install EEL by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The EEL package contains libeel libraries.


Description

libeel libraries

libeel libraries are a collection of widgets developed by the Nautilus project.


libgtkhtml-2.2.4

Introduction to libgtkhtml

The libgtkhtml package contains libgtkhtml libraries.


Package information


libgtkhtml dependencies


Installation of libgtkhtml

Install libgtkhtml by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The libgtkhtml package contains libgtkhtml libraries.


Description

libgtkhtml libraries

libgtkhtml libraries provide the functions necessary to render and/or edit HTML.


libgsf-1.8.2

Introduction to libgsf

The libgsf package contains libgsf libraries. This is useful for providing an extensible input/output abstraction layer for structured file formats.


Package information


Installation of libgsf

Install libgsf by running the following commands:

./configure --prefix=$GNOME_PREFIX --disable-gtk-doc &&
make &&
make install 

Command explanations

--disable-gtk-doc: This switch will prevent the rebuilding of the API documentation during the make command.


Contents

The libgsf package contains libgsf and libgsf-gnome libraries.


GAL-1.99.9

Introduction to GAL

The GAL package contains library functions that came from Evolution. GAL is short for GNOME Application Libs.


Package information


Installation of GAL

Install GAL by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The GAL package contains library routines refactored from Evolution and Gnumeric.


libgnomeprint-2.2.1.3

Introduction to libgnomeprint

The libgnomeprint package contains libgnomeprint libraries.


Package information


libgnomeprint dependencies


Installation of libgnomeprint

Install libgnomeprint by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--enable-gtk-doc: This switch rebuilds the documentation during the make command.


Contents

The libgnomeprint package contains libgnomeprint libraries.


Description

libgnomeprint libraries

libgnomeprint libraries implement the GNOME Printing Architecture.


libgnomeprintui-2.2.1.3

Introduction to libgnomeprintui

The libgnomeprintui package contains the libgnomeprintui libraries.


Package information


libgnomeprintui dependencies


Installation of libgnomeprintui

Install libgnomeprintui by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Command explanations

--enable-gtk-doc: This switch rebuilds the documentation during the make command.


Contents

The libgnomeprintui package contains libgnomeprintui libraries.


Description

libgnomeprintui libraries

libgnomeprintui libraries are the GUI portion of the implementation of the GNOME Printing Architecture.


GtkHTML-3.0.8

Introduction to GtkHTML

The GtkHTML package contains a lightweight HTML rendering/printing/editing engine. This is an evolution specific application at this time.


Package information


GtkHTML dependencies


Installation of GtkHTML

Install GtkHTML by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The GtkHTML package contains libgtkhtml libraries.


Description

libgtkhtml libraries

libgtkhtml libraries provide the functions to render HTML within applications.


Chapter 32. GNOME core

This section contains required elements of the GNOME environment to display a functional desktop.


GNOME Desktop-2.2.2

Introduction to GNOME Desktop

The GNOME Desktop package contains GNOME's .desktop files, the gnome-about program, man pages and GNOME's core graphics files and icons.


Package information


GNOME Desktop dependencies


Installation of GNOME Desktop

Install GNOME Desktop by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME Desktop package contains libgnome-desktop-2 libraries and gnome-about.


Description

libgnome-desktop libraries

libgnome-desktop libraries contain API's being tested for inclusion in libgnome or libgnomeui.


gnome-about

gnome-about produces the about screen.


GNOME Panel-2.2.2.2

Introduction to GNOME Panel

The GNOME Panel package contains the menu and applet systems.


Package information


GNOME Panel dependencies


Installation of GNOME Panel

Install GNOME Panel by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--localstatedir=/var/lib --sysconfdir=/etc/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--disable-gtk-doc: This switch prevents the rebuilding of documentation during the make command.


Contents

The GNOME Panel package contains libpanel-applet-2 libraries and applets.


Description

libpanel-applet libraries

libpanel-applet libraries allow development of small applications which may be embedded in the panel called applets.


Applets

Applets included are Workspace Switcher, Window List, Inbox Monitor, Clock and 'Wanda the Fish'.


GNOME Session-2.2.2

Introduction to GNOME Session

The GNOME Session package contains the GNOME session manager.


Package information


GNOME Session dependencies


Installation of GNOME Session

Install GNOME Session by running the following commands:

export PATH=$PATH:$GNOME_PREFIX/sbin:/sbin &&
./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome  &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME Session package contains gnome-session, session utilities and manager proxy.


Description

gnome-session

gnome-session starts up the GNOME desktop.


session utilities

session utilities includes a configuration program and other session management related utilities.


manager proxy

manager proxy handles basic session management for applications that do not support XSM.


Control Center-2.2.2

Introduction to Control Center

The Control Center package contains the GNOME settings managers.


Package information


Control Center dependencies


Installation of Control Center

Install Control Center by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts scrollkeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The Control Center package contains gnome-control-center, gnome-settings-daemon, gnome-background-properties, gnome-default-applications-properties, gnome-file-types-properties, gnome-font-properties, gnome-keybinding-properties, gnome-keyboard-properties, gnome-mouse-properties, gnome-network-preferences, gnome-sound-properties, gnome-theme-properties and gnome-ui-properties.


Description

gnome-control-center

No description available.


gnome-settings-daemon

No description available.


Chapter 33. Additional GNOME Packages

These packages are modular and add desktop applications to the GNOME environment. Feel free to install them on an as needed or as wanted basis.


GNOME Terminal-2.2.2

Introduction to GNOME Terminal

The GNOME Terminal package contains the console. This is useful for executing programs from a command prompt.


Package information


GNOME Terminal dependencies


Installation of GNOME Terminal

Install GNOME Terminal by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME Terminal package contains gnome-terminal.


Description

gnome-terminal

gnome-terminal provides the command prompt in the GNOME environment.


GNOME System Monitor-2.0.5

Introduction to GNOME System Monitor

The GNOME System Monitor package contains procman, GNOME's replacement to gtop.


Package information


GNOME System Monitor dependencies


Installation of GNOME System Monitor

Install GNOME System Monitor by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome &&
make &&
make install

Note: make install will need path access to $GNOME_PREFIX/bin. If your preinstallation changes were made only to the user account, you will need to adjust your path prior to running make install.


Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME System Monitor package contains gnome-system-monitor.


Description

gnome-system-monitor

gnome-system-monitor displays the process tree and hardware meters.


GNOME Applets-2.2.2

Introduction to GNOME Applets

The GNOME Applets package contains small applications which generally run in the background and display their output to the gnome panel.


Package information


GNOME Applets dependencies


Installation of GNOME Applets

Install GNOME Applets by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--localstatedir=/var/lib --sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME Applets package contains battstat, cdplayer, charpick, drivemount, geyes, gkb, gtik2, gweather, mini-commander, mixer, modemlights and multiload applets.


Description

applets

These are small programs designed to run inside the Panel display.


GNOME Utilities-2.2.3

Introduction to GNOME Utilities

The GNOME Utilities package contains a collection of small applications designed to make your life a little easier.


Package information


GNOME Utilities dependencies


Installation of GNOME Utilities

Install GNOME Utilities by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--localstatedir=/var/lib --sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--with-pam-prefix=/etc/pam.d: This switch puts PAM files in /etc/pam.d instead of /etc/gnome.


Contents

The GNOME Utilities package contains gnome-system-log, gnome-character-map, gnome-calculator, gnome-search-tool, gnome-dictionary, archive-generator, gfloppy and gdialog.


Description

gnome-system-log

gnome-system-log allows you to monitor and view system log files.


gnome-character-map

gnome-character-map allows you to select characters from a table and insert them into your applications.


gnome-calculator

gnome-calculator is a simple mathematical and scientific calculator that includes arithmetic, trigonometric and logarithmic functions.


gnome-search-tool

gnome-search-tool allows you to search for files on your system using simple and advanced search options.


gnome-dictionary

gnome-dictionary allows you to look up definitions and spelling of words.


archive-generator

archive-generator creates archives from collections of files and directories using gzip compressed archive files.


gfloppy

gfloppy formats floppy disks under Linux.


gdialog

gdialog displays dialog boxes from shell scripts.


GNOME Games-2.2.1

Introduction to GNOME Games

The GNOME Games package contains games.


Package information


GNOME Games dependencies


Optional

Guile-1.6.4


Installation of GNOME Games

Install GNOME Games by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The GNOME Games package contains aisleriot, freecell, gataxx, glines, gnect, gnibbles, gnobots2, gnome-stones, gnome-xbill, gnometris, gnomine, gnotravex, gnotski, gtali, iagno, mahjongg and same-gnome.


Nautilus-2.2.4

Introduction to Nautilus

The Nautilus package contains the GNOME shell and file manager.


Package information


Nautilus dependencies


Optional

medusa


Installation of Nautilus

Install Nautilus by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome \
--libexecdir=$GNOME_PREFIX/sbin && 
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.


Contents

The Nautilus package contains nautilus and libnautilus libraries.


Description

nautilus

nautilus is the GNOME file manager.


nautilus libraries

libnautilus libraries supply the functions needed by the file manager.


Yelp-2.2.3

Introduction to Yelp

The Yelp package contains the help browser. This is useful for viewing help files.


Package information


Yelp dependencies


Installation of Yelp

Install Yelp by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.


Contents

The Yelp package contains yelp.


Description

yelp

yelp is the GNOME help browser.


bug-buddy-2.2.106

Introduction to bug-buddy

The bug-buddy package contains a graphical bug reporting tool. This can extract debugging information from a core file or crashed application.


Package information


bug-buddy dependencies


Installation of bug-buddy

Install bug-buddy by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.


Contents

The bug-buddy package contains bug-buddy.


Description

bug-buddy

bug-buddy is a graphical bug reporting system.


gedit-2.2.2

Introduction to gedit

The gedit package contains a lightweight UTF-8 text editor for the GNOME desktop.


Package information


gedit dependencies


Installation of gedit

Install gedit by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The gedit package contains gedit.


Description

gedit

gedit is a lightweight text editor.


EOG-2.2.2

Introduction to EOG

The EOG package contains Eyes of GNOME. This is useful for viewing and cataloging image files.


Package information


EOG dependencies


Installation of EOG

Install EOG by running the following commands:

./configure --prefix=$GNOME_PREFIX --libexecdir=$GNOME_PREFIX/sbin \
--localstatedir=/var/lib --sysconfdir=/etc/gnome &&
make &&
make install

Command explanations

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.


Contents

The EOG package contains eog.


Description

eog

eog is a fast and functional image viewer as well as an image cataloging program.


GStreamer-0.6.2

Introduction to GStreamer

The GStreamer package contains a framework for streaming media. This is useful for interfacing with binary CODECs.


Package information


GStreamer dependencies


Installation of GStreamer

Install GStreamer by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib  &&
make &&
make install &&
gst-register 

Command explanations

--localstatedir=/var/lib: This switch puts gst-register's cache in /var/lib/cache instead of $GNOME_PREFIX/var/cache.


Contents

The GStreamer package contains libgstreamer libraries and libgst libraries.


gst-plugins-0.6.2

Introduction to gst-plugins

The gst-plugins package contains CODEC interfaces.


Package information


Installation of gst-plugins

Install gst-plugins by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install &&
gst-register

Contents

The gst-plugins package contains libgst* libraries.


GNOME Media-2.2.2

Introduction to GNOME Media

The GNOME Media package contains GNOME's media applications.


Package information


GNOME Media dependencies


Installation of GNOME Media

Install GNOME Media by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome \
--localstatedir=/var/lib --libexecdir=$GNOME_PREFIX/sbin &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--libexecdir=$GNOME_PREFIX/sbin: This command puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.


Contents

The GNOME Media package contains gnome-sound-recorder, gnome-cd, gnome-volume-control and vumeter.


Description

gnome-sound-recorder

gnome-sound-recorder is GNOME's recorder.


gnome-cd

gnome-cd is GNOME's CD Player.


gnome-volume-control

gnome-volume-control is GNOME's mixer with volume applet.


vumeter

vumeter is a visual volume meter.


Nautilus Media-0.2.2

Introduction to Nautilus Media

The Nautilus Media package contains GNOME's media applications used by nautilus.


Package information


Nautilus Media dependencies


Installation of Nautilus Media

Install Nautilus Media by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome \
--localstatedir=/var/lib --libexecdir=$GNOME_PREFIX/sbin &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--libexecdir=/opt/gnome2/sbin: This command puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.


Contents

The Nautilus Media package contains nautilus-audio-view and support libraries.


Description

nautilus-audio-view

nautilus-audio-view displays the directory as audio tracks.


GNOME2 User Docs-2.0.6

Introduction to GNOME2 User Docs

The GNOME2 User Docs package contains end user documents for GNOME.


Package information


GNOME2 User Docs dependencies


Installation of GNOME2 User Docs

Install GNOME2 User Docs by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.


Contents

The GNOME2 User Docs package contains OMF files.


Description

OMF files

OMF files contain user documentation. These include introductions and help on the core packages.


Chapter 34. Other GNOME Packages

This section will contain other GNOME packages.


GConf Editor-0.4.1

Introduction to GConf Editor

The GConf Editor package contains a GUI editor for the GConf configuration database.


Package information


GConf Editor dependencies

Required

GConf-2.2.1


Installation of GConf Editor

Install GConf Editor by running the following commands:

./configure --prefix=$GNOME_PREFIX &&
make &&
make install

Contents

The GConf Editor package contains gconf-editor.


Description

gconf-editor

gconf-editor allows direct modification of the GConf configuration database.


GDM-2.4.1.4

Introduction to GDM

The GDM package contains GNOME's Display Manager daemon. This is useful for allowing configurable graphical logins.


Package information


GDM dependencies


Installation of GDM

Install GDM by running the following commands:

groupadd gdm &&
useradd -c gdm -d /dev/null -g gdm -s /bin/bash gdm &&
./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome \
--localstatedir=/var/lib --with-pam-prefix=/etc &&
make &&
make install

Command explanations

--sysconfdir=/etc/gnome: This command puts configuration files in /etc/gnome instead of /opt/gnome2/etc.

--localstatedir=/var/lib: This command puts files in /var/lib instead of /opt/gnome2/var.

--with-pam-prefix=/etc: This command puts PAM configuration files in /etc/pam.d instead of /etc/gnome.


Configuring GDM

Config files

/opt/gnome2/gdm.conf, /opt/gnome2/gnomerc


Configuration Information

The GDM PAM config files contain modules not present in a BLFS installation. The following commands will replace those files:

cat > /etc/pam.d/gdm << "EOF"
auth        required    pam_unix.so
auth        required    pam_nologin.so
account     required    pam_unix.so
password    required    pam_unix.so
session     required    pam_unix.so
EOF
cat > /etc/pam.d/gdm-autologin << "EOF"
auth        required    pam_env.so
auth        required    pam_nologin.so
auth        required    pam_permit.so
account     required    pam_unix.so
password    required    pam_unix.so
session     required    pam_unix.so
EOF

gdm can be tested by executing it from a root console.

To automate the running of gdm, use the following command to create the init.d script if your GNOME_PREFIX=/opt/gnome-2.2. The fully qualified paths can be removed for GNOME_PREFIX=/usr:

cat > /etc/rc.d/init.d/gdm << "EOF"
#!/bin/bash
# Begin $rc_base/init.d/gdm

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting GDM..."
                loadproc /opt/gnome-2.2/bin/gdm
                ;;

        stop)
                echo "Stopping GDM..."
		if [ -f /var/run/gdm.pid ]; then
                loadproc /opt/gnome-2.2/sbin/gdm-stop
		fi
                ;;

        reload)
                echo "Reloading GDM..."
                reloadproc /opt/gnome-2.2/sbin/gdm-safe-restart
                ;;

        restart)
                echo "Restarting GDM..."
		loadproc /opt/gnome-2.2/sbin/gdm-restart
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart}"
                exit 1
                ;;
esac

# End $rc_base/init.d/gdm
EOF
chmod 755 /etc/rc.d/init.d/gdm

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/gdm ../rc0.d/K05gdm &&
ln -sf ../init.d/gdm ../rc1.d/K05gdm &&
ln -sf ../init.d/gdm ../rc2.d/K05gdm &&
ln -sf ../init.d/gdm ../rc3.d/K05gdm &&
ln -sf ../init.d/gdm ../rc4.d/K05gdm &&
ln -sf ../init.d/gdm ../rc5.d/S95gdm &&
ln -sf ../init.d/gdm ../rc6.d/K05gdm

To autostart with a graphical login, edit /etc/inittab so that the line reading

id:3:initdefault:

is changed to

id:5:initdefault:

Contents

The GDM package contains gdm, gdm-binary, gdmXnestchooser, gdmchooser, gdmflexiserver, gdmgreeter, gdmlogin, gdmmktemp, gdmphotosetup, gdmsetup, gdmthemetester, gdm-restart, gdm-safe-restart, gdm-stop, gdmaskpass, gdmconfig and gdmopen.


Description

gdm

gdm is a wrapper script to execute the GDM binary, the configurable GNOME based login prompt.


gdmchooser

gdmchooser is an application for selecting XDMCP enabled hosts on the local network.


gdmsetup

gdmsetup is a graphical interface to edit the gdm.conf.


gdm-restart and gdm-safe-restart

gdm-restart sends the HUP signal and gdm-safe-restart sends the USR1 signal to the daemon so that it restarts. They are used after the config file is edited.


gdmconfig

gdmconfig is an application for managing the configuration of the entire GDM applications suite. It handles look and feel, security, XDMCP, GDMchooser and more.


Chapter 35. Configuring GNOME

This chapter makes GNOME your Desktop of choice when startx is run.


Configuring the core GNOME packages

Create an .xinitrc file to start GNOME:
echo "exec gnome-session" >>
~/.xinitrc
and ensure all libraries can be found with:
ldconfig

At this point you can bring up GNOME with startx.


Chapter 36. GNOME 1.4 Libraries

This section contains additional GNOME 1.4 libraries, needed by some applications that have not yet been ported to GNOME 2.x. None of these libraries are needed for a GNOME desktop install.


Pre-installation configuration

Add to your system or personal profile:

export PATH=$PATH:/opt/gnome/bin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/gnome/lib/pkgconfig
export GNOME_LIBCONFIG_PATH=/usr/lib

Add to your /etc/ld.so.conf:

cat >> /etc/ld.so.conf << "EOF"
# Begin gnome addition to /etc/ld.so.conf

/opt/gnome/lib

# End gnome addition
EOF

Add to your /etc/man.conf:

cat >> /etc/man.conf << "EOF"
# Begin gnome addition to man.conf

MANPATH /opt/gnome/man

# END gnome addition to man.conf
EOF

ORBit-0.5.17

Introduction to ORBit

The ORBit package contains a high-performance CORBA Object Request Broker. This allows programs to send requests and receive replies from other programs.


Package information


ORBit dependencies

Required

popt-1.7 and GLib-1.2.10


Installation of ORBit

Install ORBit by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Contents

The ORBit package contains libIDL, libIIOP, libORBit, libORBitCosNaming and libORBitutil libraries.


Description

libIDL

libIDL library is the Interface Definition Language mappings for CORBA.


libIIOP

libIIOP library is for low level CORBA communications.


libORBit

libORBit library is the CORBA API.


libORBitCosNaming

No description available.


libORBitutil

libORBitutil library contain the convenience routines for ORBit.


OAF-0.6.10

Introduction to OAF

The OAF package contains the Object Activation Framework for GNOME.


Package information


OAF dependencies


Optional

GTK-Doc-1.0


Installation of OAF

Install OAF by running the following commands:

ldconfig &&
./configure --prefix=/opt/gnome --disable-gtk-doc &&
make &&
make install

Contents

The OAF package contains liboaf libraries.


Description

liboaf libraries

No description available.


GNOME Libraries-1.4.2

Introduction to GNOME Libraries

The GNOME Libraries package contains the GNOME libraries. This is useful as a foundation for the GNOME Desktop and applications.


Package information


Installation of GNOME Libraries

Install GNOME Libraries by running the following commands:

./configure --prefix=/opt/gnome --disable-gtk-doc &&
make &&
make install

Configuring GNOME Libraries

Config files

/opt/gnome/etc/mime-magic, /opt/gnome/etc/paper.config, /opt/gnome/etc/sound/events/gnome.soundlist and /opt/gnome/etc/sound/events/gtk-events.soundlist


Contents

The GNOME Libraries package contains libgnome, libgnomeui, libgnomesupport, libart_lgpl, libgtk-xmhtml, libgnorbagtk and libzvt libraries.


Description

libgnome

libgnome library is the non-GUI part of the GNOME library.


libgnomeui

libgnomeui is the GUI part of the GNOME library.


libgnomesupport

No description available.


libart_lgpl

libart_lgpl library is the LGPL'd component of libart.


libgtk-xmhtml

No description available.


libgnorbagtk

libgnorbagtk is the GNOME CORBA GTK framework.


libzvt

libzvt library provides the functions necessary to emulate xterm.


GDK Pixel Buffer-0.22.0

Introduction to GDK Pixel Buffer

The GDK Pixel Buffer package is the GTK+ pixel buffer library


Package information


GDK Pixel Buffer dependencies


Installation of GDK Pixel Buffer

The make command attempts to open an X display during the compile, so an X server must be running during this process.

Install GDK Pixel Buffer by running the following commands:

./configure --prefix=/opt/gnome --disable-gtk-doc &&
make &&
make install

Contents

The GDK Pixel Buffer package contains libgdk_pixbuf libraries.


Description

libgdk_pixbuf libraries

libdgk_pixbuf libraries contain the GTK+ pixel buffer libraries for the GIMP Toolkit.


GNOME Print-0.37

Introduction to GNOME Print

The GNOME Print package contains the GNOME Printing Architecture, for GNOME 1.4.


Package information


GNOME Print dependencies


Installation of GNOME Print

The configure script does not correctly interpret that libxml-1.8.17 is newer than libxml-1.8.8. This can be solved by building xmlConf.sh with this command:

cat > /opt/gnome/lib/xmlConf.sh << EOF
XML_LIBDIR="-L/usr/lib"
XML_LIBS="-lxml"
XML_INCLUDEDIR="-I/usr/include/gnome-xml"
MODULE_VERSION=xml-1.8.17
EOF

Install GNOME Print by running the following commands:

./configure --prefix=/opt/gnome --with-zlib=/usr &&
make &&
make install

Command explanations

--with-zlib=/usr: Configure GNOME Print to usr the system installed zlib.


Contents

The GNOME Print package contains the GNOME 1.4 printing libraries.


Bonobo-1.0.22

Introduction to Bonobo

The Bonobo package contains a set of language and system independent CORBA interfaces for creating reusable components, controls and creating compound documents.


Package information


Bonobo dependencies


Installation of Bonobo

Install Bonobo by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install Bonobo in the GNOME 1.4 area.


Contents

The Bonobo package contains GNOME 1.4 compound document and component libraries.


GConf-1.0.9

Introduction to GConf

The GConf package contains a configuration database system.


Package information


Installation of GConf

Install GConf by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Contents

The GConf package contains libgconf libraries.


Description

libgconf libraries

libgconf libraries provide the functions necessary to maintain the configuration database.


GNOME Virtual File System-1.0.5

Introduction to GNOME Virtual File System

The GNOME Virtual File System package contains file system libraries.


Package information


GNOME Virtual File System dependencies


Installation of GNOME Virtual File System

Install GNOME Virtual File System by running the following commands:

./configure --prefix=/opt/gnome --disable-gtk-doc &&
make &&
make install

Configuring GNOME Virtual File System

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The GNOME Virtual File System package contains libgnomevfs libraries.


Description

libgnomevfs libraries

No description available.


libglade-0.17

Introduction to libglade

The libglade package contains libraries which allow applications to load Glade interface files at runtime.


Package information


libglade dependencies


Optional

GNOME Libraries-1.4.2 and Python-2.3.2 if compiled utilizing expat-1.95.6


Installation of libglade

The make command attempts to open an X display during the compile, so an X server must be running during this process.

Install libglade by running the following commands:

./configure  --prefix=/opt/gnome --enable-bonobo \
 --disable-gtk-doc &&
make &&
make install

Command explanations

--enable-bonobo: Enable Bonobo support.


Contents

The libglade package contains Glade interface file loading libraries.


GAL-0.24

Introduction to GAL

The GAL package contains library functions that came from Gnumeric and Evolution . GAL is short for GNOME Application Libs.


Package information


Installation of GAL

Install GAL by running the following commands:

./configure --prefix=/opt/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install GAL in the GNOME 1.4 area.


Contents

The GAL package contains library routines refactored from Evolution and Gnumeric .


Guppi-0.40.3

Introduction to Guppi

The Guppi package contains a Guile scriptable plot program with integrated statistics capabilities.


Package information


Guppi dependencies


Installation of Guppi

Install Guppi by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install Guppi in the GNOME 1.4 area.


Contents

The Guppi package contains plotting libraries and plugins for GNOME 1.4.


libcapplet-1.5.11

Introduction to libcapplet

The libcapplet package contains a control panel applet library.


Package information


libcapplet dependencies


Installation of libcapplet

Install libcapplet by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install libcapplet in the GNOME 1.4 area.


Contents

The libcapplet package contains a control panel applet library.


Soup-0.7.11

Introduction to Soup

The Soup package contains a SOAP (Simple Object Access Protocol) implementation in C.


Package information


Installation of Soup

Install Soup by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install Soup in the GNOME 1.4 area.

--enable-apache=no: This command can be added to prevent building against Apache.


Contents

The Soup package contains SOAP libraries, used to implement XML remote procedure calls.


GtkHTML-1.1.7

Introduction to GtkHTML

The GtkHTML package contains a lightweight HTML rendering/printing/editing engine.


Package information


GtkHTML dependencies


Optional

Soup-0.7.11


Installation of GtkHTML

Install GtkHTML by running the following commands:

./configure --prefix=/opt/gnome --disable-gtk-doc &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install GTK HTML in the GNOME 1.4 area.


Contents

The GtkHTML package contains the GNOME 1.4 HTML rendering engine.


libghttp-1.0.9

Introduction to libghttp

The libghttp package contains a GNOME 1.4 HTTP client library.


Package information


Installation of libghttp

Install libghttp by running the following commands:

./configure --prefix=/opt/gnome &&
make &&
make install

Command explanations

--prefix=/opt/gnome: Install libghttp in the GNOME 1.4 area.


Contents

The libghttp package contains a GNOME 1.4 HTTP client library.


Chapter 37. Individual Office Programs

This chapter is a collection of independant projects that can be installed based on specific needs. Together, they create a respectible office suite. While they may be lacking in user interface consistency, they excel in doing one thing and doing it well.


AbiWord-2.0.0

Introduction to AbiWord

The AbiWord package contains a word processing application. This is useful for writing reports, letters and other formatted documents.


Package information


AbiWord dependencies


Installation of AbiWord

Install AbiWord by running the following commands:

cd abi &&
./configure --prefix=/usr &&
make &&
make install

Contents

The AbiWord package contains AbiWord.


Description

AbiWord

AbiWord or abiword are wrapper scripts for the AbiWord executable.


Gnumeric-1.2.0

Introduction to Gnumeric

The Gnumeric package contains a spreadsheet program. This is useful for financial analysis.


Package information


Gnumeric dependencies


Optional

gda


Installation of Gnumeric

Install Gnumeric by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib \
--sysconfdir=/etc/gnome --libexecdir=$GNOME_PREFIX/sbin &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--libexecdir=$GNOME_PREFIX/sbin: This switch puts libexec files in $GNOME_PREFIX/sbin instead of $GNOME_PREFIX/libexec.


Contents

The Gnumeric package contains gnumeric.


Description

gnumeric

gnumeric is GNOME's spreadsheet application.


GnuCash-1.8.7

Introduction to GnuCash

GnuCash is a personal finance manager.


Package information


Installation of GnuCash

Install GnuCash by running the following commands:

./configure --prefix=/opt/gnome &&
    make &&
    make install

Command explanations

--prefix=/opt/gnome: Version 1.8.7 of GnuCash is a GNOME 1.4 application.


Configuring GnuCash

Configuration Information

Note: GnuCash must be run as root once before use. Simply executing gnucash from an X terminal and clicking on the cancel button is sufficient. This must be done prior to setting up accounts as an unprivileged user, due to the fact that GnuCash must create scheme catalogs for itself before it is used.


Contents

The GnuCash package contains gnucash.


Description

gnucash

gnucash is a personal finance manager.


GIMP-1.2.5

Introduction to GIMP

The GIMP package contains the GNU Image Manipulation Program. This is useful for photo retouching, image composition and image authoring.


Package information


GIMP dependencies

Required

GTK+-1.2.10


Optional

libtiff-3.5.7, libpng-1.2.5, libjpeg-6b, gimp-print, AAlib-1.4rc5, mpeg_lib-1.3.1, Python-2.3.2 and Perl modules:Gtk-Perl-0.7008, PDL-2.4.0 and Parse-RecDescent-1.94


Installation of GIMP

Install GIMP by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc --disable-print &&
make &&
make install

Configuring GIMP

Config files

~/.gimp-1.2


Configuration Information

GIMP executes a configuration wizard for each users upon their initial invocation of the program.


Contents

The GIMP package contains gimp, escputil, gimp-config and gimp-remote.


Description

gimp

gimp is an image manipulation program. It works with a variety of image formats and provides a large selection of tools.


escputil

escputil is a utility to perform maintenance tasks on an Epson Stylus inkjet printer.


gimp-config

gimp-config is used by other programs that want to link to GIMP libraries.


gimp-remote

gimp-remote is a small utility that tells a running GIMP to open a local or remote image file.


Evolution-1.4.4

Introduction to Evolution

The Evolution package contains an integrated mail, calendar and address book suite.


Package information


Installation of Evolution

Note: Evolution requires Berkeley DB-3.1.17. The details on "why" are in the README file distibuted with the Evolution source code. Evolution links to the library statically, hence this book installs the Berkeley DB-3.1.17 in /opt, which can be removed once Evolution is installed.

Install Berkeley DB-3.1.17 by running the following commands:

cd build_unix &&
../dist/configure --prefix=/opt/db-3.1.17 --enable-compat185
&&
make &&
make install

Install Evolution by running the following commands:

./configure --prefix=$GNOME_PREFIX --with-db3=/opt/db-3.1.17 --enable-openssl &&
make &&
make install

Optionally, you may remove Berkeley DB-3.1.17 installed above with this command:

rm -rf /opt/db-3.1.17

Command explanations

--enable-compat185: Build support for older database files.

--prefix=/opt/db-3.1.17: This version of the Berkeley Database should not be installed in /usr, as it is only needed for the building of Evolution.

--with-db3=/opt/db-3.1.17: Specify the location where db-3.1.17 is installed.

--enable-openssl: This flag will compile SSL support into Evolution.

--enable-openldap: This flag will compile LDAP support into Evolution.


Contents

The Evolution package contains evolution.


Description

evolution

evolution contains an email, calendar and address book suite.


Chapter 38. Office Suites

This chapter contains applications that bundle all the essential needs of everyday office workers into one neat 'little' package. The benefits are a consistent user interface and cooperation between applications.


KOffice-1.2.1

Introduction to KOffice

KOffice is the integrated office suite for KDE.


Package information


KOffice dependencies


Additional downloads

KOffice also has many internationalization packages in the form of:
koffice-i18n-xx-1.2.1.tar.bz2
where the xx is a two to five letter code for the country covered. The sizes of these files range from about 289 KB to 408 KB.


Installation of KOffice

Install KOffice with the following commands:

./configure --prefix=/opt/kde-3.1.4
--disable-debug &&
make &&
make install

Contents

The KOffice package provides kword, kspread, kpresenter, kivio, kontour, krita, kugar, kplato, kchart and kformula.


kword

kword is a framemaker-like word processing and desktop publishing program.


kspread

kspread is a scriptable spreadsheet program.


kpresenter

kpresenter is a presentation builder/display program.


kivio

kivio is a flowchart program.


kontour

kontour is a vector drawing program.


krita

krita is a painting and image editing program.


kugar

kugar is a tool for creating reports.


kplato

kplato is a project management application (in early stages of development).


kchart

kchart is a chart drawing application.


kformula

kformula is a formula editor.


OpenOffice-1.1.0

Introduction to OpenOffice

The OpenOffice is a office suite, the Open Source sibling of StarOffice.


Package information


Additional downloads


Installation of OpenOffice

Apply the downloaded patches and copy gpc files.

mv ../gpc231/* external/gpc &&
rm -rf ../gpc231 &&
for p in ../openoffice-1.1.0-*.patch
do patch -Np1 -i $p
done

If you want to optimize the build, edit solenv/inc/unxlngi4.mk and add the desired optimization flags to CFLAGSOPT variable. Some users have reported problems with -fomit-frame-pointer. The best option is to not use any custom optimizations. The following command removes an incorrect -mcpu option in the above file.

cd solenv/inc &&
cp unxlngi4.mk unxlngi4.mk.orig &&
sed -e "s:\-mcpu=pentiumpro::" \
unxlngi4.mk.orig > unxlngi4.mk &&
cd ../..

Configure openoffice using the following commands. You may build install sets for only specific languages based on your preferences. If a particular component is not available in the language of your choice, the default will be English. The following option compiles all available languages.

cd config_office/ &&
./configure --with-lang=ALL &&
cd ..

Compile OpenOffice using the following commands.

./bootstrap &&
bash -c "source LinuxIntelEnv.Set.sh; dmake"

If you have downloaded localized help content zip files, you will need to unzip them to the appropriate directory as mentioned below and then recreate the installation set.

cd solver/645/unxlngi4.pro/pck &&
for i in $(ls ../../../../../helpcontent_*_unix.tgz)
do
tar -xvzf $i
done &&
cd ../../../../instsetoo &&
rm -rf unxlngi4.pro &&
cd .. &&
bash -c "source LinuxIntelEnv.Set.sh ; dmake"

Install OpenOffice using the following commands. The following commands install the English language set. To install a localized version, replace the 01 by the international telephone country code for your country. Note that when installing, it needs a X Display, even though there is no visible X window. You can use Xvfb if you are compiling on a console.

cd instsetoo/unxlngi4.pro/01/normal &&
cp install install.orig &&
sed -e "s:^oo_home=.*:oo_home=openoffice:" install.orig > install &&
./install --prefix=/opt &&
for appl in swriter scalc sdraw simpress smath soffice
do ln -sf /opt/openoffice/program/$appl /usr/bin/$appl
done

Command explanations

mv ../gpc231/gpc.* external/gpc: Copy the gpc files to the appropriate location.

--with-lang=ALL: Make install sets for all available languages.

./bootstrap: Create packages required to bootstrap the build.

dmake: Compile the package.

sed -e "s:^oo_home=...: Remove version specific installation directory

for appl in swriter scalc sdraw simpress smath soffice; do ...: Create links so that the package can be started from the command-line without changes to the existing path.


Contents

The OpenOffice package contains swriter, simpress, scalc, sdraw and smath.


Description

swriter

Word processing application.


simpress

Presentation application.


scalc

Spreadsheet application.


sdraw

Drawing application.


smath

Mathematical formula editor.


Chapter 39. Graphical Web Browsers

This chapter contains a wonderful selection of browsers. We hope you can find one you enjoy using or give them each a trial run.


Mozilla-1.4

Introduction to Mozilla

Mozilla is a browser suite, the Open Source sibling of Netscape. It includes the browser, composer, mail client and an IRC client. A calendar component is also being built but it is not yet integrated into the stable Mozilla releases.

In this section we also mention the building of Mozilla Firebird, (a stand-alone browser based on the Mozilla source code) and Mozilla Thunderbird, (a stand-alone mail client based on the Mozilla source code). Since the build instructions for Mozilla Firebird and Mozilla Thunderbird are similar to Mozilla, only the changes required with respect to the Mozilla instructions are mentioned.


Package information


Installation of Mozilla

Install Mozilla by running the following commands:

export MOZILLA_OFFICIAL="1" &&
export BUILD_OFFICIAL="1" &&

for p in ../mozilla-1.4-*.patch
do patch -Np1 -i $p
done

According to the financial institutions, the following hack makes your browser insecure. You have been warned. Many sites use an MS-IE specific tag (autocomplete=off) to prevent autocomplete from working in some forms. This tag is now supported in Mozilla to appease the financial institutions. As per the requirements of the financial institutions, they will not even accept a solution where this a preference option. However our opinion is that it should be in the hands of the user. To enable autocomplete to bypass this restriction, we need to make a slight modification in the code.

Open the file extensions/wallet/src/wallet.cpp in the Mozilla source tree and search for the line:
#define WALLET_DONT_CACHE_ALL_PASSWORDS
Then delete or comment out the line. Now, if anyone tells you MS-IE is user friendly, give them this example!

./configure --prefix=/usr \
            --enable-default-mozilla-five-home \
            --enable-toolkit-gtk2 --enable-default-toolkit=gtk2 \
            --with-x --with-system-zlib \
            --with-system-jpeg --with-system-png --with-system-mng \
            --enable-xft --enable-crypto \
            --enable-java-supplement \
            --disable-accessibility \
            --disable-tests --disable-debug \
            --disable-logging --enable-reorder \
            --enable-strip \
            --enable-cpp-rtti --enable-extensions=all &&
make &&
make install &&
install -d /usr/include/mozilla-1.4/nss &&
cp -Lf dist/private/nss/*.h dist/public/nss/*.h \
   /usr/include/mozilla-1.4/nss &&

ln -nsf mozilla-1.4 /usr/include/mozilla &&
ln -nsf mozilla-1.4 /usr/lib/mozilla &&
cd /usr/lib/mozilla-1.4 &&
export LD_LIBRARY_PATH="/usr/lib/mozilla-1.4" &&
export MOZILLA_FIVE_HOME="/usr/lib/mozilla-1.4" &&
./regxpcom &&
./regchrome &&
touch `find /usr/lib/mozilla-1.4 -name *.rdf`

Optional Extra Switches

Each of these switches can be added to the configure line in order to have the described effect on the Mozilla compile.

--enable-elf-dynstr-gc: Removes un-referenced strings from ELF shared objects generated during the build. Note that this option breaks build on alpha.

--disable-mailnews: Disable the mail and news clients.

--disable-ldap: Disable LDAP Support, recommended if mail is disabled.

--enable-calendar: Build the calendar client. You will need to download the calendar source via CVS since it is not included with the release source. (Warning, this option is not yet stable).

--enable-xterm-updates: This option is for enabling the xterm title with the current command when compiling.

--enable-plaintext-editor-only: Disable support for HTML editing. Do not use this switch if you are building the mail-news component.


Additional build notes for Mozilla Firebird 0.6.1

Add the following env variable (The variable is named Phoenix since that was the original name for the Mozilla Firebird project):

export MOZILLA_PHOENIX="1"

Make sure that the following switches are passed to ./configure: --disable-calendar and --disable-mailnews.

We recommend installing in a separate prefix such as --prefix=/opt/firebird-0.6.1 to prevent clashes with an installed Mozilla.

The Mozilla Firebird executable is MozillaFirebird.


Additional build notes for Mozilla Thunderbird 0.2

Add the following env variable:

export MOZ_THUNDERBIRD="1"

Make sure that the following switches is passed to ./configure: --disable-calendar.

We recommend installing in a separate prefix such as --prefix=/opt/thunderbird-0.2 to prevent clashes with an installed Mozilla.

The Mozilla Thunderbird executable is thunderbird.


Command explanations

export MOZILLA_OFFICIAL="1" &&
export BUILD_OFFICIAL="1"
Set some variables that affect what and how it is built. The first two exports specify that we are building a distribution. The last export specifies that we are ok with the LGPL versioned libart.

--prefix=/usr: Previously mozilla did not support the make install option. Hence the package was installed in /opt. The package now supports "make install" and follows the FHS guidelines for installation. Hence the book now recommends installation in a system wide prefix such as /usr .

--enable-toolkit-gtk2
Use gtk2 toolkit

--with-system-zlib --with-system-jpeg \
--with-system-png --with-system-mng
Use the system versions for these packages.

--enable-xft: Enable the Xft support. You need fontconfig or the latest XFree86 version to enable xft.

--enable-crypto: Enable the Personal Security Manager to enable SSL connections.

--disable-jsd --disable-accessibility \
--disable-tests --disable-debug \
--disable-dtd-debug \
--disable-logging --enable-reorder \
--enable-strip \
--enable-cpp-rtti
Various options that affect what components are built and some optimization options. You can pick and choose from these options. More information on them can be found in the Mozilla configure script help. Not all options are used in the instructions given above.

--enable-extensions=...: Enables extensions. If you want, you can disable all extensions other than the browser by changing this switch to --enable-extensions="default,-venkman,-inspector,-irc".

install -d /usr/include/mozilla-1.4/nss
cp -Lf dist/private/nss/*.h dist/public/nss/*.h \
   /usr/include/mozilla-1.4/nss
Copy the nss headers that are not copied by make install.

ln -nsf mozilla-1.4 ...: Mozilla installs headers and libraries in version specific directories. This link makes symbolic links so that applications that depend on Mozilla (such as OpenOffice , Galeon, etc.) don't need to know which version of Mozilla is installed.

export LD_LIBRARY_PATH="/usr/lib/mozilla-1.4" &&
export MOZILLA_FIVE_HOME="/usr/lib/mozilla-1.4" &&
./regxpcom &&
./regchrome &&
touch `find /usr/lib/mozilla-${VERSION} -name *.rdf`
Create the required component registries to enable multi-user installs.


Configuring Mozilla

No specific configuration is required as long as the mozilla binary is in the path for the user. If Mozilla is installed in a non-standard location, then make a sym-link to the mozilla binary from /usr/bin. Same thing applies for Mozilla Firebird and Mozilla Thunderbird.

Many applications look for netscape when they need to open a browser. You may make the following symlink for convenience.

ln -sf mozilla /usr/bin/netscape

For installing various Mozilla plugins, refer to Mozdev's PluginDoc Project


Contents

The Mozilla package contains mozilla .The various components such as composer, mail-news can be accessed from the menu after mozilla starts or via command-line switches to the mozilla binary.


Galeon-1.3.7

Introduction to Galeon

The Galeon package contains a GNOME browser that utilizes the Mozilla gecko rendering engine and presents the simplest interface possible for a browser.


Package information


Galeon dependencies


Installation of Galeon

Compiling must be done with the same compiler version and the same optimization settings that were used on Mozilla.

Install Galeon by running the following commands:

./configure --prefix=$GNOME_PREFIX --sysconfdir=/etc/gnome \
--localstatedir=/var/lib &&
make &&
make install

Contents

The Galeon package contains galeon and galeon-config-tool.


Description

galeon

galeon sets LD_LIBRARY_PATH and MOZILLA_FIVE_HOME before executing galeon-bin.


galeon-config-tool

galeon-config-tool clears settings, installs schemas, removes schemas and fixes permissions in the GConf database.


Konqueror-3.1.4

Konqueror is the default graphical web browser for the KDE desktop environment. It is packaged and installed with kdebase-3.1.4.


Dillo-0.7.3

Introduction to Dillo

Dillo is a fast, small footprint graphical browser. Although version 0.7.3 is alpha code, it is stable. Dillo does not support java or javascript, and the current version does not support FTP, HTTPS or frames. It is, however, very fast and so is useful on older, slower machines. It supports downloads and can support cookies.


Package information


Dillo dependencies

Required

GTK+-1.2.10


Installation of Dillo

Install Dillo by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Configuring Dillo

Config files

System configuration can be done using /etc/dillorc. This can be edited to define proxies and the default home page.


Configuration Information

Dillo stores its configuration in by user in their ~/.dillo directory. These files are created automatically when dillo is run. By default Dillo has cookies turned off, to turn cookies on, edit the file ~/.dillo/cookiesrc. The ~/.dillo/bookmarks.html file is created and added to by Dillo. It can also be edited with any HTML or text editor.


Contents

The Dillo package contains dillo.


Description

dillo

dillo is a GTK+ graphical WWW browser with limited facilities, but a small footprint and runs fast on slower machines.


Chapter 40. Other X-based Internet Programs

The Internet isn't just about browsing. Here are more graphical applications that utilize other areas of the Internet.


Pan-0.14.2

Introduction to Pan

The Pan package contains a graphical newsreader. This is useful for reading and writing news, threading articles and replying via email.


Package information


Pan dependencies


Installation of Pan

Install Pan by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Pan package contains pan.


Description

pan

pan is the graphical newsreader.


Balsa-2.0.14

Introduction to Balsa

The Balsa package contains a GNOME 2 based mail reader.


Package information


Installation of Balsa

Install Balsa by running the following commands:

./configure --prefix=$GNOME_PREFIX --localstatedir=/var/lib --with-ssl \
--sysconfdir=/etc/gnome --with-ldap --with-gpgme &&
make &&
make install

Command explanations

--localstatedir=/var/lib: This switch puts ScrollKeeper files in /var/lib/scrollkeeper instead of $GNOME_PREFIX/var/scrollkeeper.

--with-ssl: Change the default of no ssl support.

--sysconfdir=/etc/gnome: This switch puts configuration files in /etc/gnome instead of $GNOME_PREFIX/etc.

--with-ldap: Change the default to support LDAP if it is available.

--with-gpgme: Change the default to support GPG if 'GnuPG made easy' (GPGME) is installed.


Configuring Balsa

Configuration Information

All configuration of Balsa is done through the Balsa menu system, with mailbox configuration done with the Settings->Preferences menu.


Contents

The Balsa package contains balsa.


Description

balsa

balsa is the GNOME 2 based mail reader.


Chapter 41. Multimedia Libraries and Drivers

Many multimedia programs require libraries and/or drivers in order to function properly. The packages in this section fall into this category. Generally you only need to install these if you are installing a program which has the library listed as either a requirement, or as an option to enable it to support certain functionality.


ALSA-0.9.6

The first question which people tend to ask about ALSA is why they should use it over the sound drivers included in the kernel - there are several reasons. First, the ALSA drivers support more sound cards than those in the kernel. Second, the OSS emulation is in some cases faster and better than the original OSS driver itself. And finally, there are some programs which can use ALSA's enhanced features to better drive the soundcard.

ALSA is also likely to be the future of Linux Sound (hence the name Advanced Linux Sound Architecture), and the ALSA drivers will probably be included into the main linux kernel at some point during the 2.5 development series, leading eventually to ALSA being the "standard" sound drivers into the future 2.6 stable kernel.

The following five sections of the book deal with the five separate components of ALSA: the drivers, the libraries, the utilities, the tools and the OSS compatibility libraries.


ALSA Driver-0.9.6

Introduction to ALSA Driver

The ALSA Driver package contains the ALSA sound drivers. These are the next generation of sound drivers for Linux.


Package information


Installation of ALSA Driver

Before installing the ALSA drivers note that in your kernel configuration you should have Sound Card Support (CONFIG_SOUND) enabled but nothing else in the Sound menu (with the possible exception of TV Card Mixer support. In particular you should not have OSS Sound Modules enabled as this will cause problems when loading the ALSA driver modules.

Note: Because ALSA drivers are kernel modules, they must be compiled with the same compiler the kernel has used.

Install ALSA Driver using the following commands as a template:

CC=/opt/gcc-2.95.3/bin/gcc ./configure \
   --with-moddir=/lib/modules/`uname -r`/kernel/drivers/sound \
   --with-kernel=/lib/modules/`uname -r`/build \
   --with-sequencer=yes \
   --with-oss=yes \
   --with-isapnp=no \
   --with-cards=all &&
make &&
make install

If this is the first time you have installed the ALSA drivers, you will need to create the /dev entries using the script provided in the ALSA Driver source tree:

./snddevices

Command explanations

--with-sequencer=yes: This tells the ALSA Driver package to build the sequencer modules for whichever soundcards for which you are building. Most people want them so you will usually want to leave it set to yes.

--with-oss=yes: This tells the package to build the OSS/Free emulation modules. Again, most people want this so it's probably best to stick with yes.

--with-isapnp=no: Most sound cards these days are PCI and so ISA Plug and Play support isn't needed. If you are using an ISA soundcard, it's best to say yes here.

--with-cards=all: You can tell the script just to build the drivers for your particular sound card here. For full information on which drivers are available see ./configure --help. If you aren't sure which chipset your soundcard uses, have a look in CARDS-STATUS in the ALSA Driver source tree. The default specified here will build all drivers.


Configuring ALSA Driver

Config files

/etc/modules.conf


Configuration Information

To configure the ALSA drivers, you need to add some lines to /etc/modules.conf:

cat >> /etc/modules.conf << "EOF"
alias char-major-14 soundcore
alias char-major-116 snd

alias snd-card-0 snd-[soundcard-name]

alias sound-slot-0 snd-card-0

alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-midi
EOF

[soundcard-name] needs to be replaced with the driver relevant to your soundcard. If you have more than one soundcard, you can add additional sections by repeating the above but changing the first 0 to 1 and so on.

After editing /etc/modules.conf you need to run depmod. If the drivers you have compiled are for the version of the kernel you are currently running, simply run

depmod

If you are compiling drivers for a different kernel version than those you are running, you will need to use a line along the lines of:

depmod -a 2.4.22 -F /boot/System.map-2.4.22

Contents

The ALSA Driver package contains the ALSA sound card drivers and include files.


Description

ALSA sound card drivers

These are kernel modules which provide audio and MIDI functionality to the operating system.


include files

These are installed in /usr/include/sound and are required to compile certain packages such as ALSA Libraries.


ALSA Library-0.9.6

Introduction to ALSA Library

The ALSA Library package contains the ALSA library. This is used by programs (including ALSA Utilities) which wish to use the ALSA sound interface.


Package information


ALSA Library dependencies


Installation of ALSA Library

Install ALSA Library by running the following commands:

./configure &&
make &&
make install

Configuring ALSA Library

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The ALSA Library package contains aserver and the libasound library.


Description

libasound (alsa library)

libasound provides ALSA functions for application programs.


ALSA Utilities-0.9.6

Introduction to ALSA Utilities

The ALSA Utilities package contains various utilities which are useful for controlling your sound card.


Package information


ALSA Utilities dependencies


Installation of ALSA Utilities

Install ALSA Utilities by running the following commands:

./configure &&
make &&
make install

Configuring ALSA Utilities

Config files

/etc/asound.state


Configuration Information

Probably the easiest way to store mixer levels is to set and retrieve them using a bootscript. It is possible to do this with a post-install line in /etc/modules.conf but this is left as an exercise for those readers who wish to do this.

The ALSA Driver package installs a script as /etc/rc.d/init.d/alsasound. While it is possible to use this script, it contains a lot of extraneous detail which isn't needed on an LFS system and so we create our own script /etc/rc.d/init.d/alsa.

To create the ALSA script, do the following:

cat > /etc/rc.d/init.d/alsa << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/alsa

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
# Stores mixer settings in the default location: /etc/asound.state

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
    start)
        echo "Starting ALSA...    Restoring volumes..."
        loadproc /usr/sbin/alsactl restore
        #echo "                    Loading MIDI font..."
        #loadproc sfxload /path/to/soundfont
        ;;

    stop)
        echo "Stopping ALSA...    Saving volumes......"
        loadproc /usr/sbin/alsactl store
        #echo "            Removing MIDI font.........."
        #loadproc sfxload -i
        ;;

    restart)
        $0 stop
        /usr/bin/sleep 1
        $0 start
        ;;

    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;

esac

# End $rc_base/init.d/alsa
EOF
chmod 755 /etc/rc.d/init.d/alsa

You can then create the appropriate symlinks:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/alsa ../rc0.d/K35alsa &&
ln -sf ../init.d/alsa ../rc1.d/K35alsa &&
ln -sf ../init.d/alsa ../rc2.d/S40alsa &&
ln -sf ../init.d/alsa ../rc3.d/S40alsa &&
ln -sf ../init.d/alsa ../rc4.d/S40alsa &&
ln -sf ../init.d/alsa ../rc5.d/S40alsa &&
ln -sf ../init.d/alsa ../rc6.d/K35alsa

Note that all channels of your soundcard are muted by default. You can use the alsamixer program from ALSA Utilities (or any other OSS mixer) to change this.

Also, the first time the above script is run, it will complain that there is no state in /etc/asound.state. You can prevent this by running the following commands after installing ALSA Utilities:

touch /etc/asound.state &&
alsactl store

A final note is that the lines loading sfxload are commented out. They are there as an example of other things you may wish to do in the startup script. sfxload is a separate package of interest to SoundBlaster AWE and Live! users. It is designed for loading "sound-fonts" (which are used for MIDI output). You may wish to delete these lines and add your own or, if you have the relevant soundcard, install sfxload and uncomment them.


Contents

The ALSA Utilities package contains aconnect, alsactl, alsamixer, amixer, aplay, arecord and aseqnet.


Description

aconnect

aconnect is a utility for connecting and disconnecting two existing ports in the ALSA sequencer system.


alsactl

alsactl is used to control advanced settings for the ALSA soundcard drivers.


alsamixer

alsamixer is an ncurses-based mixer program for use with the ALSA soundcard drivers.


amixer

amixer allows command-line control of the mixers for the ALSA soundcard drivers.


aplay

aplay is a command-line soundfile player for the ALSA soundcard drivers.


arecord

arecord is a command-line soundfile recorder for the ALSA soundcard drivers.


aseqnet

aseqnet is an ALSA sequencer client which sends and receives event packets over a network.


ALSA Tools-0.9.6

Introduction to ALSA Tools

The ALSA Tools package contains advanced tools for certain soundcards.


Package information


ALSA Tools dependencies


Installation of ALSA Tools

The ALSA Tools package is only needed by those with advanced requirements for their sound card. The tools are not all built together, instead you need to cd into the directory of each tool you wish to compile and run the following commands:

./configure &&
make &&
make install

Contents

The tools available in this package are ac3dec, as10k1, envy24control, sb16_csp and sbiload.


Description

ac3dec

ac3dec is a free AC-3 stream decoder.


as10k1

as10k1 is an assembler for the emu10k1 DSP chip present in the Creative SB Live, PCI 512, and emu APS sound cards. It is used to make audio effects such as a flanger, chorus or reverb.


envy24control

envy24control is a control tool for Envy24 (ice1712) based soundcards


sb16_csp

sb16_csp is an SB16/AWE32 Creative Signal Processor (ASP/CSP ) control program.


sbiload

sbiloadis an OPL2/3 FM instrument loader for the ALSA sequencer.


ALSA OSS-0.9.6

Introduction to ALSA OSS

The ALSA OSS package contains the ALSA OSS compatibility library. This is used by programs which wish to use the ALSA OSS sound interface


Package information


ALSA OSS dependencies


Installation of ALSA OSS

Install ALSA OSS by running the following commands:

./configure &&
make &&
make install

Configuring ALSA OSS

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The ALSA OSS package contains aoss and the libaoss (ALSA OSS compatibility library) library.


aRts-1.1.4

The Analog Real-time Synthesizer (aRts) provides software that can simulate a complete "modular analog synthesizer" on your computer. It creates sounds and music using small modules like oscillators for creating waveforms, various filters, modules for playing data on your speakers, mixers, and faders. You can build a complete setup with the GUI of the system, using the modules - generators, effects and output - connected to each other.

aRts provides necessary libraries for KDE, however it can be installed as a standalone package. The installation instructions for aRts can be found in the aRts-1.1.4 portion of the KDE installation instructions.


Audio File-0.2.3

Introduction to Audio File

The Audio File package contains the audio file libraries and two sound file support programs. These are useful to support basic sound file formats.


Package information


Installation of Audio File

Install Audio File by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Audio File package contains libaudiofile libraries, audiofile-config, sfinfo and sfconvert.


Description

audiofile libraries

The libaudiofile library is used by programs to support AIFF, AIFF -compressed, Sun/NeXT, WAV and BIC audio formats.


audiofile-config

The audiofile-config script is used during the compile process by programs linking to this library.


sfinfo

The sfinfo program displays the sound file format, audio encoding, sampling rate and duration for audio formats supported by this library.


sfconvert

The sfconvert program converts sound file formats where the original format and destination format are supported by this library.


EsounD-0.2.30

Introduction to EsounD

The EsounD package contains Enlightened Sound Daemon. This is useful for mixing together several digitized audio streams for playback by a single device.


Package information


EsounD dependencies


Installation of EsounD

Install EsounD by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc &&
make &&
make install

Command explanations

--sysconfdir=/etc: This switch puts configuration files in /etc instead of /use/etc.


Configuring EsounD

Config files

/etc/esd.conf


Configuration Information

Instructions and information about the configuration file is located in the TIPS file in the EsounD source directory.


Contents

The EsounD package contains esd, esdcat, esdctl, esdloop, esdmon, esdrec, esdsample and libesd libraries.


Description

esd

esd is the Enlightened Sound Daemon.


esdcat

esdcat plays a RAW audio stream through the daemon.


esdctl

esdctl controls certain aspects of the sound daemon.


esdloop

esdloop is test scaffolding for sample cache, loop, and free.


esdmon

esdmon outputs the mixed stream from the daemon.


esdrec

esdrec outputs from the sound device's current input.


esdsample

esdsample is test scaffolding for sample cache, play back, and free.


esd libraries

libesd libraries contain the functions used by esd.


SDL-1.2.6

Introduction to SDL

The Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multimedia software, such as games and emulators.


Package information


Installation of SDL

Install SDL by running the following commands:

./configure --prefix=/usr --disable-debug &&
make &&
make install

Command explanations

--disable-debug: This switch configures SDL to build with aggressive optimizations.

--enable-video-aalib: This optional switch is required to build SDL with AAlib video support.


Configuring SDL

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The SDL package contains the Simple DirectMedia Layer.


Description

Simple DirectMedia Layer

The Simple DirectMedia Layer is a generic API that provides low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D frame buffer across multiple platforms.


libao-0.8.3

Introduction to libao

The libao package contains a cross-platform audio library. This is useful to output audio on a wide variety of platforms. It currently supports WAV files, OSS (Open Sound System), ESD (Enlighten Sound Daemon) and ALSA (Advanced Linux Sound Architecture).


Package information


Installation of libao

Install libao by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libao package contains libao libraries.


Description

ao libraries

libao libraries provide functions for programs wishing to output sound over supported platforms.


libogg-1.0

Introduction to libogg

The libogg package contains the Ogg file structure. This is useful for creating (encoding) or playing (decoding) a single physical bit stream.


Package information


Installation of libogg

Install libogg by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libogg package contains libogg libraries.


Description

ogg libraries

libogg libraries provide the functions for programs wishing to read or write OGG formatted bit streams.


libvorbis-1.0

Introduction to libvorbis

The libvorbis package contains a general purpose audio and music encoding format. This is useful for creating (encoding) and playing (decoding) sound in an open (patent free) format.


Package information


libvorbis dependencies

Required

libogg-1.0


Installation of libvorbis

Install libvorbis by running the following commands:

./configure --prefix=/usr &&
make &&
make install

libvorbis is known to cause compiler errors on certain machines. If you get errors, try these commands to install libvorbis:

./configure --prefix=/usr &&
cd lib &&
cp Makefile Makefile.bak &&
sed s/-mno-ieee-fp// Makefile.bak > Makefile &&
cd .. &&
make &&
make install

Contents

The libvorbis package contains libvorbis libraries.


Description

vorbis libraries

libvorbis libraries provide the functions to read and write sound files.


NAS-1.6

Introduction to NAS

The Network Audio System is a network transparent, client/server audio transport system. It can be described as the audio equivalent of an X server.


Package information


Installation of NAS

Install NAS by running the following commands:

patch -Np1 -i ../nas-1.6-bison-fix.patch &&
xmkmf &&
make Makefiles &&
make includes &&
make depend &&
make &&
make INCROOT=/usr/include USRLIBDIR=/usr/lib \
MANPATH=/usr/share/man BINDIR=/usr/bin \
LIBDIR=/usr/lib CONFIGDIR=/usr/X11R6/lib/X11/config \
install install.man

Command explanations

xmkmf...: These commands use the standard for compiling X based applications.

make INCROOT=...: These commands install with the /usr prefix instead of the default /usr/X11R6 prefix. They also install the man pages.


Configuring NAS

Configuration Information

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The NAS package contains NAS utilities, headers and libraries.


libmpeg3-1.5.2

Introduction to libmpeg3

Libmpeg3 supports advanced editing and manipulation of MPEG streams.


Package information


libmpeg3 dependencies

Required

NASM-0.98.38


Installation of libmpeg3

Install libmpeg3 by running the following commands:

make &&
make install &&
cp i686/libmpeg3.a /usr/lib &&
cp libmpeg3.h mpeg3private.h /usr/include

Command explanations

cp i686/libmpeg3.a /usr/lib && cp libmpeg3.h mpeg3private.h /usr/include: Since make install doesn't copy the library and header files to proper locations, we have to do it manually.


Contents

The libmpeg3 package provides libmpeg3 library, mpeg3cat, mpeg3dump and mpeg3toc utilities.


Description

libmpeg3

libmpeg3 decodes several MPEG standards into uncompressed data suitable for editing and playback.


mpeg3cat

mpeg3cat concatenates elementary streams or demultiplexes a program stream (separates components of the stream).


mpeg3dump

mpeg3dump dumps information or extracts audio to a 24 bit PCM file.


mpeg3toc

mpeg3toc creates a table of contents for a DVD or MPEG stream.


libmad-0.15.0b

Introduction to libmad

Libmad is a high-quality MPEG audio decoder capable of 24-bit output.


Package information


Installation of libmad

Install libmad by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

This package provides libmad library.


Description

libmad

libmad is a MPEG audio decoder library.


OpenQuicktime-1.0

Introduction to OpenQuicktime

OpenQuicktime is a small library that handles the Quicktime file format on most varieties of Unix. Audio and video decoding and encoding is provided using a plug-in mechanism.


Package information


Additional downloads


OpenQuicktime dependencies

Optional

GLib-1.2.10 and libjpeg-6b


Installation of OpenQuicktime

Install OpenQuicktime by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

This package provides libopenquicktime library and utilities that allow you to manipulate Quicktime files.


Description

libopenquicktime

This is the core library.


dechunk

dechunk extracts RGB frames from a movie and writes them as PPM images.


make_streamable

This program makes the Quicktime file streamable.


qtdump

qtdump dumps all tables in movie.


qtinfo

qtinfo reads all the information about the file.


recover

This program recovers JPEG and PCM audio from a corrupted movie.


libFAME-0.9.0

Introduction to libFAME

libFAME is a fast (real-time) MPEG-1 as well as MPEG-4 rectangular and arbitrary shaped video encoding library.


Package information


Installation of libFAME

Install libFAME by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libFAME package contains libfame-config and libfame.


Description

libfame-config

libfame-config provides configuration information for libfame .


libfame

libfame provides functions for the video encoding programs.


Speex-1.0.1

Introduction to Speex

Speex is an audio compression format designed especially for speech. It is well-adapted to Internet applications and provides useful features that are not present in most other CODECs.


Package information


Speex dependencies

Recommended

libogg-1.0


Installation of Speex

Install Speex by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Speex package provides speexdec, speexenc and libspeex.


Description

speexdec

speexdec decodes a Speex file and produce a WAV file or RAW file.


speexenc

speexenc encodes a WAV or RAW file using Speex.


libspeex

libspeex provides functions for the audio encoding/decoding programs.


id3lib-3.8.3

Introduction to id3lib

id3lib is a library for reading, writing and manipulating ID3v1 and ID3v2 tags.


Package information


Installation of id3lib

Install id3lib by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The id3lib package contains the libid3 library and id3convert, id3cp, id3info and id3tag.


Description

libid3

libid3 provides functions for the ID3v1/v2 tag editing programs.


id3convert

id3convert converts between ID3v1/v2 tagging formats.


id3cp

id3cp extracts ID3v1/v2 tags from digital audio files.


id3info

id3info prints ID3v1/v2 tag contents.


id3tag

id3tag is an utility for editing ID3v1/v2 tags.


FLAC-1.1.0

Introduction to FLAC

FLAC is an audio CODEC similar to MP3, but lossless, meaning that audio is compressed without throwing away any information.


Package information


FLAC dependencies


Installation of FLAC

Install FLAC by running the following commands:

./configure --prefix=/usr
make &&
make install

Contents

The FLAC package contains flac, metaflac, libFLAC, libFLAC++, libOggFLAC, libOggFLAC++ and libxmms-flac.


Description

flac

flac is a command-line utility for encoding, decoding and converting FLAC files.


metaflac

metaflac is a program for listing, adding, removing, or editing metadata in one or more FLAC files.


libFLAC, libFLAC++, libOggFLAC and libOggFLAC++

These libraries provide native FLAC and Ogg FLAC C/C++ APIs for programs utilizing FLAC.


libxmms-flac

libxmms-flac is a plugin for XMMS.


libdvdread-0.9.4

Introduction to libdvdread

libdvdread is a library which provides a simple foundation for reading DVDs.


Package information


libdvdread dependencies


Installation of libdvdread

Install libdvdread by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Command explanations

--with-libdvdcss: This switch is needed if you want libdvdread to be able to read CSS encrypted DVDs.


Contents

The libdvdread package contains the libdvdread library.


Description

libdvdread

libdvdread provides the functionality that is required to access DVDs.


libdvdcss-1.2.8

Introduction to libdvdcss

libdvdcss is a simple library designed for accessing DVDs like a block device without having to bother about the decryption.


Package information


Installation of libdvdcss

Install libdvdcss by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libdvdcss package contains the libdvdcss library.


Description

libdvdcss

libdvdcss provides the functionality that is required for transparent DVD access with CSS decryption.


libdv-0.99

Introduction to libdv

libdv (Quasar DV) is a software CODEC for DV video, the encoding format used by most digital camcorders.


Package information


libdv dependencies


Installation of libdv

Install libdv by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The libdv package contains dvconnect, encodedv, playdv and libdv.


Description

dvconnect

dvconnect is a small utility to send or capture raw data from and to the camcorder.


encodedv

encodedv encodes a series of images to a digital video stream.


playdv

playdv displays digital video streams on the screen.


libdv

libdv provides functions for the programs manipulating with the Quasar DV CODEC.


liba52-0.7.4

Introduction to liba52

liba52 is a free library for decoding ATSC A/52 (also known as AC-3) streams. The A/52 standard is used in a variety of applications, including digital television and DVD.


Package information


Installation of liba52

Install liba52 by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The liba52 package contains a52dec, extract_a52 and liba52.


Description

a52dec

a52dec plays ATSC A/52 audio streams.


extract_a52

extract_a52 extracts ATSC A/52 audio from a MPEG stream.


liba52

liba52 provides functions for the programs dealing with ATSC A/52 streams.


XviD-0.9.2

Introduction to XviD

XviD is a MPEG-4 compliant video CODEC.


Package information


XviD dependencies

Optional

NASM-0.98.38


Installation of XviD

Install XviD by running the following commands:

cd build/generic &&
./configure --prefix=/usr &&
make  &&
make install &&
cp ../../src/divx4.h /usr/include

Command explanations

cp ../../src/divx4.h /usr/include: This command puts this header files in the header search path in order for Xine and MPlayer to locate this package.


Contents

The XviD core package contains the libxvidcore library and the appendant header files. The library itself provides functions to encode and decode most MPEG-4 video data.

Following features of MPEG-4 are supported:

I, P Frame encoding

I-Frames are image frames, while P-Frames are Pattern Frames. Image Frames contain full images. P-Frames contain patterns of what changes in the image, thusly saving a lot of space.

PMVFast and EPZS with diamond a sqare pattern motion estimation

Fast Motion detection that can refer a square or diamond shaped pattern to different directions.

inter4v mode

Fast interpolation ability.

fullpixel and halfpixel precision

Even halfpixel movements can be encoded. Better precision results in better compression at better quality.

both MPEG-4 and H263 quantizations

MPEG-4 is the standard DivX was derived from. H263 is a slightly changed subset of that standard made by Microsoft. Quantization means to map the quantity of color values to numbers.

custom quant matrices

The quantization can be done using custom matrices, possibly giving better results if the matrix is made to suit the video data. Every normal user should be fine with the default matrix that comes with XviD.

Adaptive quantization / Luminance masking

Qantization and Luminance masking are variant, depending on the input material, therefore providing better results on dark or very contrasting images.


xine Libraries-1-rc0a

Introduction to xine Libraries

The xine Libraries package contains xine libraries. These are useful for interfacing with external plug-ins that allow the flow of information from the source to the screen and speakers.


Package information


Installation of xine Libraries

Install xine Libraries by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The xine Libraries package contains xine-config and libxine libraries.


Description

xine-config

xine-config provides information to programs trying to link with the xine libraries.


libxine libraries

libxine libraries provide the API for processing video files.


Chapter 42. Audio utilities

This chapter contains programs involved with audio file manipulation; that is to say playing, recording, ripping and the other common things which people want to do. To use much of this software, you will require either the kernel sound drivers installed, or ALSA-0.9.6 installed. Note that in the 2.5 kernel development tree, the old drivers are being replaced with ALSA and so when the stable 2.6 series arrives; most people will be using it by default.


mpg123-0.59r

Introduction to mpg123

The mpg123 package contains a console-based MP3 player. It claims to be the fastest MP3 decoder for Unix.


Package information


mpg123 dependencies

Required

OSS or ALSA OSS-0.9.6


Installation of mpg123

Install mpg123 by running the following commands:

make PREFIX=/usr linux &&
make PREFIX=/usr install

Contents

The mpg123 package contains mpg123 .


Description

mpg123

mpg123 is used for playing MP3 files via the console.


Vorbis Tools-1.0

Introduction to Vorbis Tools

The Vorbis Tools package contains command-line tools for OGG audio files. This is useful for encoding, playing or editing files using the Ogg CODEC.


Package information


Vorbis Tools dependencies


Installation of Vorbis Tools

Install Vorbis Tools by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Vorbis Tools package contains oggdec, oggenc, ogg123, vcut and vorbiscomment.


Description

oggdec

oggdec is a simple decoder which converts Ogg Vorbis file into PCM audio files (WAV or RAW).


oggenc

oggenc is the encoder that turns RAW, WAV or AIFF files into an Ogg Vorbis stream.


ogg123

ogg123 is a command-line audio player for Ogg Vorbis streams.


ogginfo

ogginfo prints information stored in the audio file.


vcut

vcut will split a file into two files at a designated cut point.


vorbiscomment

vorbiscomment is an editor that changes information in the audio file metadata tags.


XMMS-1.2.7

Introduction to XMMS

XMMS is an audio player for the X Window System.


Package information


XMMS dependencies

Required

a working soundcard, XFree86-4.3.0.1, GTK+-1.2.10 and GLib-1.2.10


Installation of XMMS

Install XMMS by running the following commands:

./configure --prefix=/usr --enable-one-plugin-dir &&
make &&
make install

Command explanations

./configure --prefix=/usr --enable-one-plugin-dir: This command ensures that all plugins are located under /usr/lib/xmms/Plugins.


Configuring XMMS

Config files

~/.xmms/config


Configuration Information

When you start xmms for the first time, you can configure it with CTRL+P Note that you can extend XMMS' functionality with plugins and skins. You can find these at http://xmms.org.


Contents

The XMMS package contains xmms, xmms-config, gnomexmss and wmxmms.


Description

xmms

XMMS, which stands for X MultiMedia System, is a program comparable in function with WinAMP. It's main function is playing audio files like WAV and MP3. It can be extended with plugins to play a number of other audio or video formats. It's look can be customized with WinAMP style skins.


xmms-config

This script is used by other programs which need to link with xmms to retrieve the library and include paths.


gnomexmms

This is an applet for the GNOME desktop environment that will dock into the GNOME panel. From the applet you can start and control xmms.


wmxmms

wmxmms is a dock applet for the Window Maker window manager. From the applet you can start and control xmms.


LAME-3.93.1

Introduction to LAME

The LAME package contains a MP3 encoder. This is useful for creating compressed audio files.


Package information


Installation of LAME

Install LAME by running the following commands:

./configure --prefix=/usr --mandir=/usr/share/man --with-gtk-prefix=/usr &&
make &&
make install

Command explanations

--with-gtk-prefix=/usr: This switch directs configure to gtk-config.


Contents

The LAME package contains lame and libmp3lame libraries.


Description

lame

lame creates MP3 audio files.


libmp3lame libraries

libmp3lame libraries provide the functions necessary to convert WAV files to MP3 files.


CDParanoia-III-9.8

Introduction to CDParanoia

The CDParanoia package contains cdparanoia. This is useful for extracting wave files from audio CD's. A CDDA capable CDROM drive is needed. Practically all drives supported by Linux can be used.


Package information


Installation of CDParanoia

Install CDParanoia by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring CDParanoia

Configuration Information

CDParanoia itself needs little configuration; information can be found from the man page.

As with most libraries, there is no configuration to do, save that the library directory i.e. /opt/lib or /usr/local/lib should appear in /etc/ld.so.conf so that ldd can find the shared libraries. After checking that this is the case, /sbin/ldconfig should be run while logged in as root.


Contents

The CDParanoia package contains cdparanoia and the libcdda libraries.


Description

cdparanoia

This is used for 'ripping' an audio-cd. Ripping is the process of digitally extracting music from an audio-cd.


libcdda library

No description is currently available.


Chapter 43. Video utilities

This chapter always seems to be the favorite chapter. It's probably because there is a lot of satisfaction in playing your first video when you have spent so much time getting to that point. All the libraries, all the configurations and your reward is that you get to watch a movie. Not to worry though, there is always one more CODEC to install.


FFmpeg-0.4.7

Introduction to FFmpeg

FFmpeg is a solution to record, convert and stream audio and video. Due to heavy development, not all of this functions will work.


Package information


Installation of FFmpeg

Install FFmpeg by running the following commands:

Note: The package maintainers recommend compiling without any optimizations.

./configure --prefix=/usr --enable-shared &&
make &&
make install

Command explanations

--enable-shared: This switch is needed to build libavcodec and libavformat shared libraries.


Configuring FFmpeg

Config files

~/.ffmpeg/ffserver-config

You'll find a sample ffserver configuration file at http://ffmpeg.sourceforge.net/sample.html


Contents

The FFmpeg package contains ffmpeg , ffserver, ffplay, libavcodec and libavformat.


Description

ffmpeg

ffmpeg is a command-line tool to convert video files, network streams and input from a TV card to several video formats.


ffserver

ffserver is a streaming server for everything that ffmpeg could use as input (files, streams, TV card input, webcam, etc.).


ffplay

ffplay is a very simple and portable media player using the ffmpeg libraries and the SDL library.


libavcodec/libavformat

libavcodec and libavformats are libraries for encoding/decoding video streams and putting them into files or network packets. Since they're well documented, you can easily include them in your software, like some other packages already do.


Avifile-0.7.38

Introduction to Avifile

The Avifile package contains an AVI video file player, tools and support libraries. This is useful for viewing and editing AVI files.


Package information


Avifile dependencies

Required

Qt-3.2.1 and SDL-1.2.6


Installation of Avifile

Install Avifile by running the following commands:

install -d /usr/lib/avifile-0.7/win32 &&
tar xzvf ../binaries-011002.tgz -C /usr/lib/avifile-0.7 &&
./autogen.sh &&
./configure &&
make maintainer-clean &&
./autogen.sh &&
./configure --prefix=/usr --with-qt-prefix=/opt/qt \
--with-win32-path=/usr/lib/avifile-0.7/win32 &&
make &&
make install

Command explanations

./autogen.sh && ./configure && make maintainer-clean && ./autogen.sh: The author of this package used the old autoconf which leads to problems like configure not being able to detect some libraries and compilation errors. We fix this by rebuilding the configuration scripts.


Contents

The Avifile package contains aviplay, avibench, avifile-config, mmxnow-config, avirecompress, avicap, avirec, kv4lsetup, avicat, avitype and avimake.


Description

aviplay

aviplay manages the input formats, the CODECs and the output formats to display AVI video files on your screen.


avibench

avibench performs a measurement of the AVI file support library's performance for a file.


avifile-config

avifile-config is run by configure for programs wishing to link to the Avifile library.


mmxnow-config

mmxnow-config is run by configure for programs wishing to link to the mmxnow library.


avirecompress

avirecompress is a widget that takes an input file of one CODEC type and converts it into a video file of another CODEC.


avicap

avicap is a widget that displays acquired video from a Video For Windows (vfw) compatible device, like a webcam or a TV-tuner.


avirec

avirec is a command-line video recording tool.


kv4lsetup

kv4lsetup is a small tool which tells video4linux about the current video mode


avicat

avicat takes a set of AVI files and combines them into a single file.


avitype

avitype will read and display AVI file header information.


avimake

avimake takes a set of JPG images and creates a movie.


MPlayer-1.0pre1

Introduction to MPlayer

The MPlayer package contains an audio/video player that is able to play almost every audio and video CODEC and can be controlled by command line or GUI.


Package information


Additional downloads

Note: These are the minimum to install working MPlayer. For more CODECs, skins and fonts visit MPlayer's homepage.


Installation of MPlayer

Note: The package maintainers recommend building without any optimization

Install MPlayer by running the following commands:

install -d /usr/lib/mplayer/extralite &&
tar xjvf ../extralite.tar.bz2 -C /usr/lib/mplayer &&
./configure --prefix=/usr --confdir=/etc/mplayer --enable-largefiles \
--enable-gui --enable-menu --enable-shared-pp \
--with-codecsdir=/usr/lib/mplayer/extralite &&
make &&
make install &&
make -C libavcodec/libpostproc install &&
cp etc/codecs.conf /etc/mplayer &&
tar xjvf ../default-1.7.tar.bz2 -C /usr/share/mplayer/Skin

If FreeType is in use, the only advantage of prerendered fonts is that they are faster. Install them like this:

tar xjvf ../font-arial-iso-8859-1.tar.bz2 -C /usr/share/mplayer/font

Installation for DVD playback

If you want DVD playback with MPlayer, you need to make a link from your DVD drive to /dev/dvd:

ln -s /dev/[dvd drive] /dev/dvd

Replace [dvd drive] with whatever device is appropriate, for example /dev/hdc. if you don't know which device to choose, type:

dmesg | grep DVD

It should result in an output like:

hdc: Pioneer DVD-ROM ATAPIModel DVD-114 0110,
ATAPI CD/DVD-ROM drive

If you have SCSI-Emulation activated for the drives, you'll need to get the right SCSI-device. Every CD/DVD-ROM drive is mapped in the same order as in IDE to the devices named /dev/scd0, /dev/scd1 and so on.


Command explanations

--enable-gui: This switch tells MPlayer to compile the GUI code.

--enable-menu: These switches enable the new menu support. It's like an OSD, but you can also run a shell with it.

--enable-shared-pp: This enables the building of a shared libpostproc (library for post processing, featuring filters like sharpen).

cp etc/codecs.conf /etc/mplayer: This command copies the standard codecs.conf file to the system-wide configuration directory. MPlayer expects this file at startup.


Configuring MPlayer

Config files

/etc/mplayer/*, ~/.mplayer/*


Configuration Information

If you wish to utilize a FreeType font, you need to link a TTF file to your ~/.mplayer directory. For example:
ln -sf /usr/X11R6/lib/X11/fonts/TTF/luxisri.ttf /etc/mplayer/subfont.ttf
otherwise
ln -sf /usr/share/mplayer/font/font-arial-*-iso-8859-1 /etc/mplayer/font
where * is the font size. You can chose your font size of 14, 18, 24 or 28.

Set up the GUI with the following commands executed from your source directory:

cat > /etc/mplayer/config << "EOF"
gui = yes
skin = default
EOF

The first line, gui = yes, will make MPlayer start in GUI mode automatically. If you want to decide whether to start in GUI mode or not, leave that line out and start mplayer with -gui or as gmplayer (e.g. when starting from a Window Manager menu or command prompt).


Contents

The MPlayer package contains mplayer, gmplayer and mencoder.


Description

mplayer

mplayer manages the input formats, the CODECs and the output formats to play video files, DVDs, (S)VCDs or network streams containing audio and/or video information on your system.

Examples:

mplayer -fs blfs.avi
mplayer -vo fbdev -fb /dev/fb0 -dvd 1 -aid 128 -sub en -framedrop
mplayer -fs vcd://1    # works both for VCDs and SVCDs
mplayer http://www.students.uni-marburg.de/~Klossa/hapkidofight_lo.mpg

For further information, have a look at the very good documentation included in the package in the subdirectory DOCS/.


gmplayer

gmplayer is MPlayer with a graphical user interface.


mencoder

mencoder is used to encode any MPlayer playable movie to DivX4, XviD or any CODEC in libavcodec with PCM/MP3/VBRMP3 audio.

Example:

rm frameno.avi
mencoder -dvd 1 -aid 128 -ovc frameno -oac mp3lame \
-lameopts vbr=3 -o frameno.avi

# mencoder should output bitrates for average encodings
# now, choose one you like best! In the following lines,
# replace <bitrate> and <name.avi> with statements of your
# personal liking.

mencoder -dvd 1 -aid 128 -oac copy -ovc lavc \
-lavcopts vcodec=mpeg4:vpass=1:vhq:vbitrate=<bitrate> -o <name.avi>
mencoder -dvd 1 -aid 128 -oac copy -ovc lavc \
-lavcopts vcodec=mpeg4:vpass=2:vhq:vbitrate=<bitrate> -o <name.avi>
mencoder -forceidx <name.avi>

xine User Interface-0.9.22

Introduction to xine User Interface

The xine User Interface package contains a user interface for xine. This is useful for controlling the operations of your movie.


Package information


xine User Interface dependencies


Installation of xine User Interface

Install xine User Interface by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Configuring xine User Interface

Config files

~/.xine/config


Configuration Information

The above file is created and maintainable through the xine setup dialog box. The documentation for the configuration settings is located at /usr/share/doc/xine-ui/README.config_en.


Contents

The xine User Interface package contains xine, xine-check and xine-remote.


Description

xine

xine plays MPEG streams (audio and video), MPEG elementary streams (MP3), MPEG transport streams, OGG files, AVI files, ASF files, some quicktime files, VCD's and DVD's (non-encrypted).


xine-check

xine-check tests the xine video player installation for common problems.


xine-remote

xine-remote is a tool to connect to a xine remote control server.


transcode-0.6.10

Introduction to transcode

transcode is a fast versatile command-line based audio/video everything to everything converter.


Package information


Installation of transcode

Install transcode by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The transcode package contains transcode, tccat, tcdecode, tcdemux, tcextract, tcframe, tcprobe, tcscan, avicodec, avidump, avimerge, avisplit, avisync and input/filter/output modules.


Description

transcode

transcode is the encoder's user interface that handles the plugins and other programs, being the glue between the modules. There are several well documented usage examples on either the homepage or the documentation included in the package.


tccat

tccat concatenates input files using the input plugins of transcode.


tcdecode

tcdecode is used to decode input files to RAW video and PCM audio stream.


tcdemux

tcdemux demultiplexes (separates) audio/video input that contains multiple streams, e.g. VOB files..


tcextract

tcextract grabs single streams from a file containing multiple streams.


tcframe

tcframe processes single video frames for different color encodings (RGB >-< YUV or similar).


tcprobe

tcprobe prints information about the input file format.


tcscan

tcscan performs several measurements on the given input data.


avicodec

avicodec indicates or changes FOURCC CODEC flag in an AVI file.


avidump

avidump dumps audio or video stream of an given AVI file to stdout (for AVI conversion or extraction of audio streams).


avimerge

avimerge merges AVI files of the same format. Do not try to merge AVI files of different formats, it will most likely result in errors (and format means same bitrates, too!).


avisplit

avisplit splits AVI files into multiple files.


avisync

avisync can shift audio in AVI files for better synchronizing of audio and video data signal.


input/filter/output modules

Depending on the external libraries that are used, there are a great number of plugins to convert audio and video input to RAW format, process RAW video and audio and convert RAW audio and video to other formats to be written into a file type of choice. Read the documentation.


Chapter 44. CD-Writing utilities

This chapter contains information on CD-writing in Linux. You will first have to configure your kernel for CD-writing. We start by discussing how to do this, then discuss installing the actual utilities.

Additional sources of information on CD-writing include:


Configuring your kernel for CD-Writing

In the kernel configuration, check your settings with those listed below for your CD-ROM interface type:

SCSI CD-writer:

SCSI support menu
  SCSI support:           Y or M
  SCSI CD-ROM support:    Y or M
  SCSI generic support:   Y or M
  Vendor-specific extensions:  [1]
Also include the low-level driver for your SCSI card if
applicable.

IDE CD-writer:

ATA/IDE/MFM/RLL support menu
  IDE/ATAPI CDROM support:     N
  SCSI emulation support: Y or M
SCSI support menu
  SCSI support:           Y or M
  SCSI CD-ROM support:    Y or M
  SCSI generic support:   Y or M
  Vendor-specific extensions:  [1]

[1] Read the help to determine if this selection is applicable for your hardware.

If necessary, recompile the kernel with
make CC=/opt/gcc-2.95.3/bin/gcc dep &&
make CC=/opt/gcc-2.95.3/bin/gcc bzImage &&
make CC=/opt/gcc-2.95.3/bin/gcc modules &&
make CC=/opt/gcc-2.95.3/bin/gcc modules_install

Copy /usr/src/linux/arch/i386/boot/bzImage and /usr/src/linux/System.map to /boot. If you utilize LILO, edit /etc/lilo.conf appropriately and run lilo.

For more information about these settings and the drivers they install, read The Linux 2.4 SCSI subsystem HOWTO.


Cdrtools-2.00.3

Introduction to Cdrtools

The Cdrtools package contains CD recording utilities. These are useful for reading, creating or writing (burning) Compact Discs.


Package information


Installation of Cdrtools

Install Cdrtools by running the following commands:

make INS_BASE=/usr DEFINSUSR=root DEFINSGRP=root &&
make INS_BASE=/usr DEFINSUSR=root DEFINSGRP=root install

Command explanations

INS_BASE=/usr: This command moves the install directory from /opt/schily to /usr.

DEFINSUSR=root DEFINSGRP=root: These commands install all programs with root.root ownership instead of the default bin:bin.


Contents

The Cdrtools package contains cdrecord, cdda2wav, mkisofs, mkhybrid, readcd, scgcheck, isoinfo, isodump, isovfy, isodebug, devdump, rscsi and support libraries.


Description

cdrecord

cdrecord records audio or data Compact Discs.


cdda2wav

cdda2wav dumps Compact Disc audio into WAV sound files.


mkisofs

mkisofs and mkhybrid generate an ISO9660/JOLIET/HFS hybrid file system.


readcd

readcd reads or writes Compact Discs.


scgcheck

scgcheck is used to check and verify the Application Binary Interface of libscg.


support utilities

isoinfo, isodump, isovfy, isodebug and devdump are utility programs for dumping and verifying ISO9660 images.


rscsi

rscsi is a remote SCSI manager.


support libraries

libdeflt, libedc_ecc, libfile, libhfs, libparanoia, librscg, libscg, libschily and libunls are the support libraries for this package.


Cdrdao-1.1.7

Introduction to Cdrdao

The Cdrdao package contains CD recording utilities. These are useful for burning a CD in disk-at-once mode.


Package information


Cdrdao dependencies

Optional

LAME-3.93.1


Installation of Cdrdao

Install Cdrdao by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The Cdrdao package contains cdrdao .


Description

cdrdao

cdrdao records audio or data CD-Rs in disk-at-once (DAO) mode based on a textual description of the CD contents.


UDFtools-1.0.0b2

Introduction to UDFtools

The UDFtools package contains utilities for creating and mounting CD-RW disks with udf file systems for both reading and writing. UDF files systems are used on both CD-RW media and on DVD. For more details of the UDF file system standard see: http://www.osta.org and http://www.ecma-international.org.


Package information


Installation of the kernel patch

Install the kernel patch by running the following commands from the kernel source directory:

patch -Np1 -i ../linux-2.4.20-packet.patch

In the kernel configuration, check your setting with those listed here:

Block devices
   Packet writing on CD/DVD media:       Y or M
File Systems
   UDF filesystems support (read only):  Y
     UDF write support (DANGEROUS)       Y

If necessary, recompile the kernel with
make CC=/opt/gcc-2.95.3/bin/gcc dep &&
make CC=/opt/gcc-2.95.3/bin/gcc bzImage &&
make CC=/opt/gcc-2.95.3/bin/gcc modules &&
make CC=/opt/gcc-2.95.3/bin/gcc modules_install

Copy /usr/src/linux/arch/i386/boot/bzImage and /usr/src/linux/System.map to /boot. If you utilize LILO edit /etc/lilo.conf appropriately and run lilo.

If you build packet writer as a module, add the following to /etc/modules.conf:
alias block-major-97 pktcdvd

Finally, create the packet driver device nodes in /dev, add one node for every CD-RW drive you want to support:

mknod /dev/pktcdvd0 b97 0
mknod /dev/pktcdvd1 b 97 1

Installation of UDFtools

Install UDFtools by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Contents

The UDFtools package contains pktsetup, cdrwtool, and mkudffs.


Description

pktsetup

pktsetup is used to establish and break down associations between the kernel packet driver and a physical drive.

Example:
pktsetup /dev/pktcdvd0 /dev/scd0
mount /dev/pktcdvd0 /mnt/cdrom -t udf -o rw,noatime
associates the physical device /dev/scd0 with the kernel packet driver /dev/pktcdvd0, then mounts a UDF formatted CD-RW for read/write access.


cdrwtool

cdrwtool provides facilities to manage CD-RW drives, including formatting new disks, setting the read and write speeds etc..

Example:
cdrwtool -d /dev/scd0 -q
prepares a new CD-RW for use and formats it with a UDF file system.


mkudffs

mkudffs is used to create new UDF file systems, it can be used on hard disks and CD-R as well as CD-RW.

XIII. Printing, Scanning and Typesetting


Chapter 45. Printing

This chapter contains spooling printer management systems and ghostscript applications to render PostScript for display on terminals or paper.


CUPS-1.1.19

Introduction to CUPS

The Common Unix Printing System (CUPS) is a print spooler and associated utilities. It is based on the "Internet Printing Protocol" and provides printing services to most PostScript and raster printers.


Package information


Installation of CUPS

Install CUPS by running the following commands:

./configure &&
make &&
make install

Command explanations

The basic default behavior of the installation is appropriate for LFS systems. CUPS files are placed in /usr/bin, /usr/sbin, /var and /etc/cups.


Configuring CUPS

Configuration of CUPS is dependent on the type of printer and can be complex. Generally, PostScript printers are easier. For detailed instructions on configuration and use of CUPS, see http://www.cups.org/documentation.php. The Software Administrators Manual and Software Users Manual are particularly useful.

During the install, CUPS created the startup file /etc/rc.d/init.d/cups. The file works, but you may want to change it to a more conventional LFS startup file:

cat > /etc/rc.d/init.d/cups << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/cups

# Start or stop the CUPS server based upon the first argument to the script.

source /etc/sysconfig/rc
source $rc_functions

case $1 in
    start)
           echo "Starting CUPS Printserver..."
           loadproc /usr/sbin/cupsd
           ;;
    stop)
           echo "Stopping CUPS Printserver..."
           killproc cupsd
           ;;

    reload)
           echo "Reloading CUPS Printserver..."
           reloadproc /usr/sbin/cupsd
           ;;

    restart)
           $0 stop
           sleep 1
           $0 start
           ;;

    status)
           statusproc cupsd
           ;;

    *)
           echo "Usage: $0 {start|stop|reload|restart|status}"
           exit 1
           ;;
esac

# End $rc_base/init.d/cups startup script.
EOF

Create the symbolic links to this file in the relevant rc.d directory with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/cups ../rc0.d/K00cups &&
ln -sf ../init.d/cups ../rc2.d/S99cups &&
ln -sf ../init.d/cups ../rc3.d/S99cups &&
ln -sf ../init.d/cups ../rc5.d/S99cups

Contents

CUPS provides accept, cupsaddsmb, cupsd, cupstestppd, lpadmin, lpc, lpinfo, lpmove, reject, cancel, cups-config, disable, enable, lp, lpoptions, lppasswd, lpq, lpr, lprm, lpstat, libcups, libcupsimage and various scripts and filters.


lpc

lpc provides limited control over printer and class queues provided by CUPS .


cupsd

cupsd is the scheduler for the Common Unix Printing System.


accept

accept instructs the printing system to accept print jobs to the specified destinations.


reject

reject reject instructs the printing system to reject print jobs to the specified destinations.


cupsaddsmb

cupsaddsmb exports printers to the SAMBA software for use with Windows clients.


lpadmin

lpadmin configures printer and class queues provided by CUPS.


lpinfo

lpinfo lists the available devices or drivers known to the CUPS server.


lpmove

lpmove moves the specified job to a new destination.


cupstestppd

cupstestppd tests the conformance of PPD files.


lpq

lpq shows the current print queue status on the named printer.


lpr

lpr submits files for printing.


lprm

lprm cancels print jobs that have been queued for printing.


cancel

cancel cancels existing print jobs.


disable

disable stops the named printers or classes.


enable

enable starts the named printers or classes.


lp

lp submits files for printing or alters a pending job.


lpoptions

lpoptions displays or sets printer options and defaults.


lpstat

lpstat displays status information about the current classes, jobs, and printers.


lppasswd

lppasswd adds, changes or deletes passwords in the CUPS digest password file passwd.md5.


cups-config

cups-config is the CUPS program configuration utility.


LPRng-3.8.22

Introduction to LPRng

The LPRng package contains an enhanced, extended and portable implementation of the Berkeley Line PRinter (LPR) print spooler. This is useful for queuing print jobs.


Package information


Installation of LPRng

Install LPRng by running the following commands:

./configure --prefix=/usr --libexecdir=/usr/sbin --sysconfdir=/etc &&
make &&
make install

Command explanations

--libexecdir=/usr/sbin --sysconfdir=/etc: These switches prevent the default use of /usr/libexec and /usr/etc.


Configuring LPRng

Config files

/etc/printcap


Configuration Information

There is no generic printcap for all printers. A sample printcap is loaded into the etc directory which can be some help. Information is also available at http://www.lprng.org and http://www.linuxprinting.org.

The init script installed by LPRng is not consistent with BLFS scripts; therefore, we will create a new one with the following commands:

mv /etc/rc.d/init.d/lpd /etc/rc.d/init.d/lpd.orig &&
cat > /etc/rc.d/init.d/lpd << "EOF"
#!/bin/sh
# Begin $rc_base/init.d/lpd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
                echo "Starting lpd..."
                loadproc /usr/sbin/lpd
                ;;

        stop)
                echo "Stopping lpd..."
                killproc /usr/sbin/lpd
                ;;

        reload)
                echo "Reloading lpd..."
                reloadproc /usr/sbin/lpd
                ;;

        restart)
                $0 stop
                sleep 1
                $0 start
                ;;

        status)
                statusproc /usr/sbin/lpd
                ;;

        *)
                echo "Usage: $0 {start|stop|reload|restart|status}"
                exit 1
                ;;
esac

# End $rc_base/init.d/lpd
EOF
chmod 755 /etc/rc.d/init.d/lpd

Create the symbolic links to the lprng init script in the relevant rc.d directories with the following commands:

cd /etc/rc.d/init.d &&
ln -sf ../init.d/lpd ../rc0.d/K00lprng &&
ln -sf ../init.d/lpd ../rc1.d/K00lprng &&
ln -sf ../init.d/lpd ../rc2.d/S99lprng &&
ln -sf ../init.d/lpd ../rc3.d/S99lprng &&
ln -sf ../init.d/lpd ../rc4.d/S99lprng &&
ln -sf ../init.d/lpd ../rc5.d/S99lprng &&
ln -sf ../init.d/lpd ../rc6.d/K00lprng

Contents

The LPRng package contains lp, lpq, lpr, lprm, lpstat, lpc and lpd.


Description

lp

lp is a symbolic link to lpr.


lpq

lpq is the status monitoring program.


lpr

lpr is the job spooler program.


lprm

lprm is the job removal program.


lpstat

lpstat is the job status program.


lpc

lpc is the control program for the daemon.


lpd

lpd is the daemon.


AFPL Ghostscript-8.11

Introduction to Ghostscript

Ghostscript is a versatile processor for PostScript data with the ability to render PostScript to different targets.


Package information


Ghostscript dependencies


Installation of Ghostscript

Install Ghostscript by running the following commands:

./configure --prefix=/usr --libexecdir=/usr/lib/gs \
    --sysconfdir=/etc/gs --enable-shared --enable-static &&
make &&
make install

To install the shared library libgs.so, run the following commands additionally:

make so &&
make soinstall

Note: The shared library depends on GTK+-1.2.10. It is only used in external programs like GSview-4.4.

To finish the installation, unpack all fonts you've loaded to /usr/share/ghostscript.


Command explanations

--libexecdir=/usr/lib/gs: This switch installs executable libraries of Ghostscript to /usr/lib/gs.

--sysconfdir=/etc/gs: This switch installs configuration data to /etc/gs instead of /usr/etc.


Contents

Ghostscript comes with a lot of filters to render PostScript/PDF files back and forth. Please refer to the HTML documentation or try man gs.


ESP Ghostscript-7.07.1rc2

Introduction to Ghostscript

Ghostscript is a versatile processor for PostScript data with the ability to render PostScript to different targets. ESP Ghostscript is a customized version of GNU Ghostscript that includes an enhanced configuration script, the CUPS raster driver to support CUPS raster printer drivers, and additional patches and drivers from various Linux distributors.


Package information


Installation of Ghostscript

If you want to use OMNI drivers extract the source archive in Ghostscript directory:

tar xzvf ../Omni-0.9.0.tar.gz

Otherwise you must add --without-omni switch to the configure script if you intend to install the shared library.

Install Ghostscript by running the following commands:

./configure --prefix=/usr &&
make &&
make install

To install the shared library libgs.so you will need GTK+-1.2.10. Additionally, if you unpacked the OMNI drivers then you have to install GLib-1.2.10 and create these symlinks:

ln -s glib-1.2/glib.h /usr/include/glib.h &&
ln -s glib-1.2/gmodule.h /usr/include/gmodule.h &&
ln -s ../lib/glib/include/glibconfig.h /usr/include/glibconfig.h

Proceed with the following commands:

patch -Np1 -i ../espgs-7.07.1rc2-gdevpng.patch &&
make so &&
make soinstall

Remove the previously created symlinks since they are not needed any longer:

rm /usr/include/g{lib,module,libconfig}.h

Note: The shared library is only used in external programs like GSview-4.4.

To finish the installation, unpack all fonts you've loaded to /usr/share/ghostscript.


Command explanations

--without-gimp-print: This switch disables the building of the GIMP print driver.

--without-ijs: This switch disables the IJS driver support.


Contents

Ghostscript comes with a lot of filters to render PostScript/PDF files back and forth. Please refer to the HTML documentation or try man gs. ESP Ghostscript provides pstoraster too.


Description

pstoraster

pstoraster allows CUPS to filter output to non-PostScript printers. It is built and installed only if CUPS-1.1.19 is found.


Chapter 46. Scanning

This chapter contains scanning applications which allow us to convert printed documents into formatted documents readable by other applications.


SANE-1.0.12

Introduction to SANE

SANE is short for Scanner Access Now Easy. Scanner access, however, is far from easy, since every vendor has their own protocols. The only known protocol that should bring some unity into this chaos is the TWAIN interface, but this is too imprecise to allow a stable scanning framework. Therefore, SANE comes with its own protocol, so the vendor drivers can't be used.

SANE is split into back ends and front ends. The back ends are drivers for the supported scanners. The front ends are user interfaces to access the backends.


Package information


SANE dependencies


Installation of SANE

Preparing your system for scanner access

To access your scanner, you will probably need the related kernel drivers. A SCSI scanner will need SCSI drivers, a parallel port scanner needs parallel port support (you should use enhanced EPP modes) and an USB scanner will need the USB scanner module and a SCSI system for emulation. Be sure that you have got the necessary devices to access the drivers.


Installation of SANE backends

Install SANE backends by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Installation of SANE front ends

To install SANE front ends, use the following commands:

./configure --prefix=/usr &&
make &&
make install

Installation command explanations

--prefix=/usr: This switch installs all software in directories relative to /usr.


Contents

Back ends:

See http://www.mostang.com/sane/sane-supported-devices.html for a list of available backends.


Front ends:

scanimage: Command line interface for scanning.

xscanimage: Graphical user interface for scanning.

gimp-plugin: xscanimage as GIMP plugin.


XSane-0.91

Introduction to XSane

XSane is another front end for SANE-1.0.12. It has additional features to improve the image quality compared to xscanimage.


Package information


Installation of XSane

Install XSane by running the following commands:

./configure --prefix=/usr &&
make &&
make install

Installation command explanations

--prefix=/usr: This switch installs all software in directories relative to /usr.


Contents

XSane comes with a graphical user interface, and (if GIMP-1.2.5 is available) a GIMP plugin with advanced features. Please refer to the documentation for further support.


GOCR-0.37

Introduction to GOCR

The GOCR contains a small OCR (Object Character Recognition) program. It is useful for reading text from a graphical input file. It works without training, but you'll need a high quality scan to get a good results.

GOCR can used as a console utility, but there is an GTK front end in the source package, also.


Package information


GOCR dependencies

Optional

TeX-2.0.2 or fig2dev (for examples), XFree86-4.3.0.1 and GTK+-1.2.10 (for front end only)


Installation of GOCR

Install GOCR by running the following commands:

./configure --prefix=/usr &&
make &&
make install

To install the GTK front end, use the following commands:

cd frontend/gnome &&
./configure --prefix=/usr &&
make &&
make install

To install the help:

make help

To install the documentation:

make doc

To run tests on GOCR:

make examples

Contents

The GOCR package contains gocr and gtk-ocr.


Description

gocr

gocr is a program that prints all text it can read from any graphical input file to stdout.


gtk-ocr

gtk-ocr is the GTK front end for gocr.


Chapter 47. Standard Generalized Markup Language (SGML)

This chapter contains DocBook SGML document type definitions (DTDs), DocBook DSSSL Stylesheets and DocBook tools to validate, transform, format and publish DocBook documents.


SGML Common-0.6.3

Introduction to SGML Common

The SGML Common package contains install-catalog. This is useful for creating and maintaining centralized SGML catalogs.


Package information


Installation of SGML Common

Install SGML Common by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man &&
make &&
make install &&
install-catalog --add /etc/sgml/sgml-ent.cat \
/usr/share/sgml/sgml-iso-entities-8879.1986/catalog &&
install-catalog --add /etc/sgml/sgml-docbook.cat \
/etc/sgml/sgml-ent.cat

Update hint: Remove the above catalog items prior to upgrading with:
install-catalog --remove /etc/sgml/sgml-ent.cat \
/usr/share/sgml/sgml-iso-entities-8879.1986/catalog &&
install-catalog --remove /etc/sgml/sgml-docbook.cat \
/etc/sgml/sgml-ent.cat


Configuring SGML-common

Config files

/etc/sgml/sgml.conf


Configuration Information

No change in this file is necessary.


Contents

The SGML Common package contains install-catalog, sgmlwhich, SGML entities files and XML entities files.


Description

install-catalog

install-catalog creates a centralized catalog that maintains references to catalogs scattered throughout the /usr/share/sgml directory tree.


sgmlwhich

sgmlwhich will print to standard output the name of the main configuration file.


SGML entities files

SGML entities files contain the basic character entities defined with SDATA entries.


XML entities files

XML entities files contain the basic character entities defined by a hexadecimal representation of the Unicode character number.


DocBook SGML DTD-3.1

Introduction to DocBook SGML DTD

The DocBook SGML DTD package contains document type definitions for verification of SGML data files against the DocBook rule set. These are useful for structuring books and software documentation to a standard allowing you to utilize transformations already written for that standard.


Package information


DocBook SGML DTD dependencies


Installation of DocBook SGML DTD

Install DocBook SGML DTD by running the following commands:

cp docbook.cat docbook.cat.orig &&
sed -e '/ISO 8879/d' docbook.cat.orig > docbook.cat &&
cp docbook.cat docbook.cat.orig &&
sed -e '/gml/d' docbook.cat.orig > docbook.cat &&
cp docbook.cat docbook.cat.orig &&
sed -e 's|DTDDECL "-//OASIS//DTD DocBook V3.1//EN"|SGMLDECL|g' \
docbook.cat.orig > docbook.cat &&
install -d /usr/share/sgml/docbook/sgml-dtd-3.1 &&
chown -R root:root . &&
chmod -R 755 . &&
install docbook.cat /usr/share/sgml/docbook/sgml-dtd-3.1/catalog &&
cp -af *.dtd *.mod *.dcl /usr/share/sgml/docbook/sgml-dtd-3.1 &&
install-catalog --add /etc/sgml/sgml-docbook-dtd-3.1.cat \
/usr/share/sgml/docbook/sgml-dtd-3.1/catalog &&
install-catalog --add /etc/sgml/sgml-docbook-dtd-3.1.cat \
/etc/sgml/sgml-docbook.cat

Command explanations

cp docbook.cat docbook.cat.orig
sed -e '/ISO 8879/d' docbook.cat.orig > docbook.cat
cp docbook.cat docbook.cat.orig
sed -e '/gml/d' docbook.cat.orig > docbook.cat
These commands remove the ENT definitions from the catalog file.

cp docbook.cat docbook.cat.orig
sed -e 's|DTDDECL "-//OASIS//DTD Docbook V3.1//EN"|SGMLDECL|g' \
docbook.cat.orig > docbook.cat
This command replaces the DTDDECL catalog entry, which is not supported by Linux SGML tools, with the SGMLDECL catalog entry.


Configuring DocBook SGML DTD

Config files

/etc/sgml/catalog


Configuration Information

The above installation script updates the catalog.

Using only the most current 3.x version of DocBook SGML DTD requires the following:

cat >>
/usr/share/sgml/docbook/sgml-dtd-3.1/catalog << "EOF"
  -- Begin Single Major Version catalog changes --

PUBLIC "-//Davenport//DTD DocBook V3.0//EN" "docbook.dtd"

  -- End Single Major Version catalog changes --
EOF

Contents

The DocBook SGML DTD package contains DTD files and MOD files.


Description

DTD files

DTD files contain a document type definition which defines the element types and the attribute lists that can be used in the corresponding SGML files.


MOD files

MOD files contain components of the document type definition that are sourced into the DTD files.


DocBook SGML DTD-4.2

Introduction to DocBook SGML DTD

The DocBook SGML DTD package contains document type definitions for verification of SGML data files against the DocBook rule set. These are useful for structuring books and software documentation to a standard allowing you to utilize transformations already written for that standard.


Package information


DocBook SGML DTD dependencies


Installation of DocBook SGML DTD

Install DocBook SGML DTD by running the following commands:

cp docbook.cat docbook.cat.orig &&
sed -e '/ISO 8879/d' docbook.cat.orig > docbook.cat &&
cp docbook.cat docbook.cat.orig &&
sed -e '/gml/d' docbook.cat.orig > docbook.cat &&
install -d /usr/share/sgml/docbook/sgml-dtd-4.2 &&
chown -R root:root . &&
chmod -R 755 . &&
install docbook.cat /usr/share/sgml/docbook/sgml-dtd-4.2/catalog &&
cp -af *.dtd *.mod *.dcl /usr/share/sgml/docbook/sgml-dtd-4.2 &&
install-catalog --add /etc/sgml/sgml-docbook-dtd-4.2.cat \
/usr/share/sgml/docbook/sgml-dtd-4.2/catalog &&
install-catalog --add /etc/sgml/sgml-docbook-dtd-4.2.cat \
/etc/sgml/sgml-docbook.cat

Command explanations

cp docbook.cat docbook.cat.orig
sed -e '/ISO 8879/d' docbook.cat.orig > docbook.cat
cp docbook.cat docbook.cat.orig
sed -e '/gml/d' docbook.cat.orig > docbook.cat
These commands remove the ENT definitions from the catalog file.


Configuring DocBook SGML DTD

Config files

/etc/sgml/catalog


Configuration Information

The above installation script updates the catalog.

Using only the most current 4.x version of DocBook SGML DTD requires the following:

cat >> /usr/share/sgml/docbook/sgml-dtd-4.2/catalog << "EOF"
  -- Begin Single Major Version catalog changes --

PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "docbook.dtd"
PUBLIC "-//OASIS//DTD DocBook V4.0//EN" "docbook.dtd"

  -- End Single Major Version catalog changes --
EOF

Contents

The DocBook SGML DTD package contains DTD files and MOD files.


Description

DTD files

DTD files contain a document type definition which defines the element types and the attribute lists that can be used in the corresponding SGML files.


MOD files

MOD files contain components of the document type definition that are sourced into the DTD files.


OpenSP-1.5

Introduction to OpenSP

The OpenSP package contains a C++ Library for using SGML/XML files. This is useful for validating, parsing and manipulating SGML and XML documents.


Package information


OpenSP dependencies


Installation of OpenSP

This patch removes some annoying messages that can appear while running openjade.

patch -Np1 -i ../OpenSP-1.5-LITLEN.patch
patch -Np1 -i ../OpenSP-1.5-gcc33-1.patch

Install OpenSP by running the following commands:

./configure --prefix=/usr --disable-static --enable-http \
--enable-default-catalog=/etc/sgml/catalog \
--enable-default-search-path=/usr/share/sgml &&
make pkgdatadir=/usr/share/sgml/OpenSP-1.5 &&
make pkgdatadir=/usr/share/sgml/OpenSP-1.5 install &&
ln -sf onsgmls /usr/bin/nsgmls &&
ln -sf osgmlnorm /usr/bin/sgmlnorm &&
ln -sf ospam /usr/bin/spam &&
ln -sf ospcat /usr/bin/spcat &&
ln -sf ospent /usr/bin/spent &&
ln -sf osx /usr/bin/sx &&
ln -sf osx /usr/bin/sgml2xml &&
ln -sf libosp.so /usr/lib/libsp.so &&
install-catalog --add /etc/sgml/OpenSP-1.5.cat \
/usr/share/sgml/OpenSP-1.5/catalog &&
install-catalog --add /etc/sgml/sgml-docbook.cat \
/etc/sgml/OpenSP-1.5.cat

Update hint: Remove the above catalog items prior to upgrading with:
install-catalog --remove
/etc/sgml/OpenSP-[version].cat \
/usr/share/sgml/OpenSP-[version]/catalog &&
install-catalog --remove /etc/sgml/sgml-docbook.cat \
/etc/sgml/OpenSP-[version].cat


Command explanations

--disable-static: This switch prevents the building of the static library.

--enable-http: This switch adds support for HTTP.

--enable-default-catalog=/etc/sgml/catalog: This switch sets the path to our centralized catalog.

--enable-default-search-path: This switch sets the default value of SGML_SEARCH_PATH.

--enable-xml-messages: This switch adds support for XML Formatted Messages.

make pkgdatadir=/usr/share/sgml/OpenSP-1.5: This sets the pkgdatadir variable in the Makefile from /usr/share/OpenSP to /usr/share/sgml/OpenSP-1.5.

ln -sf onsgmls /usr/bin/nsgmls
ln -sf osgmlnorm /usr/bin/sgmlnorm
ln -sf ospam /usr/bin/spam
ln -sf ospcat /usr/bin/spcat
ln -sf ospent /usr/bin/spent
ln -sf osx /usr/bin/sx
ln -sf osx /usr/bin/sgml2xml
ln -sf libosp.so /usr/lib/libsp.so
These commands create the SP equivalents of OpenSP executables and libraries.


Contents

The OpenSP package contains onsgmls, ospam, osx, ospcat and ospent.


Description

onsgmls

onsgmls process SGML files.


ospam

ospam is a markup stream editor.


osx

osx is a SGML normalizer or a converter of SGML to XML.


ospcat

ospcat prints effective system identifiers found in the catalogs.


ospent

ospent provides access to OpenSP's entity manager.


OpenJade-1.3.2

Introduction to OpenJade

The OpenJade package contains a DSSSL engine. This is useful for SGML and XML transformations into RTF, TeX, SGML and XML.


Package information


OpenJade dependencies

Required

OpenSP-1.5


Installation of OpenJade

Install OpenJade by running the following commands:

./configure --prefix=/usr --enable-http --disable-static \
--enable-default-catalog=/etc/sgml/catalog \
--enable-default-search-path=/usr/share/sgml \
--datadir=/usr/share/sgml/openjade-1.3.2 &&
make &&
make install &&
ln -sf openjade /usr/bin/jade &&
ln -sf libogrove.so /usr/lib/libgrove.so &&
ln -sf libospgrove.so /usr/lib/libspgrove.so &&
ln -sf libostyle.so /usr/lib/libstyle.so &&
install -m644 dsssl/catalog /usr/share/sgml/openjade-1.3.2/ &&
install -m644 dsssl/*.dtd dsssl/*.dsl dsssl/*.sgm \
/usr/share/sgml/openjade-1.3.2 &&
install-catalog --add /etc/sgml/openjade-1.3.2.cat \
/usr/share/sgml/openjade-1.3.2/catalog &&
install-catalog --add /etc/sgml/sgml-docbook.cat /etc/sgml/openjade-1.3.2.cat

Command explanations

--disable-static: This switch prevents the building of the static library.

--enable-http: This switch adds support for HTTP.

--enable-default-catalog=/etc/sgml/catalog: This switch sets the path to our centralized catalog.

--enable-default-search-path: This switch sets the default value of SGML_SEARCH_PATH.

--datadir=/usr/share/sgml/openjade-1.3.2: This switch puts data files in /usr/share/sgml/openjade-1.3.2 instead of /usr/share.

ln -sf openjade /usr/bin/jade
ln -sf libogrove.so /usr/lib/libgrove.so
ln -sf libospgrove.so /usr/lib/libspgrove.so
ln -sf libostyle.so /usr/lib/libstyle.so
These commands create the Jade equivlents of OpenJade executables and libraries.


Configuring OpenJade

Configuration Information

echo "SYSTEM \"/usr/share/docbook/docbookx.dtd\" \
\"/usr/share/xml/docbook/xml-dtd-4.2/docbookx.dtd\"" >> \
/usr/share/sgml/openjade-1.3.2/catalog

This configuration is only necessary if you intend to use OpenJade to process the BLFS XML files through DSSSL Stylesheets.


Contents

The OpenJade package contains openjade.


Description

openjade

openjade is a DSSSL engine used for transformations.


DocBook DSSSL Stylesheets-1.78

Introduction to DocBook DSSSL Stylesheets

The DocBook DSSSL Stylesheets package contains DSSSL stylesheets. These are used by OpenJade or other tools to transform SGML and XML DocBook files.


Package information


DocBook DSSSL Stylesheets dependencies


Installation of DocBook DSSSL Stylesheets

Install DocBook DSSSL Stylesheets by running the following commands:

mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/dtds/decls &&
mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/lib &&
mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/common &&
mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/html &&
mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/print &&
mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/test &&
mkdir -p /usr/share/sgml/docbook/dsssl-stylesheets-1.78/images &&
install bin/collateindex.pl /usr/bin &&
cp catalog VERSION /usr/share/sgml/docbook/dsssl-stylesheets-1.78 &&
cp dtds/decls/*.dcl \
/usr/share/sgml/docbook/dsssl-stylesheets-1.78/dtds/decls &&
cp lib/dblib.dsl /usr/share/sgml/docbook/dsssl-stylesheets-1.78/lib &&
cp common/*.dsl /usr/share/sgml/docbook/dsssl-stylesheets-1.78/common &&
cp common/*.ent /usr/share/sgml/docbook/dsssl-stylesheets-1.78/common &&
cp html/*.dsl /usr/share/sgml/docbook/dsssl-stylesheets-1.78/html &&
cp lib/*.dsl /usr/share/sgml/docbook/dsssl-stylesheets-1.78/lib &&
cp print/*.dsl /usr/share/sgml/docbook/dsssl-stylesheets-1.78/print &&
cp images/*.gif /usr/share/sgml/docbook/dsssl-stylesheets-1.78/images &&
install-catalog --add /etc/sgml/dsssl-docbook-stylesheets.cat \
/usr/share/sgml/docbook/dsssl-stylesheets-1.78/catalog &&
install-catalog --add /etc/sgml/sgml-docbook.cat \
/etc/sgml/dsssl-docbook-stylesheets.cat

Command explanations

These commands create a make install script for this package.


Configuring DocBook DSSSL Stylesheets

Configuration Information

The following configuration is necessary in order to utilize OpenJade to convert the BLFS Book from XML to HTML:
ln -sf {your home directory}/BLFS/BOOK/blfs.dsl \
/usr/share/sgml/docbook/dsssl-stylesheets-1.78/html/

If you would like to test Docbook XML DTD, DocBook DSSSL Stylesheets and OpenJade against the BLFS book, use the following command. The commands are written for a CVS checkout to your home directory with output going to the present working directory, so make any necessary modifications for your setup.
mkdir introduction postlfs general connect basicnet server \
content x kde gnome xsoft multimedia pst preface appendices other &&
openjade -t sgml \
-d /usr/share/sgml/docbook/dsssl-stylesheets-1.78/html/blfs.dsl \
/usr/share/sgml/docbook/dsssl-stylesheets-1.78/dtds/decls/xml.dcl \
~/BLFS/BOOK/index.xml
If successful you should have a HTML BLFS book in exactly the same format as presented on the web page.


Contents

The DocBook DSSSL Stylesheets package contains DSSSL stylesheets and collateindex.pl.


Description

collateindex.pl

collateindex.pl is a Perl script that creates a DocBook index from raw index data.


Chapter 48. Extensible Markup Language (XML)

This chapter contains the DocBook XML document type definition (DTD) and DocBook Stylesheets which are used to validate, transform, format and publish DocBook documents.


DocBook XML DTD-4.2

Introduction to DocBook XML DTD

The DocBook XML DTD-4.2 package contains document type definitions for verification of XML data files against the DocBook rule set. These are useful for structuring books and software documentation to a standard allowing you to utilize transformations already written for that standard.


Package information


DocBook XML DTD 4.2 dependencies


Installation of DocBook XML DTD

Install DocBook XML DTD by running the following commands:

install -d /usr/share/xml/docbook/xml-dtd-4.2 &&
cp -af docbook.cat *.dtd ent/ *.mod /usr/share/xml/docbook/xml-dtd-4.2 &&
if [ ! -e /etc/xml/catalog ]; then mkdir -p /etc/xml; xmlcatalog --noout \
--create /etc/xml/catalog; fi &&
if [ ! -e /etc/xml/docbook ]; then xmlcatalog --noout --create \
/etc/xml/docbook; fi &&
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Information Pool V4.2//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/dbpoolx.mod" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.2//EN" \
"http://oasis-open.org/docbook/xml/4.2/docbookx.dtd" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Character Entities V4.2//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/dbcentx.mod" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Notations V4.2//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/dbnotnx.mod" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//ENTITIES DocBook XML Additional General Entities V4.2//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/dbgenent.mod" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.2//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/dbhierx.mod" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//DTD XML Exchange Table Model 19990315//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/soextblx.dtd" \
/etc/xml/docbook &&
xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML CALS Table Model V4.2//EN" \
"file:///usr/share/xml/docbook/xml-dtd-4.2/calstblx.dtd" \
/etc/xml/docbook &&
xmlcatalog --noout --add "rewriteSystem" \
"http://www.oasis-open.org/docbook/xml/4.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
/etc/xml/docbook &&
xmlcatalog --noout --add "rewriteURI" \
"http://www.oasis-open.org/docbook/xml/4.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
/etc/xml/docbook &&
xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//ENTITIES DocBook XML" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "delegatePublic" \
"-//OASIS//DTD DocBook XML" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "delegateSystem" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "delegateURI" \
"http://www.oasis-open.org/docbook/" \
"file:///etc/xml/docbook" /etc/xml/catalog

Configuring DocBook XML DTD

Config files

/etc/xml/catalog, /etc/xml/docbook


Configuration Information

The above installation script creates the files and updates the catalog. We need to make additional entries in order to process the BLFS book:

xmlcatalog --noout --add "delegateSystem" \
"/usr/share/docbook/" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "delegateURI" \
"/usr/share/docbook/" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "rewriteSystem" \
"/usr/share/docbook" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
/etc/xml/docbook &&
xmlcatalog --noout --add "rewriteURI" \
"/usr/share/docbook" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
/etc/xml/docbook

In order to install ScrollKeeper or to utilize DocBook XML DTD V4.2 when V4.1.2 is requested in the System Identifier, make the following entry:

xmlcatalog --noout --add "public" \
"-//OASIS//DTD DocBook XML V4.1.2//EN" \
"http://oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" \
/etc/xml/docbook &&
xmlcatalog --noout --add "delegateSystem" \
"http://oasis-open.org/docbook/xml/4.1.2/" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "delegateURI" \
"http://oasis-open.org/docbook/xml/4.1.2/" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "rewriteSystem" \
"http://oasis-open.org/docbook/xml/4.1.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
/etc/xml/docbook &&
xmlcatalog --noout --add "rewriteURI" \
"http://oasis-open.org/docbook/xml/4.1.2" \
"file:///usr/share/xml/docbook/xml-dtd-4.2" \
/etc/xml/docbook

Contents

The DocBook XML DTD package contains DTD files, MOD files and ENT files.


Description

DTD files

DTD files contain a document type definition which defines the element types and the attribute lists that can be used in the corresponding XML files.


MOD files

MOD files contain components of the document type definition that are sourced into the DTD files.


ENT files

ENT files contain lists of named character entities allowed in HTML.


DocBook XSL Stylesheets-1.62.4

Introduction to DocBook XSL Stylesheets

The DocBook XSL Stylesheets package contains XSL stylesheets. These are useful for performing transformations on XML DocBook files.


Package information


DocBook XSL Stylesheets dependencies


Installation of DocBook XSL Stylesheets

Install DocBook XSL Stylesheets by running the following commands:

install -d /usr/share/xml/docbook/xsl-stylesheets-1.62.4 &&
cp -af VERSION common extensions fo html htmlhelp images javahelp lib \
manpages params profiling template tools xhtml \
/usr/share/xml/docbook/xsl-stylesheets-1.62.4 &&
install -d /usr/share/doc/xml &&
cp -af doc/* /usr/share/doc/xml &&
if [ ! -f /etc/xml/catalog ]; then mkdir -p /etc/xml; xmlcatalog --noout \
--create /etc/xml/catalog; fi &&
if [ ! -e /etc/xml/docbook ]; then xmlcatalog --noout --create \
/etc/xml/docbook; fi &&
xmlcatalog --noout --add "rewriteSystem" \
"http://docbook.sourceforge.net/release/xsl/1.45" \
"/usr/share/xml/docbook/xsl-stylesheets-1.62.4" /etc/xml/catalog &&
xmlcatalog --noout --add "rewriteURI" \
"http://docbook.sourceforge.net/release/xsl/1.45" \
"/usr/share/xml/docbook/xsl-stylesheets-1.62.4" /etc/xml/catalog &&
xmlcatalog --noout --add "rewriteSystem" \
"http://docbook.sourceforge.net/release/xsl/current" \
"/usr/share/xml/docbook/xsl-stylesheets-1.62.4" /etc/xml/catalog &&
xmlcatalog --noout --add "rewriteURI" \
"http://docbook.sourceforge.net/release/xsl/current" \
"/usr/share/xml/docbook/xsl-stylesheets-1.62.4" /etc/xml/catalog &&
xmlcatalog --noout --add "delegateSystem" \
"http://docbook.sourceforge.net/release/xsl/" \
"file:///etc/xml/docbook" /etc/xml/catalog &&
xmlcatalog --noout --add "delegateURI" \
"http://docbook.sourceforge.net/release/xsl/" \
"file:///etc/xml/docbook" /etc/xml/catalog

Configuring DocBook XSL Stylesheets

Config files

/etc/xml/catalog


Configuration Information

The above installation script creates the files and updates the catalog.

If you would like to test DocBook XML DTD and DocBook XSL Stylesheets against the BLFS book, use the following command. The command is written for a CVS checkout to your home directory with output going to the present working directory, so make any necessary modifications for your setup.
xsltproc --nonet -o index.html \
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
~/BLFS/BOOK/index.xml
If successful you should have a index.html file that will display the BLFS Book in a browser on a single page. It will be formatted by the XSL Stylesheets, so it will not match the web published BLFS book, which is formatted by DocBook DSSSL Stylesheets.


Contents

The DocBook XSL Stylesheets package contains XSL style sheets for HTML and FO.


Chapter 49. PostScript

This chapter includes applications that create, manipulate or view PostScript files and view Portable Document Format PDF files.


a2ps-4.13b

Introduction to a2ps

a2ps is a filter utilitized mainly in the background and primarily by printing scripts to convert almost every input format into PostScript output. The application's name expands appropriately to "all to PostScript".


Package information


Additional download


Installation of a2ps

Install a2ps by running the following commands:

cd contrib &&
cp Makefile.in Makefile.in.orig &&
sed -e "s:emacs::" Makefile.in.orig > Makefile.in &&
cd .. &&
cp configure{,.orig} &&
sed -e 's|/usr/local/share/ghostscript|/usr/share/ghostscript|g' \
    configure.orig > configure
./configure --prefix=/usr \
    --sysconfdir=/etc/a2ps --localstatedir=/var \
    --with-medium=letter &&
make &&
make install

Command explanations

cd contrib &&
cp Makefile.in Makefile.in.orig &&
sed -e "s:emacs::" Makefile.in.orig > Makefile.in &&
cd .. &&
These commands eliminate the compiling and installing of the Emacs script files. If you have substituted Emacs for Vi as your primary editor, you would want to skip these instructions.

cp configure{,.orig} &&
sed -e 's|/usr/local/share/ghostscript|/usr/share/ghostscript|g' \
    configure.orig > configure
This command modifies the configure script to search for Ghostscript fonts at the location where they were installed by the BLFS instructions.

--sysconfdir=/etc/a2ps: Configuration data goes to /etc/a2ps instead of /usr/etc.

--with-medium=letter: This switch changes the default paper format of A4 to letter. Installations that utilize A4 would eliminate this switch.


Configuring a2ps

Config files

/etc/a2ps/a2ps.cfg, /etc/a2ps/a2ps-site.cfg


Configuration Information

Information about configuring a2ps can be found in the comments contained in the above files, and also by running info a2ps.


Contents

The a2ps package contains a2ps and filter data.


Description

a2ps

a2ps is a filter, utilized primarily by printing scripts, that converts standard input or supported files to PostScript.


enscript-1.6.1

Introduction to enscript

Enscript converts ASCII files to PostScript.


Package information


Installation of enscript

Install enscript by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc/enscript \
--localstatedir=/var --with-media=letter &&
make &&
make install

Note: Remove --with-media=letter to the configure options if your medium format is A4.


Installation command explanations

--sysconfdir=/etc/enscript: This switch puts configuration data in /etc/enscript instead of /usr/etc.

--localstatedir=/var: This switch sets the directory for runtime data to /var instead of /usr/var.


Contents

The enscript package contains enscript and filter data.


Description

enscript

enscript is a filter, used primarily by printing scripts, that converts ASCII files to PostScript.


PSUtils-p17

Introduction to PSUtils

PSUtils is a set of utilities to manipulate PostScript files.


Package information


Installation of PSUtils

Install PSUtils by running the following commands:

cat Makefile.unix | sed -e 's/\/usr\/local/\/usr/g' > Makefile &&
make &&
make install

Installation command explanations

cat ... | sed ...: This command creates a Makefile that installs the program to the /usr prefix instead of the /usr/local prefix.


Contents

The PSUtils package contains psbook, psselect, pstops psnup, psresize, epsffit, getafm, showchar, fixdlsrps, fixfmps, fixmacps, fixpsditps , fixpspps, fixscribeps, fixtpps, fixwfwps, fixwpps, fixwwps, extractres , includeres, psmerge.


Description

psbook

psbook rearranges pages into signatures.


psselect

psselect selects pages and page ranges.


pstops

pstops performs general page rearrangements and selection.


psnup

psnup puts multiple pages per physical sheet of paper


psresize

psresize alters the document paper size.


epsffit

epsffit fits an EPSF file to a given bounding box


scripts

The remaining commands are scripts that perform specific functions described in their respective man pages.


GSview-4.4

Introduction to GSview

GSview is a viewer for PostScript and PDF using X.


Package information


GSview dependencies

Required

GTK+-1.2.10 and AFPL Ghostscript-8.11 or ESP Ghostscript-7.07.1rc2 (with libgs.so installed)


Installation of GSview

GSview uses netscape to browse through the online help. BLFS does not install Netscape, but has other browsers from which to choose. Simply edit srcunx/gvxreg.c using the following sed script with your browsers executable file name substituting for [browser]:

mv srcunx/gvxreg.c srcunx/gvxreg.old &&
cat srcunx/gvxreg.old | sed s/netscape/[browser]/ > srcunx/gvxreg.c

Install GSview by running the following commands:

patch -Np1 -i ../gsview-4.4-gvx.patch &&
sed 's|GSVIEW_ROOT=/usr/local|GSVIEW_ROOT=/usr|' \
  srcunx/unx.mak >  Makefile &&
make &&
make install

Command explanations

sed 's|GSVIEW_ROOT=/usr/local|GSVIEW_ROOT=/usr|': This command changes the default installation directory to /usr.


Configuring GSview

Config files

/etc/gsview/*


Contents

The GSview package contains epstool , gsview and gsview-help.


Description

epstool

epstool is a tool for extracting preview bitmaps in EPS files.


gsview

gsview is a viewer for PostScript (PS) and PDF files.


gsview-help

gsview-help is a script for displaying help files in your chosen browser.


Xpdf-2.02pl1

Introduction to Xpdf

Xpdf is a viewer for Adobe's free Portable Document Format (PDF) which is both fast and small and comes with some useful command-line utilities.


Package information


Xpdf dependencies


Optional

Installed fonts: AFPL Ghostscript-8.11, FreeType-2.1.5, t1lib and TrueType


Installation of Xpdf

Install Xpdf by running the following commands:

./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man  \
    --with-freetype2-includes=/usr/include/freetype2 \
    --with-freetype2-library=/usr/lib \
    --with-appdef-dir=/usr/X11R6/lib/X11/app-defaults/ &&
make &&
make install

Installation command explanations

--enable-a4-paper: This switch must be added to set DIN A4 as the standard paper format.


Configuring Xpdf

In the etc directory you will find a sample xpdfrc that can be either copied to ~/.xpdfrc or taken as example to write your own configuration file.


Example .xpdfrc

# Example .xpdfrc
displayFontT1 Times-Roman	     /usr/share/ghostscript/fonts/n021003l.pfb
displayFontT1 Times-Italic	     /usr/share/ghostscript/fonts/n021023l.pfb
displayFontT1 Times-Bold	     /usr/share/ghostscript/fonts/n021004l.pfb
displayFontT1 Times-BoldItalic	     /usr/share/ghostscript/fonts/n021024l.pfb
displayFontT1 Helvetica		     /usr/share/ghostscript/fonts/n019003l.pfb
displayFontT1 Helvetica-Oblique	     /usr/share/ghostscript/fonts/n019023l.pfb
displayFontT1 Helvetica-Bold	     /usr/share/ghostscript/fonts/n019004l.pfb
displayFontT1 Helvetica-BoldOblique  /usr/share/ghostscript/fonts/n019024l.pfb
displayFontT1 Courier		     /usr/share/ghostscript/fonts/n022003l.pfb
displayFontT1 Courier-Oblique	     /usr/share/ghostscript/fonts/n022023l.pfb
displayFontT1 Courier-Bold	     /usr/share/ghostscript/fonts/n022004l.pfb
displayFontT1 Courier-BoldOblique    /usr/share/ghostscript/fonts/n022024l.pfb
displayFontT1 Symbol		     /usr/share/ghostscript/fonts/s050000l.pfb
displayFontT1 ZapfDingbats	     /usr/share/ghostscript/fonts/d050000l.pfb

fontDir		/usr/X11R6/lib/X11/fonts/truetype

psFile			"|lpr"
psPaperSize		letter
textEOL		unix

t1libControl		low
freetypeControl		low

urlCommand	"links -g %s"

Contents

The Xpdf package contains xpdf, pdftops, pdftotext, pdftopbm.


Description

xpdf

xpdf displays files in PDF.


pdftops

pdftops converts PDF files to PostScript (PS) format.


pdftotext

pdftotext parses ASCII text from PDF files.


pdftopbm

pdftopbm converts PDF files to PBM (Portable BitMap) format.


Other PostScript programs

KGhostview is a Qt based newsreader program from kdegraphics-3.1.4.


Chapter 50. Typesetting

This chapter includes applications that create output equivalent to typesetting.


TeX-2.0.2

Introduction to TeX

TeX is a typesetting package, able to create documents in a variety of formats. The optional texmfsrc TAR ball contains source code for packages that are contained in the texmf TAR ball, including the docstrip sources.


Installation of TeX

TeX is installed from the source directory (usually /usr/src) and untarring instructions are included below instead of the usual assumption that you have already untarred the package. The source directory should contain the two required packages and the optional package, if desired.

Install TeX by running the following commands:

mkdir -p /usr/share/texmf &&
tar zxvf tetex-src-2.0.2.tar.gz &&
cd tetex-src-2.0.2 &&
gzip -dc ../tetex-texmf-2.0.2.tar.gz \
      | (umask 0; cd /usr/share/texmf; tar xvf -)

If the optional texmf source code TAR ball was downloaded, untar it now:

gzip -dc ../tetex-texmfsrc-2.0.2.tar.gz \
      | (umask 0; cd /usr/share/texmf; tar xvf -)
./configure --with-x=no --prefix=/usr \
    --without-texinfo   --with-system-ncurses --with-system-zlib \
    --exec-prefix=/usr --bindir=/usr/bin &&
make world &&
texconfig dvips paper letter &&
texconfig font rw

Installation command explanations

gzip -dc ../teTeX-texmf-2.0.2.tar.gz \
        | (umask 0; cd /usr/share/texmf; tar xvf -)
Untar the TeX fonts and macro libraries.

--with-x=no: This switch will avoid any XFree86 dependencies. TeX can be compiled with XFree86 support, notably for xdvi. If this is desired, remove this configure option.

--exec-prefix=/usr --bindir=/usr/bin: This switch will insure that TeX binaries will be installed in /usr/bin.

--without-texinfo: A default LFS installation already has the texinfo package installed; we will avoid overwriting it with the included texinfo package.

--with-system-ncurses: This switch specifies using the already installed libncurses library.

--with-system-zlib: LFS Systems starting with version 4.0 have zlib installed as part of the base operating system; we can avoid building it here.

texconfig dvips paper letter: This command sets the default paper size for TeX.

texconfig font rw: This command specifies writable fonts.


Contents

The TeX package contains 125 separate binaries. Please refer to file:///usr/share/texmf/doc/index.html for details, as well as a tour of the expansive TeX documentation.


Appendix A. List of rc?.d symlinks used in LFS/BLFS

This section lists all of the symlinks used by the lfs-bootscripts package (correct as of version 1.9) and all of the scripts in the BLFS book. This is for two reasons: first, so that you can see at a glance which number we have used for each package, and second so that we can see which number we have used for each package! Without this, it would make our lives more difficult (as we'd probably end up with conflicts).

It should go without saying that this is not the only (or some would argue even optimal) setup for the symlinks. In the LFS tradition, you should find what suits you and use that; our recommendations are only a template.


rc0.d

Table A-1. rc0.d symlinks

NumberTitleLinkExplanation
K00cups../init.d/cupsShut down Common Unix printing system: CUPS-1.1.19
K00lprng../init.d/lprngShut down LPR print spooler: LPRng-3.8.22
K05gdm../init.d/gdmShut down GNOME display manager Daemon: GDM-2.4.1.4
K08fcron../init.d/fcronShut down Cron Daemon: Fcron-2.9.3
K10gpm../init.d/gpmShut down General Purpose Mouse Daemon: GPM-1.20.1
K25postfix../init.d/postfixShut down Postfix MTA: Postfix-2.0.16
K26mysql../init.d/mysqlShut down MySQL Daemon: MySQL-4.0.15
K26postgresql../init.d/postgresqlShut down PostgreSQL Daemon: PostgreSQL-7.3.4
K28apache../init.d/apacheShut down Apache Daemon: Apache-2.0.47
K30sshd../init.d/sshdShut down Secure Shell Daemon: OpenSSH-3.7.1p2
K35alsa../init.d/alsaSave volume settings: ALSA-0.9.6
K40sysklogd../init.d/sysklogdStop system and kernel logging: Part of LFS base.
K45random../init.d/randomSave random seed: random
K48samba../init.d/sambaStop network file system: Samba-2.2.8a
K48NFS../init.d/nfsStop network file system:
K49adsl../init.d/adslStops the ADSL client: RP-PPPoE-3.5
K49portmap../init.d/portmapStop Forwarding RPC requests: portmap-5
K49xinetd../init.d/xinetdStop Internet services daemon: xinetd-2.3.12
K49bind../init.d/bindStop named services daemon (DNS): BIND-9.2.2
K50sendsignals../init.d/sendsignalsKill processes: Part of LFS base.
K59firewall../init.d/firewallUnset firewall settings: Firewalling
K60mountfs../init.d/mountfsUnmount all file systems: Part of LFS base.
K70swap../init.d/swapTurn off swap: Part of LFS base.
K80network../init.d/networkShut down networking: Part of LFS base.
K90localnet../init.d/localnetRemove loopback interface: Part of LFS base.
K99halt../init.d/haltShut down system: Part of LFS base.

rc1.d

Table A-2. rc1.d symlinks

NumberTitleLinkExplanation
K00lprng../init.d/lprngShut down LPR print spooler: LPRng-3.8.22
K05gdm../init.d/gdmShut down GNOME display manager Daemon: GDM-2.4.1.4
K10gpm../init.d/gpmShut down General Purpose Mouse Daemon: GPM-1.20.1
K25postfix../init.d/postfixShut down Postfix MTA: Postfix-2.0.16
K26mysql../init.d/mysqlShut down MySQL Daemon: MySQL-4.0.15
K26postgresql../init.d/postgresqlShut down PostgreSQL Daemon: PostgreSQL-7.3.4
K28apache../init.d/apacheShut down Apache Daemon: Apache-2.0.47
K30sshd../init.d/sshdShut down Secure Shell Daemon: OpenSSH-3.7.1p2
K35alsa../init.d/alsaSave volume settings: ALSA-0.9.6
K48samba../init.d/sambaStop network file system: Samba-2.2.8a
K48NFS../init.d/nfsStop network file system:
K49adsl../init.d/adslStops the ADSL client: RP-PPPoE-3.5
K49portmap../init.d/portmapStop Forwarding RPC requests: portmap-5
K49xinetd../init.d/xinetdStop Internet services daemon: xinetd-2.3.12
K49bind../init.d/bindStop named services daemon (DNS): BIND-9.2.2
K59firewall../init.d/firewallUnset firewall settings: Firewalling
K80sysklogd../init.d/sysklogdShut down networking: Part of LFS base.
K90network../init.d/networkShut down networking: Part of LFS base.

rc2.d

Table A-3. rc2.d symlinks

NumberTitleLinkExplanation
K05gdm../init.d/gdmShut down GNOME display manager Daemon: GDM-2.4.1.4
K10gpm../init.d/gpmShut down General Purpose Mouse Daemon: GPM-1.20.1
K25postfix../init.d/postfixShut down Postfix MTA: Postfix-2.0.16
K26mysql../init.d/mysqlShut down MySQL Daemon: MySQL-4.0.15
K26postgresql../init.d/postgresqlShut down PostgreSQL Daemon: PostgreSQL-7.3.4
K28apache../init.d/apacheShut down Apache Daemon: Apache-2.0.47
K30sshd../init.d/sshdShut down Secure Shell Daemon: OpenSSH-3.7.1p2
K48samba../init.d/sambaStop network file system: Samba-2.2.8a
K48NFS../init.d/nfsStop network file system:
K49adsl../init.d/adslStops the ADSL client: RP-PPPoE-3.5
K49portmap../init.d/portmapStop Forwarding RPC requests: portmap-5
K49xinetd../init.d/xinetdStop Internet services daemon: xinetd-2.3.12
K49bind../init.d/bindStop named services daemon (DNS): BIND-9.2.2
K59firewall../init.d/firewallUnset firewall settings: Firewalling
K90network../init.d/networkShut down networking: Part of LFS base.
S10sysklogd../init.d/sysklogdStart system and kernel logging: Part of LFS base.
S25random../init.d/randomRestore random seed: random
S40alsa../init.d/alsaStart up sound system: ALSA-0.9.6
S40fcron../init.d/fcronStart Cron Daemon: Fcron-2.9.3
S99cups../init.d/cupsStart the Common Unix printing system: CUPS-1.1.19
S99lprng../init.d/lprngStart the LPR print spooler: LPRng-3.8.22

rc3.d

Table A-4. rc3.d symlinks

NumberTitleLinkExplanation
K05gdm../init.d/gdmShut down GNOME display manager Daemon: GDM-2.4.1.4
S10sysklogd../init.d/sysklogdStart system and kernel logging: Part of LFS base.
S20network../init.d/networkStart networking: Part of LFS base.
S21firewall../init.d/firewallLoad firewall settings: Firewalling
S22bind../init.d/bindStart named services daemon (DNS): BIND-9.2.2
S22portmap../init.d/portmapForwards RPC requests: portmap-5
S23xinetd../init.d/xinetdLoad Internet services daemon: xinetd-2.3.12
S24adsl../init.d/adslStarts the ADSL client: RP-PPPoE-3.5
S24NFS../init.d/nfsStart network file system:
S24samba../init.d/sambaStart network file system: Samba-2.2.8a
S25random../init.d/randomRestore random seed: random
S30sshd../init.d/sshdStart Secure Shell Daemon: OpenSSH-3.7.1p2
S32apache../init.d/apacheStart Apache Daemon: Apache-2.0.47
S34mysql../init.d/mysqlStart MySQL Daemon: MySQL-4.0.15
S34postgresql../init.d/postgresqlStart PostgreSQL Daemon: PostgreSQL-7.3.4
S35postfix../init.d/postfixStart Postfix MTA: Postfix-2.0.16
S40alsa../init.d/alsaStart up sound system: ALSA-0.9.6
S40fcron../init.d/fcronStart Cron Daemon: Fcron-2.9.3
S70gpm../init.d/gpmStart the General Purpose Mouse Daemon: GPM-1.20.1
S99cups../init.d/cupsStart the Common Unix printing system: CUPS-1.1.19
S99lprng../init.d/lprngStart the LPR print spooler: LPRng-3.8.22

rc4.d

Table A-5. rc4.d symlinks

NumberTitleLinkExplanation
K05gdm../init.d/gdmShut down GNOME display manager Daemon: GDM-2.4.1.4
S10sysklogd../init.d/sysklogdStart system and kernel logging: Part of LFS base.
S20network../init.d/networkStart networking: Part of LFS base.
S21firewall../init.d/firewallLoad firewall settings: Firewalling
S22bind../init.d/bindStart named services daemon (DNS): BIND-9.2.2
S22portmap../init.d/portmapForwards RPC request: portmap-5
S23xinetd../init.d/xinetdLoad Internet services daemon: xinetd-2.3.12
S24adsl../init.d/adslStarts the ADSL client: RP-PPPoE-3.5
S24NFS../init.d/nfsStart network file system:
S24samba../init.d/sambaStart network file system: Samba-2.2.8a
S25random../init.d/randomRestore random seed: random
S30sshd../init.d/sshdStart Secure Shell Daemon: OpenSSH-3.7.1p2
S32apache../init.d/apacheStart Apache Daemon: Apache-2.0.47
S34mysql../init.d/mysqlStart MySQL Daemon: MySQL-4.0.15
S34postgresql../init.d/postgresqlStart PostgreSQL Daemon: PostgreSQL-7.3.4
S35postfix../init.d/postfixStart Postfix MTA: Postfix-2.0.16
S40alsa../init.d/alsaStart up sound system: ALSA-0.9.6
S40fcron../init.d/fcronStart Cron Daemon: Fcron-2.9.3
S70gpm../init.d/gpmStart the General Purpose Mouse Daemon: GPM-1.20.1
S99lprng../init.d/lprngStart the LPR print spooler: LPRng-3.8.22

rc5.d

Table A-6. rc5.d symlinks

NumberTitleLinkExplanation
S10sysklogd../init.d/sysklogdStart system and kernel logging: Part of LFS base.
S20network../init.d/networkStart networking: Part of LFS base.
S21firewall../init.d/firewallLoad firewall settings: Firewalling
S22bind../init.d/bindStart named services daemon (DNS): BIND-9.2.2
S22portmap../init.d/portmapForwards RPC requests: portmap-5
S23xinetd../init.d/xinetdLoad Internet services daemon: xinetd-2.3.12
S24adsl../init.d/adslStarts the ADSL client: RP-PPPoE-3.5
S24NFS../init.d/nfsStart network file system:
S24samba../init.d/sambaStart network file system: Samba-2.2.8a
S25random../init.d/randomRestore random seed: random
S30sshd../init.d/sshdStart Secure Shell Daemon: OpenSSH-3.7.1p2
S32apache../init.d/apacheStart Apache Daemon: Apache-2.0.47
S34mysql../init.d/mysqlStart MySQL Daemon: MySQL-4.0.15
S34postgresql../init.d/postgresqlStart PostgreSQL Daemon: PostgreSQL-7.3.4
S35postfix../init.d/postfixStart Postfix MTA: Postfix-2.0.16
S40alsa../init.d/alsaStart up sound system: ALSA-0.9.6
S40fcron../init.d/fcronStart Cron Daemon: Fcron-2.9.3
S70gpm../init.d/gpmStart the General Purpose Mouse Daemon: GPM-1.20.1
S95gdm../init.d/gdmStart the GNOME display manager Daemon: GDM-2.4.1.4
S99cups../init.d/cupsStart the Common Unix printing system: CUPS-1.1.19
S99lprng../init.d/lprngStart the LPR print spooler: LPRng-3.8.22

rc6.d

Table A-7. rc6.d symlinks

NumberTitleLinkExplanation
K00lprng../init.d/lprngShut down LPR print spooler: LPRng-3.8.22
K05gdm../init.d/gdmShut down GNOME display manager Daemon: GDM-2.4.1.4
K08fcron../init.d/fcronShut down Cron Daemon: Fcron-2.9.3
K10gpm../init.d/gpmShut down General Purpose Mouse Daemon: GPM-1.20.1
K25postfix../init.d/postfixShut down Postfix MTA: Postfix-2.0.16
K26mysql../init.d/mysqlShut down MySQL Daemon: MySQL-4.0.15
K26postgresql../init.d/postgresqlShut down PostgreSQL Daemon: PostgreSQL-7.3.4
K28apache../init.d/apacheShut down Apache Daemon: Apache-2.0.47
K30sshd../init.d/sshdShut down Secure Shell Daemon: OpenSSH-3.7.1p2
K35alsa../init.d/alsaSave volume settings: ALSA-0.9.6
K40sysklogd../init.d/sysklogdStop system and kernel logging: Part of LFS base.
K45random../init.d/randomSave random seed: random
K48samba../init.d/sambaStop network file system: Samba-2.2.8a
K48NFS../init.d/sambaStop network file system:
K49adsl../init.d/adslStops the ADSL client: RP-PPPoE-3.5
K49portmap../init.d/portmapStop Forwarding RPC requests: portmap-5
K49xinetd../init.d/xinetdStop Internet services daemon: xinetd-2.3.12
K49bind../init.d/bindStop named services daemon (DNS): BIND-9.2.2
K50sendsignals../init.d/sendsignalsKill processes: Part of LFS base.
K59firewall../init.d/firewallUnset firewall settings: Firewalling
K60mountfs../init.d/mountfsUnmount all file systems: Part of LFS base.
K70swap../init.d/swapTurn off swap: Part of LFS base.
K80network../init.d/networkShut down networking: Part of LFS base.
K90localnet../init.d/localnetRemove loopback interface: Part of LFS base.
K99reboot../init.d/haltReboot system: Part of LFS base.

Appendix B. Installing in non-default locations

When you want to install a package to a location other than /, or /usr, you are installing outside the default environment settings on most machines. The following examples should assist you in determining how to correct this situation. The examples cover the complete range of settings that may need updating, but they are not all needed in every situation.

  • Expand the PATH to include $PREFIX/bin.

  • Expand the PATH for root to include $PREFIX/sbin.

  • Add $PREFIX/lib to /etc/ld.so.conf or expand LD_LIBRARY_PATH to include it. Before using the latter option, check out http://www.visi.com/~barr/ldpath.html.

  • Add $PREFIX/man to /etc/man.conf or expand MANPATH.

  • Add $PREFIX/info to INFOPATH.

  • Add $PREFIX/lib/pkgconfig to PKG_CONFIG_PATH.

  • Add $PREFIX/include to CPPFLAGS when compiling packages that depend on the package you installed.

Glossary

Acronyms

ADSL

Asymmetric Digital Subscriber Line

AIFF

Audio Interchange File Format

ALSA

Advanced Linux Sound Architecture

API

Application Programming Interface

ASCII

American Standard Code for Information Interchange

ATA

AT-Attached

ATSC

Advanced Television Systems Committee

ATK

Accessibility ToolKit

BICS

Berkeley/IRCAM/CARL

BIND

Berkeley Internet Name Domain

BIOS

Basic Input/Output System

BLFS

Beyond Linux From Scratch

BMP

Bit MaP

CD

Compact Disk

CDDA

Compact Disc Digital Audio

CIFS

Common Internet File System

See Also: SMB.

CODEC

COmpression/DECompression module

CORBA

Common Object Request Broker Architecture

CRD

Color Rendering Dictionary

CSA

Color Space Array

CSS (on DVD)

Contents Scrambling System

CSS

Cascading Style Sheets

CUPS

Common Unix Printing System

CVS

Concurrent Versions System

DES

Data Encryption Standard

DHCP

Dynamic Host Configuration Protocol

DIN

German Industrial Norm

DNS

Domain Name Service

DOS

Disk Operating System

DSO

Dynamic Shared Objects

DSSSL

Document Style Semantics and Specification Language

DVI

DeVice Independent

EPP

Enhanced Parallel Port

EPS

Encapsulated PostScript

ESD

Enlighten Sound Daemon

FAM

File Alteration Monitor

FAME

Fast Assembly Mpeg Encoder

FAQ

Frequently Asked Questions

FAX

Facsimile

FB

Frame Buffer

FHS

File Hierarchy Standard

FLAC

Free Lossless Audio CODEC

FO

Formatted Objects

FOURCCC

FOUR Character Code

FTP

File Transfer Protocol

GCC

GNU Compiler Collection

GDBM

GNU DataBase Manager

GDK

GTK+ Drawing Kit

GID

Group IDentity

GIF

Graphics Interchange Format

GMP

GNU Multiple Precision Arithmetic

GNAT

GNU NYU Ada 9x Translator

GNOME

GNU Network Object Model Environment

GNU

GNU's Not Unix

GPL

General Public License

GPM

General Purpose Mouse

GTK

GIMP ToolKit

GUI

Graphical User Interface

HFS

Hierarchical File System

HTML

HyperText Markup Language

HTTP

HyperText Transfer Protocol

HUP

Hang UP

ICC

International Color Consortium

ICMP

Internet Control Message Protocol

IDE

Integrated Drive Electronics

IDL

Interface Definition Language

IJS

Ink Jet Systems

IMAP

Internet Message Access Protocol

IMON

Inode MONitor

IP

Internet Protocol

See Also: TCP.

IPX

Internetwork Packet eXchange

IRC

Internet Relay Chat

IrDA

Infrared Data Association

ISDN

Integrated Services Digital Network

ISP

Internet Service Provider

JAR

Java ARchive

JDK

Java Development Kit

JFIF

JPEG File Interchange Format>

JPEG

Joint Photographic Experts Group

KDE

K Desktop Environment

LAME

Lame Ain't an MP3 Encoder

LAN

Local Area Network

LDAP

Lightweight Directory Access Protocol

LDIF

Lightweight Data Interchange Format

LFS

Linux From Scratch

LGPL

Library General Public License

LPR

Line PRinter

LZO

Lemple-Ziv-Oberhumer

MD

Message-Digest

MDA

Mail Delivery Agent

MIDI

Musical Instrument Digital Interface

MIME

Multipurpose Internet Mail Extensions

MNG

Multiple-image Network Graphics

MPEG

Moving Picture Experts Group

MTA

Mail Transport Agent

MUA

Mail User Agent

NASM

Netwide ASseMbler

NNTP

Network News Transfer Protocol

NFS

Network File System

OAF

Object Activation Framework

OMNI

OMNIdirectional

ORB

Object Request Broker

See Also: CORBA.

ORDBMS

Object Relational Database Management System

OSS

Open Sound System

PAM

Pluggable authentication Modules

PCI

Peripheral Component Interconnect

PDC

Primary Domain Controller

PDF

Portable Document Format

PIM

Personal Information Manager

PGM

Portable Grey Map

PHP

PHP Hypertext Preprocessor

PGP

Pretty Good Privacy

PNG

Portable Network Graphics

POP

Post Office Protocol

PPD

PostScript Printer Description

PPM

Portable Pixel Map

PPP

Point to Point Protocol

PPPoE

Point to Point Protocol over Ethernet

RAM

Random Access Memory

RCS

Revision Control System

RFC

Request For Comments

RGB

Red Green Blue

ROM

Read-Only Memory

RP

Roaring Penguin

RPC

Remote Procedure Call

S/MIME

Secure/MIME

SANE

Scanner Access Now Easy

SBU

Static Binutils Units

SCCS

Source Code Control System

SCSI

Small Computer System Interface

SDK

Software Development Kit

SGML

Standard Generalized Markup Language

SMB

Server Message Block

SMTP

Simple Mail Transfer Protocol

SOAP

Simple Object Access Protocol

SQL

Structured Query Language

SSH

Secure SHell

SSL

Secure Sockets Layer

SUID

Set User IDentity

SVG

Scalable Vector Graphics

SVGA

Super Video Graphics Array

TCL

Tool Command Language

TCP

Transmission Control Protocol

TIFF

Tag(ged) Image File Format

TLS

Transport Layer Security

UDF

Universal Disk Format

UID

User IDentity

UDP

User Datagram Protocol

UI

User Interface

URL

Uniform Resource Locator

USB

Universal Serial Bus

USR

Upstream Ready

UUCP

Unix-to-Unix Copy Protocol

VESA

Video Electronics Standards Association

VGA

Video Graphics Array

VOB

Video OBject

WWW

World Wide Web

XDMCP

X Display Manager Control Protocol

XML

eXtensible Markup Language

XSL

eXtensible Style Language

XSLT

eXtensible Style Language Transformation

XSM

X/Open System Management

XMMS

X MultiMedia System

YUV

Luminance-Bandwidth-Chrominance