Copyright © 2001-2019 The BLFS Development Team
Copyright © 2001-2019, The BLFS Development Team
All rights reserved.
This book is licensed under a Creative Commons License.
Computer instructions may be extracted from the book under the MIT License.
Linux® is a registered trademark of Linus Torvalds.
2019-03-01
Revision History | ||
---|---|---|
Revision 8.4 | 2019-03-01 | Nineteenth Release |
Revision 8.3 | 2018-09-01 | Eighteenth release |
Revision 8.2 | 2018-03-02 | Seventeenth release |
Revision 8.1 | 2017-09-01 | Sixteenth release |
Revision 8.0 | 2017-02-25 | Fifteenth release |
Revision 7.10 | 2016-09-07 | Fourteenth release |
Revision 7.9 | 2016-03-08 | Thirteenth release |
Revision 7.8 | 2015-10-01 | Twelfth release |
Revision 7.7 | 2015-03-06 | Eleventh release |
Revision 7.6 | 2014-09-23 | Tenth release |
Revision 7.5 | 2014-03-05 | Ninth release |
Revision 7.4 | 2013-09-14 | Eighth release |
Revision 6.3 | 2008-08-24 | Seventh release |
Revision 6.2.0 | 2007-02-14 | Sixth release |
Revision 6.1 | 2005-08-14 | Fifth release |
Revision 6.0 | 2005-04-02 | Fourth release |
Revision 5.1 | 2004-06-05 | Third release |
Revision 5.0 | 2003-11-06 | Second release |
Revision 1.0 | 2003-04-25 | First release |
Abstract
This book follows on from the Linux From Scratch book. It introduces and guides the reader through additions to the system including networking, graphical interfaces, sound support, and printer and scanner support.
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 <at> 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 <at> linuxfromscratch.org
BLFS Editor (March 2003–June 2004)
The BLFS project is a natural progression of LFS. Together, these projects provide a unique resource for the Open Source Community. They take the mystery out of the process of building a complete, functional software system from the source code contributed by many talented individuals throughout the world. They truly allow users to implement the slogan "Your distro, your rules."
Our goal is to continue to provide the best resource available that shows you how to integrate many significant Open Source applications. Since these applications are constantly updated and new applications are developed, this book will never be complete. Additionally, there is always room for improvement in explaining the nuances of how to install the different packages. To make these improvements, we need your feedback. I encourage you to participate on the different mailing lists, news groups, and IRC channels to help meet these goals.
Bruce Dubbs
bdubbs <at> linuxfromscratch.org
BLFS Editor (June 2004–December 2006)
My introduction to the [B]LFS project was actually by accident. I was trying to build a GNOME environment using some how-tos and other information I found on the web. A couple of times I ran into some build issues and Googling pulled up some old BLFS mailing list messages. Out for curiosity, I visited the Linux From Scratch web site and shortly thereafter was hooked. I've not used any other Linux distribution for personal use since.
I can't promise anyone will feel the sense of satisfaction I felt after building my first few systems using [B]LFS instructions, but I sincerely hope that your BLFS experience is as rewarding for you as it has been for me.
The BLFS project has grown significantly the last couple of years. There are more package instructions and related dependencies than ever before. The project requires your input for continued success. If you discover that you enjoy building BLFS, please consider helping out in any way you can. BLFS requires hundreds of hours of maintenance to keep it even semi-current. If you feel confident enough in your editing skills, please consider joining the BLFS team. Simply contributing to the mailing list discussions with sound advice and/or providing patches to the book's XML will probably result in you receiving an invitation to join the team.
Randy McMurchy
randy <at> linuxfromscratch.org
BLFS Editor (December 2006–January 2011)
This version of the book is intended to be used when building on top of a system built using the LFS book. Every effort has been made to ensure accuracy and reliability of the instructions. Many people find that using the instructions in this book after building the current stable or development version of LFS provides a stable and very modern Linux system.
Enjoy!
Randy McMurchy
August 24th, 2008
Last updated on 2016-04-17 13:16:17 -0700
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. Note that the material contained in this book, in particular the dependency listings, is based upon the assumption that you are using a base LFS system with every package listed in the LFS book already installed and configured. 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!
Last updated on 2015-09-20 15:38:20 -0700
This book is divided into the following parts.
This part contains information which is essential to the rest of the book.
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.
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.
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. Networking libraries and command-line networking tools are also covered here.
Here we deal with setting up mail and other servers (such as SSH, Apache, etc.).
This part explains how to set up a basic X Window System installation along with some generic X libraries and Window managers.
For those who want to use the K Desktop Environment or some parts of it, this part covers it.
GNOME is the main alternative to KDE in the Desktop Environment arena.
Xfce is a lightweight alternative to GNOME and KDE.
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.
Here we cover setting multimedia libraries and drivers along with some audio, video and CD-writing programs.
The PST part of the book covers document handling with applications like Ghostscript, CUPS and DocBook to installing texlive.
The Appendices cover information which doesn't belong in the main book; they are mainly there as a reference.
Last updated on 2015-09-20 15:38:20 -0700
The Beyond Linux From Scratch book is designed to carry on from where the LFS book leaves off. But 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 used throughout the book.
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 attempts to guide you in the process of going from the base system to your intended destination. 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 Chapter 2, Important Information, as this contains comments about how to unpack software, issues related to using different locales 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, Security), File Systems (Chapter 5, File Systems and Disk Management), Editors (Chapter 6, Editors) and Shells (Chapter 7, Shells). 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 Chapter 13, Programming) 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 as each BLFS installation 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 Networking part. It deals with connecting to the Internet or your LAN (Chapter 14, Connecting to a Network) using a variety of methods such as DHCP and PPP, and with items such as Networking Libraries (Chapter 17, Networking Libraries) 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 Servers part of the book. Those wanting to build servers should find a good starting point there. Note that this section also contains information on various database packages.
The next parts of the book principally deal with desktop systems. This portion of the book starts with a part talking about X plus Window and Display Managers. This part also deals with some generic X-based libraries (Chapter 25, X Libraries). After this, KDE and GNOME are given their own parts which are followed by one on X Software.
The book then moves on to deal with Multimedia packages. Note that many people may want to use the ALSA-1.1.8 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.
We hope you enjoy using BLFS and find it useful.
Last updated on 2012-12-19 11:57:20 -0800
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 to identify references to specific commands.
install-info: unknown option
`--dir-file=/mnt/lfs/usr/info/dir'
This form of text (fixed width text) is showing screen output, probably a result from issuing a command. It is also used to show filenames such as
/boot/grub/grub.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 external to the book such as HowTos, download locations, websites, etc.
This form of text is used for links internal to the book such as another section describing a different package.
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.
<REPLACED
TEXT>
This form of text is used to encapsulate text that should be modified and is not to be typed as seen, or copy and pasted. Note that the square brackets are not part of the text, but should be substituted for as well.
root
This form of text is used to show a specific system user or group reference in the instructions.
When packages are created, the authors depend on prior work. In order to build a package in BLFS, these dependencies must be built prior to the desired package. For each package, any prerequisite packages are listed in one or more separate sections: Required, Recommended, and Optional.
These dependencies are the minimum prerequisite packages required to build the package. Omitted from the list are packages in LFS and required dependencies of other required packages.
These dependencies are those that the BLFS editors have determined are important to give the package reasonable capabilities. Package installation instructions assume they are installed. If a recommended package is not desired, the instructions may need to be modified to accommodate the missing package.
These dependencies are those that the package may use. Integration of optional dependencies may be automatic by the package or may need additional instructions not presented by BLFS. Optional packages may be listed without corresponding BLFS instructions. In this case it is up to the user to determine appropriate installation instructions.
Some packages have specific needs regarding the kernel configuration. The general layout is the following:
Master section --->
Subsection --->
[*] Required parameter [CONFIG_REQU_PAR]
<*> Required parameter (not as module) [CONFIG_REQU_PAR_NMOD]
<*/M> Required parameter (could be a module) [CONFIG_REQU_PAR_MOD]
<*/M/ > Optional parameter [CONFIG_OPT_PAR]
[ ] Incompatible parameter [CONFIG_INCOMP_PAR]
< > Incompatible parameter (even as module) [CONFIG_INCOMP_PAR_MOD]
[CONFIG_...] on the right gives the name of the option, so
you can easily check whether it is set in your config
file. The meaning of the various
entries is:
Master section top level menu item Subsection submenu item Required parameter the option could be either built-in or not selected: it must be selected Required parameter (not as module) the option could be either built-in, module, or not selected: it must be selected as built-in Required parameter (could be a module) the option could be either built-in, module, or not selected: it must be selected, either as built-in or module Optional parameter rarely used: the option could be either built-in, module, or not selected: it may be selected at will Incompatible parameter the option could be either built-in or not selected: it must not be selected Incompatible parameter (even as module) the option could be either built-in, module, or not selected: it must not be selected
Note that, depending on other selections, the angle brackets (<>) may appear as braces ({}), if the option cannot be unselected, or even dashes (-*- or -M-), when the choice is imposed. The help text about the option specifies the other selections on which this option relies, and how those other selections are set.
As in LFS, each package in BLFS has a build time listed in Standard Build Units (SBUs). These times are relative to the time it took to build binutils in LFS and are intended to provide some insight into how long it will take to build a package. Most times listed are for a single processor or core to build the package. In some cases, large, long running builds tested on multi-core systems have SBU times listed with comments such as '(parallelism=4)'. These values indicate testing was done using multiple cores. Note that while this speeds up the build on systems with the appropriate hardware, the speedup is not linear and to some extent depends on the individual package and specific hardware used.
For packages which use ninja (e.g. anything using meson) or rust, by default all cores are used so similar comments will be seen on such packages even when the build time is minimal.
Where even a parallel build takes more than 15 SBU, on certain machines the time may be considerably greater even when the build does not use swap. In particular, different micro-architectures will build some files at different relative speeds and this can introduce delays when certain make targets wait for another file to be created. Where a large build uses a lot of C++ files, processors with Simultaneous Multi Threading will share the Floating Point Unit and can take 45% longer than when using four 'prime' cores (measured on an intel i7 using taskset and keeping the other cores idle).
Some packages do not support parallel builds and using -j1 for the make command is required. Packages that are known to have such limits are marked as such in the text.
Last updated on 2018-09-23 10:06:59 -0700
This is BLFS-BOOK version 8.4 dated March 1st, 2019. This is the 8.4 branch of the BLFS book, currently targeting the LFS 8.4 book. For development versions, if this version is older than a month, it's likely that your mirror hasn't been synchronized recently and a newer version is probably available for download or viewing. Check one of the mirror sites at http://www.linuxfromscratch.org/mirrors.html for an updated version.
Last updated on 2016-04-17 13:16:17 -0700
The BLFS project has a number of mirrors set up world-wide to make it easier and more convenient for you to access the website. Please visit the http://www.linuxfromscratch.org/mirrors.html website for the list of current mirrors.
Last updated on 2007-04-04 12:42:53 -0700
Within the BLFS instructions, each package has two references for finding the source files for the package—an HTTP link and an FTP link (some packages may only list one of these links). Every effort has been made to ensure that these links are accurate. However, the World Wide Web is in continuous flux. Packages are sometimes moved or updated and the exact URL specified is not always available.
To overcome this problem, the BLFS Team, with the assistance of Oregon State University Open Source Lab, has made an HTTP/FTP site available through world wide mirrors. See http://www.linuxfromscratch.org/blfs/download.html#sources for a list. These sites have all the sources of the exact versions of the packages used in BLFS. If you can't find the BLFS package you need at the listed addresses, get it from these sites.
We would like to ask a favor, however. Although this is a public resource for you to use, please do not abuse it. We have already had one unthinking individual download over 3 GB of data, including multiple copies of the same files that are placed at different locations (via symlinks) to make finding the right package easier. This person clearly did not know what files he needed and downloaded everything. The best place to download files is the site or sites set up by the source code developer. Please try there first.
Last updated on 2017-02-11 20:17:33 -0800
Current release: 8.4 – March 1st, 2019
Changelog Entries:
March 1st, 2019
[bdubbs] - Release of BLFS-8.4.
February 26th, 2019
[ken] - Update to IO::Socket::SSL-2.062 with Net::SSLeay-1.86_06. Fixes #11712.
[bdubbs] - Update to mariadb-10.3.13. Fixes #11705.
[bdubbs] - Update to unrar-5.7.2. Fixes #11703.
[renodr] - Remove rendundant commands in Freetype.
[bdubbs] - Update to NetworkManager-1.14.6. Fixes #11713.
[bdubbs] - Update to bind-9.12.3-P4. Fixes #11704.
[timtas] - Update to thunderbird-60.5.2. Fixes #11721.
February 25th, 2019
[renodr] - Update to Libreoffice-6.2.0.3. Fixes #11650.
February 24th, 2019
[dj] - Make libnssckbi.so link unconditionally in p11-kit and NSS instructions.
[dj] - Moved example configuration for make-ca to the configuration section.
February 22nd, 2019
February 21st, 2019
February 19th, 2019
[renodr] - Update to postgresql-11.2. Fixes #11673.
February 16th, 2019
[renodr] - Update to xcursor-themes-1.0.6. Fixes #11674.
[renodr] - Update to libjpeg-turbo-2.0.2 (Security Update). Fixes #11672.
[renodr] - Fix TWM's window borders and other issues by adding a dependency on the Xorg Legacy Fonts.
[dj] - Add sed to fix Gnome Color Manager build when DocBook-Utils is installed.
February 15th, 2019
[timtas] - Update to thunderbird-60.5.1. Fixes #11675.
February 14th, 2019
[renodr] - Update to cbindgen-0.8.0. Fixes #11669.
February 13th, 2019
February 12th, 2019
February 11th, 2019
[renodr] - Update to pixman-0.38.0. Fixes #11662.
[renodr] - Update to libassuan-2.5.3. Fixes #11661.
[renodr] - Update to Exim-4.92. Fixes #11659.
[renodr] - Update to libuv-1.26.0. Fixes #11658.
[ken] - Drop system libvpx from firefox, it fails to build against libvpx-1.8.0.
[bdubbs] - Update to ffmpeg-4.1.1. Fixes #11655.
[dj] - Add gst-plugins-good-1.14.4-vpx_1.8-1.patch.
February 10th, 2019
[renodr] - Update to libXau-1.0.9. Fixes #11657.
[ken] - Update to mutt-1.11.3. Fixes #11619.
[dj] - Add patch for gst-plugins-bad to allow build with fdkaac-2.x.
[bdubbs] - Update to xf86-video-intel-20190208. Updated in accordance with #5918.
[bdubbs] - Update to x264-snapshot-20190209-2245. Updated in accordance with #7555.
[dj] - Remove instructions to regenerate cacerts file when installing Java as this is no longer necessary.
February 9th, 2019
[bdubbs] - Update to ImageMagick-6.9.10-27 and ImageMagick6-7.0.8-27. Addresses #7859.
[bdubbs] - Update to libxkbcommon-0.8.3. Fixes #11652.
[bdubbs] - Update to kf5-apps-18.12.2. Partially fixes #11523.
[bdubbs] - Update to phonon-4.10.2 and phonon-backend-vlc-0.10.2. Partially fixes #11523.
[bdubbs] - Update to kf5-5.55.0. Partially fixes #11523.
[renodr] - Update to lxml-4.3.1. Fixes #11653.
[renodr] - Update to WebkitGTK+-2.22.6. Fixes #11654.
[pierre] - Update to ninja-1.9.0. Fixes #11655.
[renodr] - Update to libidn2-2.1.1. Fixes #11651.
February 8th, 2019
[renodr] - Update to poppler-0.74.0. Fixes #11645.
[renodr] - Update to highlight-3.49. Fixes #11646.
[renodr] - Update to dhcpcd-7.1.1. Fixes #11648.
[renodr] - Update to php-7.3.2. Fixes #11647.
[bdubbs] - Update to sqlite-autoconf-3270000 (3.27.1). Fixes #11649.
[pierre] - Allow using Python 3 to build Qt5.
February 7th, 2019
[renodr] - Update to network-manager-applet-1.8.20. Fixes #11643.
February 6th, 2019
February 5th, 2019
[renodr] - Update to dovecot-2.3.4.1 (security update). Fixes #11635.
[renodr] - Update to gnome-desktop-3.30.2.1. Fixes #11638.
[bdubbs] - Update to unbound-1.9.0. Fixes #11636.
[bdubbs] - Update to libdvdread-6.0.1. Fixes #11637.
[bdubbs] - Update to zsh-5.7.1. Fixes #11634.
[renodr] - Update to epiphany-3.30.3. Fixes #11630.
[renodr] - Update to GTK+-3.24.5. Fixes #11627.
[bdubbs] - Update to cmake-3.13.4. Fixes #11631.
[bdubbs] - Update to libvpx-1.8.0. Fixes #11633.
[bdubbs] - Update to iw-5.0.1. Fixes #11632.
[renodr] - Add a fix to cheese to prevent system logs from being spammed with GTK Deprecation Warnings due to GtkScrollbar-min-slider-length. Fixes #11628.
[renodr] - Update to thunderbird-60.5.0 (Critical security update). Fixes #11608.
February 3rd, 2019
[bdubbs] - Update to xf86-input-libinput-0.28.2. Fixes #11625.
[ken] - firefox-65.0 includes its own version of libwebp unless told to use the system version. Also, no need to specify --enable-optimize=-O2 now we are using clang. Thanks to Brandan L. for noticing both of these.
[renodr] - Update to NSS-3.42.1. Fixes #11615.
[renodr] - Update to node.js-10.15.1. Fixes #11607.
[bdubbs] - Update to qpdf-8.4.0. Fixes #11623.
[bdubbs] - Update to xkeyboard-config-2.26. Fixes #11624.
[bdubbs] - Update to babl-0.1.62. Fixes #11622.
February 2nd, 2019
[renodr] - Update the OpenJDK binary for i686 to patch level 9. This prevents a version mismatch.
[renodr] - Adapt Libreoffice to changes in OpenJDK-11.x. Fixes #11611.
[bdubbs] - Update to mercurial-4.9. Fixes #11621.
[bdubbs] - Update to iw-5.0. Fixes #11620.
[ken] - Update to Qt-5.12.1 and QtWebEngine-5.12.1, the latter includes a security update and needs the updated Qt to compile. Fixes #11617.
[bdubbs] - Update to mesa-18.3.3. Fixes #11616.
[bdubbs] - Update to ruby-2.6.1. Fixes #11613.
[bdubbs] - Update to harfbuzz-2.3.1. Fixes #11612.
January 31st, 2019
[ken] - Patch ghostscript-9.26 for a segfault and for yet another security fix.
[bdubbs] - Update to opencv-4.0.1. Fixes #11609.
[pierre] - Add a patch to AbiWord, to prevent flickering.
January 30th, 2019
[pierre] - Update pdfbox and fontbox version to 2.0.13 on fop page.
[pierre] - Add patches for gwenview and libkexiv2 so that they build against exiv2-0.27.
January 29th, 2019
[renodr] - Fix the detection of ruby in Graphviz for building the Ruby bindings. This should be checked/updated with every major version of Ruby. Fixes #11606.
[pierre] - OpenJDK build number has been bumped to 9. There is almost no change, but the link to the 64 bit binary has to be changed, so update the book.
[renodr] - Update to xf86-video-nouveau-1.0.16. Fixes #11603.
[renodr] - Update to libgpg-error-1.35. Fixes #11599.
[renodr] - Update to unrar-5.7.1. Fixes #11600.
[renodr] - Update to nss-3.42. Fixes #11598.
[pierre] - Remove dependency on Python 2 for plasma, and adapt PYTHONPATH for Python 3 in /etc/profile.d/kf5.sh.
January 28th, 2019
[ken] - Updated the Perl Module Dependencies used by Biber to current versions: DateTime::TimeZone-2.23, Package::Stash-0.38, Term::Table-0.13, Test2::Suite-0.000118, Test::Simple-1.302160, Text::CSV_XS-1.38. Fixes #11596.
[ken] - Add comments in perl modules Net::SSLeay and IO::Socket::SSL. I was on an 8.3 system where openssl was still 1.1.0, with the N::S patch the I::S::S tests burned CPU in the same way as with 1.1.1. Noted while working on #11596.
[pierre] - Libpwquality needs a configure switch to use Python 3. Add and document it.
[ken] - Update to firefox-65.0. Now supports webp. Fixes #11597. Contains several security fixes.
[pierre] - Move Python 2 to optional in tracker: it is only needed for the "functional" tests.
January 27th, 2019
[renodr] - Update to Thunar-1.8.4. Fixes #11595.
[pierre] - Usbutils does not need Python 2 anymore.
[bdubbs] - Update to zsh-5.7. Fixes #11591.
[bdubbs] - Update to whois-5.4.1. Fixes #11593.
[bdubbs] - Update to libcdio-paranoia-10.2+2.0.0 (a part of libcdio). Fixes #11594.
[pierre] - Poppler needs Python only for generating the API documentation. Make dependency on Python 2 optional, and document how to use Python 3.
[pierre] - Git barely needs Python, and can use Python 3 in the rare cases it is needed.
[pierre] - Reinstate building Rustc with Python 3.
January 26th, 2019
[ken] - For rust, strongly recommend installing in /opt - this allows multiple versions to be used (fallback, testing a different config, trying a newer version) by merely (re-)running ldconfig after updating the symlink. It also prevents libraries from a previous version taking up space in /usr/lib/rustlib/ (previous /opt versions can easily be removed). Using a new prefix should also prevent the situation where changing the config.toml (e.g. from sys llvm to shipped llvm) builds fine but leaves a broken installation because cargo can no longer find the matching versions of the libraries.
[ken] - Tweak the details of which rust tests might fail.
[bdubbs] - Update the rust page providing instructions installing in /opt.
[bdubbs] - Update to libva-2.4.0. Fixes #11590.
[bdubbs] - Update to cbindgen-0.7.1. Fixes #11589.
[bdubbs] - Update to gnutls-3.6.6. Fixes #11588.
January 25th, 2019
[pierre] - Qemu: add a switch to configure to ensure Python 3 is used for building and testing. Change the dependency accordingly. Fix command explanations.
[pierre] - Fix Udisks2 dependencies (dbus is needed at runtime, and is not in the dependency graph for SysV) and give instructions for the full integration tests.
[bdubbs] - Update to Thunar-1.8.3. Fixes #11587.
[bdubbs] - Update to cbindgen-0.7.0. Fixes #11586.
January 24th, 2019
[bdubbs] - Update to btrfs-progs-v4.20.1. Fixes #11582.
[bdubbs] - Update to x265_3.0. Fixes #11584.
[ken] - Update to rustc-1.32.0, needed for the forthcoming firefox-65. Note that the instructions are going to be changed to install in /opt/rustc-1.XX.Y but the details of that are yet to be worked through. The intention is that people will not have to rebuild just because the book changes to using /opt. This build reverts to using the shipped LLVM because system llvm-7.0.1 is too old. This addresses #11521.
[pierre] - Update volume_key dependencies and instructions, to avoid using Python 2.
[pierre] - Update Asciidoc dependencies; Python 2 is required at runtime.
[renodr] - Update to NSS-3.41.1. Fixes #11583.
January 23rd, 2019
[pierre] - Force NetworkManager to use Python 3.
[pierre] - Six is not needed for gdk-pixbuf.
[pierre] - Six is required for scour and will be downloaded automatically if not already installed.
[pierre] - Update instructions for libbytesize to allow building and testing without Python 2.
[ken] - Change the 'Caution' on the rustc page (about running the testsuite on AMD Ryzens) to a 'Note', the reboot problem was almost certainly kernel triple-faults on an -rc kernel, although the testsuite seemed to reliably trigger it at that time. The supposed mitigation (now removed) was clearly irrelevant, and to top it all the invalid opcodes also appear on other machines, so they too are probably deliberate.
[pierre] - Update dependencies for libtasn1 and GTK+3: the dependency on python-six is obsolete.
[renodr] - Update to dhcpcd-7.1.0. Fixes #11581.
January 22nd, 2019
[renodr] - Update to vala-0.42.5. Fixes #11580.
[renodr] - Update to libdrm-2.4.97. Fixes #11579.
[bdubbs] - Update to httpd-2.4.38. Fixes #11576.
[bdubbs] - Update to p11-kit-0.23.15. Fixes #11578.
[bdubbs] - Update to scons-3.0.4. Fixes #11577.
[pierre] - Update dependencies for GTK-Doc: depends on Python 3, and not anymore on python-six.
January 21st, 2019
January 20th, 2019
[bdubbbs] - Update to libinput-1.12.6. Fixes #11571.
[bdubbbs] - Update to btrfs-progs-v4.20. Fixes #11569.
[bdubbbs] - Update to LVM2.2.03.02. Fixes #11567.
[bdubbbs] - Update to upower-0.99.9. Fixes #11566.
[bdubbbs] - Update to exo-0.12.4. Fixes #11568.
[bdubbbs] - Update to libwebp-1.0.2. Fixes #11570.
January 18th, 2019
[bdubbs] - Update to URI-1.76 (Peerl Module). Fixes #11565.
[bdubbs] - Change to docbook-xsl-nons. Fixes #11559.
[renodr] - Update to gtk-vnc-0.9.0. Fixes #11562.
[renodr] - Update to gcr-3.28.1. Fixes #11563.
[renodr] - Add a patch to permit building qtwebengine on i686. This is due to the alignof operator being changed in GCC 8, as it returns an incorrect value on 32-bit machines.
[bdubbs] - Update to cups-filters-1.22.0. Fixes #11564.
[bdubbs] - Update to nghttp2-1.36.0. Fixes #11561.
[bdubbs] - Update to libuv-v1.25.0. Fixes #11560.
January 18th, 2019
January 17th, 2019
January 16th, 2019
January 15th, 2019
January 14th, 2019
[bdubbs] - Add a note about avoiding tests when installing perl module IO::Socket::SSL using cpan. Fixes #11315.
[renodr] - Add a sed to xf86-video-intel to allow building on i686.
[renodr] - Update to gtk+-3.24.3. Fixes #11547.
[renodr] - Update to dovecot-2.3.4. Fixes #11378.
[renodr] - Add a patch to fix bugs in usbutils. Fixes #11185.
[bdubbs] - Update to xterm-343. Fixes #11546.
January 13th, 2019
[renodr] - Update to gucharmap-11.0.3. Finishes #11091.
[renodr] - Update to gnome-system-monitor-3.30.0. Partially fixes #11091.
[renodr] - Update to gnome-screenshot-3.30.0. Partially fixes #11091.
[renodr] - Update to gnome-calculator-3.30.1. Partially fixes #11091.
[renodr] - Update to file-roller-3.30.1. Partially fixes #11091.
[renodr] - Update to evince-3.30.2. Partially fixes #11091.
[renodr] - Update to eog-3.28.4. Partially fixes #11091.
[renodr] - Update to baobab-3.30.0. Partially fixes #11091.
[renodr] - Update to Epiphany-3.30.2. Fixes #11095.
[renodr] - Update to seahorse-3.30.1.1. Partially fixes #11091.
[renodr] - Add libdazzle. Fixes #11545.
[renodr] - Update to gtksourceview-3.24.9. Fixes #11120.
[bdubbs] - Update to libreoffice-6.1.4.2. Fixes #11180.
[pierre] - Fix the W3M patch so that it builds with GC 8.0.x.
[bdubbs] - Update to sudo-1.8.27. Fixes #11544.
January 12th, 2019
[pierre] - Finish refactoring of the Python modules page: pyatspi2: only P3, pycrypto: make P2 recommended, pygobject2: make P2 required, pygtk: make P2 required, pyxdg: only P3, lxml: make P2 recommended, scour: make P2 recommended and add P3 instructions. Fixes #11425.
[renodr] - Update to gnome-terminal-3.30.2. Partially fixes #11091.
[renodr] - Update to yelp-3.30.0. Finishes #11090.
[bdubbs] - Update to gc-8.0.2. Fixes #11543.
[pierre] - Only build Python 3 module for docutils. Tweak mercurial doc generation to work with docutils-P3.
[pierre] - Make Python 2 recommended for dbus-python, and fix an url.
[pierre] - Update to six-1.12.0. Make Python 2 recommended. Fixes #11428.
[pierre] - Update to pycairo-1.18.0. Make Python 2 recommended. Fixes #11316.
January 11th, 2019
[renodr] - Update to network-manager-applet-1.8.18. Partially fixes #11091.
[renodr] - Update to geoclue-2.5.2. Fixes #11542.
[renodr] - Update to nautilus-3.30.5. Partially fixes #11090.
[renodr] - Update to gexiv2-0.11.0. Fixes #11500.
[renodr] - Update to jansson-2.12. Fixes #11386.
[pierre] - Update to pygobject3-3.30.4, and build only the Python 3 module. Fixes #11342.
[pierre] - Allow libpsl to build with Python 3.
[pierre] - Update to MarkupSafe-1.1.0. Fixes #11318.
[pierre] - Update to scons-3.0.3. Adapt build for Python 3. Same for serf. Fixes #11408.
[bdubbs] - Update to subversion-1.11.1. Fixes #11540.
[bdubbs] - Update to php-7.3.1. Fixes #11541.
[bdubbs] - Archive libusb-compat-0.1.5. Fixes #11539.
January 10th, 2019
[bdubbs] - Update to alsa-lib-1.1.8 alsa-oss alsa-plugins alsa-utils. Fixes #11537.
[bdubbs] - Update to wireshark-2.6.6. Fixes #11536.
[bdubbs] - Update to poppler-0.73.0. Fixes #11535.
[bdubbs] - Update to libqmi-1.22.0. Fixes #11534.
[bdubbs] - Update to libmbim-1.18.0. Fixes #11533.
[bdubbs] - Update to krb5-1.17. Fixes #11532.
January 9th, 2019
[ken] - Update to firefox-64.0.2. Fixes #11538.
January 8th, 2019
[bdubbs] - Update to mariadb-10.3.12. Fixes #11531.
[ken] - Correct my syntax error in the qmake command of qtwebengine-5.12.0.
[bdubbs] - Update to krb5-1.16.3. Fixes #11527.
[bdubbs] - Update to mercurial-4.8.2. Fixes #11530.
[bdubbs] - Update to qpdf-8.3.0. Fixes #11528.
[bdubbs] - Update to cbindgen-0.6.8. Fixes #11529.
[renodr] - Update to gvfs-1.38.1. Partially fixes #11090.
January 7th, 2019
January 6th, 2019
[ken] - Revert to using python2 for rustc. Fixes #11520.
[bdubbs] - Update to thunderbird-60.4.0. Fixes #11469.
[bdubbs] - Update to mutt-1.11.1. Fixes #11402.
[bdubbs] - Update to exempi-2.5.0. Fixes #11517.
[bdubbs] - Update to libidn2-2.1.0. Fixes #11516.
[bdubbs] - Update to xterm-342. Fixes #11510.
January 5th, 2019
[bdubbs] - Update to node.js-10.15.0. Fixes #11484.
[bdubbs] - Update to libxslt-1.1.33. Fixes #11509.
[bdubbs] - Update to libxml2-2.9.9. Fixes #11508.
[bdubbs] - Update to audacious{,-plugins}-3.10.1. Fixes #11486.
[bdubbs] - Update to xscreensaver-5.42. Fixes #11489.
[bdubbs] - Update to sysstat-12.1.2. Fixes #11506.
[bdubbs] - Update to lxml-4.3.0 (python module). Fixes #11504.
[bdubbs] - Update to librsvg-2.44.11. Fixes #11492.
January 4th, 2019
[renodr] - Update to samba-4.9.4. Fixes six vulnerabilities. In addition, there is a known issue with CNAME resolution as well as smbclient crashes. The next version will resolve this, but for now, update to this one. Fixes #11331.
[bdubbs] - Update to gdb-8.2.1. Fixes #11479.
[bdubbs] - Update to ed-1.15. Fixes #11507.
[bdubbs] - Update to opencv_contrib-3.4.5. Fixes #11473.
January 3rd, 2019
[bdubbs] - Update to smartmontools-7.0. Fixes #11495.
[bdubbs] - Update to mc-4.8.22. Fixes #11502.
[bdubbs] - Update to gobject-introspection-1.58.3. Fixes #11494.
[bdubbs] - Update to doxygen-1.8.15. Fixes #11488.
[bdubbs] - Update to wget-1.20.1. Fixes #11485.
[bdubbs] - Update to ruby-2.6.0. Fixes #11482.
[bdubbs] - Update to LibRaw-0.19.2. Fixes #11477.
[bdubbs] - Update to sshfs-3.5.1. Fixes #11475.
[bdubbs] - Update to fuse-3.4.1. Fixes #11474.
[bdubbs] - Update to LMDB_0.9.23. Fixes #11468.
[bdubbs] - Update to harfbuzz-2.3.0. Fixes #11466.
[bdubbs] - Update to graphite2-1.3.13. Fixes #11465.
[bdubbs] - Update to cups-filters-1.21.6. Fixes #11463.
[bdubbs] - Add iw-4.14. Fixes #9004.
[renodr] - Make polkit a required dependency for colord. Fixes #11481.
January 2nd, 2019
[bdubbs] - Update to exiv2-0.27.0. Fixe #11490.
[bdubbs] - Update to Text-CSV-1.99 (Perl Module). Fixes #11503.
[bdubbs] - Update to Unicode-Collate-1.27 (Perl Module). Fixes #11497.
[bdubbs] - Update to File-Which-1.23 (Perl Module). Fixes #11496.
[bdubbs] - Update to Unicode-LineBreak-2019.001 (Perl Module). Fixes #11493.
[renodr] - Update to dconf-editor-3.30.2. Partially fixes #11090.
[renodr] - Update to dconf-0.30.1. Partially fixes #11090.
[renodr] - Update to Tracker-2.1.6. Partially fixes #11090.
[renodr] - Update to libwnck-3.30.0. Partially fixes #11090.
[renodr] - Update to adwaita-icon-theme-3.30.1. Partially fixes #11090.
[renodr] - Update to Cheese-3.30.0. Partially fixes #11091.
[renodr] - Update patch for liboauth to permit building with OpenSSL-1.1.1x. In addition to rebasing the patch, an additional programming error was corrected, and as a result, rsa/sha1 verification now works, and the test suite now passes. Fixes #11181.
[renodr] - Make liboauth available on sysvinit systems, since Firefox now supports it as an optional dependency.
[dj] - Update to make-ca-1.2 and adjust p11-kit configuration for new copy-trust-modifications script.
[dj] - Correct weekly cron job commands for update-pciids.sh and update-usbids.sh, as well as add update-pki.sh.
January 1st, 2019
[renodr] - Update to gnome-desktop-3.30.2. Partially fixes #11090.
[renodr] - Added Bubblewrap. Fixes #11501. Note that this is only used for gnome-desktop.
[renodr] - Update to vte-0.54.3. Fixes #11435.
[renodr] - Update to WebKitGTK+-2.22.5. Fixes #11374.
[renodr] - Update to libsecret-0.18.7. Fixes #11491.
[renodr] - Update to gjs-1.54.3. Fixes #11276.
[dj] - Update to make-ca-1.1. Complete configuration of P11-Kit trust-extract-compat to utilize both P11-kit and make-ca.
[bdubbs] - Update to nasm-2.14.02. Fixes #11476.
December 29th, 2018
[ken] - Update to Qt-5.12.0 and qtwebengine-5.12.0. Fixes #11415.
[ken] - Slim down the texlive patch by removing the files added for various versions of system poppler. If the use of system poppler is reinstated, we can use conventional patches to apply the changes, instead of adding a file under a new name and then renaming it.
December 28th, 2018
[bdubbs] - Update to vala-0.42.4. Fixes #11467.
[bdubbs] - Update to libgsf-1.14.45. Fixes #11459.
[bdubbs] - Update to DateTime-Calendar-Julian-0.100. Fixes #11472.
[bdubbs] - Update to glib-2.58.2. Fixes #11458.
[bdubbs] - Update to garcon-0.6.2. Fixes #11422.
[bdubbs] - Update to unbound-1.8.3. Fixes #11412.
December 28th, 2018
[bdubbs] - Update to pcmanfm-1.3.1. Fixes #11461.
[bdubbs] - Update to libfm-1.3.1. Partially fixes #11461.
[bdubbs] - Update to xterm-341. Fixes #11480.
[bdubbs] - Update to libinput-1.12.4. Fixes #11460.
[renodr] - Update to Python-3.7.2. Fixes #11478.
[bdubbs] - Update to gnumeric-1.12.44. Fixes #11381.
[bdubbs] - Update to goffice-0.10.44. Fixes #11380.
[bdubbs] - Update to postfix-3.3.2. Fixes #11379.
[timtas] - Update to vlc-3.0.5. Fixes #11487.
[timtas] - Update to openldap-2.4.47. Fixes #11462.
December 27th, 2018
[renodr] - Add an option to GnuTLS to allow it to build with Guile-2.2.4 installed.
December 25th, 2018
[dj] - Update pam_cracklib configuration with modern options and provide replacement configuration with pam_pwqaulity.
December 23rd, 2018
December 22nd, 2018
December 21st, 2018
December 20th, 2018
December 19th, 2018
[renodr] - Fix Inkscape build and generate a consolidated patch to make maintenance easier.
December 17th, 2018
December 16th, 2018
[dj] - Clarify modular configuration of NetworkManager with examples of common and recommended configurations.
[bdubbs] - Update to plasma5-5.14.4. Fixes #11118.
[bdubbs] - Update to kf5-apps-18.12.0 and kwave-18.12.0. Fixes #11098.
[bdubbs] - Update to kf5-5.53. Fixes #11097.
[dj] - Update to NetworkManager-1.14.4. Fixes #11150.
December 14th, 2018
[bdubbs] - Update to node.js-10.14.2. Fixes #11440.
[bdubbs] - Update to gimp-2.10.8. Fixes #11332.
[bdubbs] - Update to librsvg-2.44.10. Fixes #11441.
[bdubbs] - Update to gnutls-3.6.5. Fixes #11414.
[bdubbs] - Update to bind-9.12.3-P1. Fixes #11442.
[bdubbs] - Update to fltk-1.3.4-2. Fixes #11436.
[bdubbs] - Update to boost-1.69.0. Fixes #11443.
[bdubbs] - Update to libatomic_ops-7.6.8. Fixes #11439.
[bdubbs] - Update to List-AllUtils-0.15 (Perl Module). Fixes #11433.
[bdubbs] - Update to Net-DNS-1.19 (Perl Module). Fixes #11363.
[dj] - Update to NetworkManager-1.14.2.
December 13th, 2018
[timtas] - Update to curl-7.63.0. Fixes #11445.
[renodr] - Update to dbus-1.12.12. Syncs to LFS. Fixes #11410.
[renodr] - Update to polkit-0.115. Contains three vulnerability fixes. Fixes #11438.
[bdubbs] - Update to mesa-18.3.1. Fixes #11421.
[bdubbs] - Update to xterm-339. Fixes #11431.
[bdubbs] - Update to nghttp2-1.35.1. Fixes #11429.
[bdubbs] - Update to cups-2.2.10. Fixes #11424.
December 12th, 2018
[ken] - Update to Qt5-5.11.3 and qtwebengine-5.11.3. The qtwebengine changes include security fixes. Fixes #11437.
December 11th, 2018
[bdubbs] - Update to feh-3.1.1. Fixes #11423.
[bdubbs] - Update to vala-0.42.3. Fixes #11324.
[ken] - Update to firefox-64.0 (includes security fixes). Fixes #11432.
[bdubbs] - Update to sqlite-autoconf-3260000. Fixes #11319.
[bdubbs] - Update to libgpg-error-1.33. Fixes #11420.
[bdubbs] - Update to gobject-introspection-1.58.2. Fixes #11426.
[timtas] - Update to thunderbird-60.3.3. Fixes #11417.
December 10th, 2018
December 9th, 2018
[ken] - The Contents part of Qt5 was out of date. Give it a little love.
[bdubbs] - Update to subversion-1.11.0. Fixes #11301.
[bdubbs] - Update to ruby-2.5.3. Fixes #11264.
[bdubbs] - Update to cups-filters-1.21.5. Fixes #11419.
[bdubbs] - Update to poppler-0.72.0. Fixes #11418.
[bdubbs] - Update to btrfs-progs-v4.19.1. Fixes #11416.
[bdubbs] - Update to logrotate-3.15.0. Fixes #11411.
[bdubbs] - Update to nettle-3.4.1. Fixes #11409.
[bdubbs] - Update to git-2.19.2. Fixes #11398.
December 8th, 2018
[bdubbs] - Update to cmake-3.13.1. Fixes #11390.
December 7th, 2018
December 6th, 2018
December 5th, 2018
[bdubbs] - Update to dejagnu-1.6.2. Fixes #11389.
[bdubbs] - Update to nghttp2-1.35.0. Fixes #11376.
[bdubbs] - Update to pangomm-2.42.0. Fixes #11320.
[bdubbs] - Update to feh-3.1. Fixes #11293.
[bdubbs] - Update to xfce4-notifyd-0.4.3. Fixes #11291.
[bdubbs] - Archive openssl10 and add qca patch. Fixes #11407.
[timtas] - Update to thunderbird-60.3.2. Fixes #11394.
December 4th, 2018
[bdubbs] - Update to mlt-6.12.0. Fixes #11387.
[bdubbs] - Update to fdk-aac-2.0.0. Fixes #11377.
[bdubbs] - Update to cups-2.2.9. Fixes #11333.
[bdubbs] - Update to ghostscript-9.26. Fixes #11368.
[ken] - Update to nss-3.40.1 (security fix to mitigate cache side-channel variant of the Bleichenbacher attack). Fixes #11396.
[bdubbs] - Add a patch and fix instructions so sendmail works with openssl-1.1. Fixes #11351.
December 3rd, 2018
December 2nd, 2018
[dj] - Upadte sudo instructions to utilize /etc/sudoers.d directory. Extend configuation where appropriate for needed super user environment variables in QT, KDE, and Java packages. Fixes #11400.
[bdubbs] - Update to sysstat-12.0.2. Fixes #11395.
[bdubbs] - Update to autofs-5.1.5. Fixes #11300.
[bdubbs] - Update to node.js-10.14.1. Fixes #11388.
[dj] - Update to make-ca-1.0. Fixes #11401.
[dj] - Use configuration from bash-completions package if it is installed. Added bash-completion-2.8 to the BLFS wiki. Fixes #11399.
November 30th, 2018
[renodr] - Make cryptsetup dependencies internal in systemd and libgcrypt. Fixes #11384.
[bdubbs] - Update to whois-5.4.0. Fixes #11290.
[bdubbs] - Update to pixman-0.36.0. Fixes #11372.
[bdubbs] - Update to opencv_contrib-3.4.4. Fixes #11359.
[bdubbs] - Update to libwebp-1.0.1. Fixes #11357.
[bdubbs] - Update to librsvg-2.44.9. Fixes #11345.
[bdubbs] - Update to libjpeg-turbo-2.0.1. Fixes #11341.
[bdubbs] - Update to harfbuzz-2.2.0. Fixes #11352.
[bdubbs] - Update to babl-0.1.60. Fixes #11335.
[bdubbs] - Update to LibRaw-0.19.1. Fixes #11375.
[renodr] - Update to TCL and TK versions 8.6.9. Fixes #11354. This fixes a 0day vulnerability according to upstream.
November 29th, 2018
[renodr] - Added dependencies to usbutils and pciutils to allow updating the usb.ids and pci.ids files.
November 25th, 2018
November 25th, 2018
[bdubbs] - Update to acpid-2.0.31. Fixes #11349.
[bdubbs] - Update to tree-1.8.0. Fixes #11353.
[bdubbs] - Update to nasm-2.14. Fixes #11323.
[bdubbs] - Update to atkmm-2.28.0. Fixes #11317.
[bdubbs] - Update to xapian-core-1.4.9. Fixes #11288.
[bdubbs] - Update to wayland-protocols-1.17. Fixes #11365.
[bdubbs] - Update to keyutils-1.6. Fixes #11346.
[bdubbs] - Update to gobject-introspection-1.58.1. Fixes #11356.
[bdubbs] - Update to gmime-3.2.2. Fixes #11292.
[bdubbs] - Update to glibmm-2.58.0. Fixes #11303.
[bdubbs] - Fix instructions for frei0r and remove an incorrect explanation in obencv.
November 24th, 2018
[dj] - Update to systemd-239-6b4878d. Fixes #11367.
[dj] - Use wheel group for sample configuration of sudo.
[dj] - Added pam_wheel.so configuration to
/etc/pam.d/su
.
November 22nd, 2018
[bdubbs] - Update to hdparm-9.58. Fixes #11289.
November 21st, 2018
[ken] - Fix the broken install of mupdf. Fixes #11255.
[renodr] - Add "wheel" group to About System Users and Groups to maintain consistency between LFS and BLFS.
[renodr] - Update to OpenSSL-1.0.2q (vuln fix). Fixes #11364.
[thomas] - Update to libuv-1.24.0. Fixes #11340.
[thomas] - Update to cmake-3.13.0. Fixes #11309.
[thomas] - Update to php-7.2.12. Fixes #11330.
November 20th, 2018
[renodr] - Update to yelp-xsl-3.30.1. Partially fixes #11090.
[renodr] - Update to vte-0.54.2. Partially fixes #11090.
[bdubbs] - Update to tiff-4.0.10. Fixes #11336.
[bdubbs] - Update to libsigc++-2.10.1. Fixes #11299.
[bdubbs] - Update to libgcrypt-1.8.4. Fixes #11287.
[bdubbs] - Update to sudo-1.8.26. Fixes #11344.
[bdubbs] - Update to iptables-1.8.2. Fixes #11343.
[bdubbs] - Update to nano-3.2. Fixes #11339.
[timtas] - Update to thunderbird-60.3.1. Fixes #11347.
November 19th, 2018
November 18th, 2018
[ken] - Fix typo in ExtUtils::LibBuilder version (dependant Perl module) - version should be 0.08 as in BLFS-8.3. Fixes #11358.
[dj] - Modify the distro specific anchor install hook for P11-kit.
November 17th, 2018
[ken] - Update to biber-2.12 with biblatex-3.12. Fixes #11271.
[ken] - Patch Net-SSLeay-1.85 so that its tests do not hang with openssl-1.1.1. Unfortunately, this moves the hang to the tests of IO-Socket-SSL-2.060. Fixes #11209.
[ken] - Merge the perl modules branch. This separates the perl modules into those directly used by other packages in the book, and those which are only mentioned as dependencies of other modules. For each, provide versioned download and md5sum, a summary of what it does, and build instructions. Updated instructions for using cpan to install modules. Fixes #11123.
Add XML::SAX::Expat as yet another optional parser dependency for XML::Simple.
Remove IO::Socket::INET-6 and Socket-6 from the dependencies of Net::DNS (they were dropped from that in v1.16 according to its Changes file). Fixes #11066.
The runtime dependency for URI is HTTP::Message (which was split out of libwww-perl). Fixes #11148.
Module::Runtime can now be built using the conventional process, although it still lists Module::Build as a prerequisite.
Remove Package::Stash::XS from the dependencies of Package::Stash, it is not required.
File::Copy::Recursive - all dependencies are for the testsuite, Test::Exception is not required and Test::utf8 includes a copy of Module::Install, using that requires an 'unsafe' install so delete the dependency on Module::Install.
In libwww-perl - drop the 'Bundle' a.k.a which has not been used for v6, and demote it to a dependency because no non-perl packages directly reference it.
I have attempted to separate the dependencies only needed when running tests, but I have assumed that people will either test a module and all of its dependencies, or not test, so that (like the build dependencies) anything pulled in by an alphabetically-previous dependency of the current module is not specifically listed.
Updated perl dependencies as at 7th November.
Updated to Archive-Zip-1.64. Fixes #11142.
Updated to Business-ISMN-1.201. Fixes #11263.
Updated to Net-DNS-1.18. Fixes #11173.
Updated to libwww-perl-6.36. Fixes #11236.
November 16th, 2018
November 13th, 2018
[ken] - Update to firefox-63.0.1, and re-instate system ICU as recommended. Thanks to Uwe Dueffert for diagnosis. Fixes #11329.
[ken] - Update to Node.js-v10.13.0. Fixes #11328.
[bdubbs] - Update to nss-3.40. Fixes #11281.
[bdubbs] - Update to krb5-1.16.2. Fixes #11308.
[bdubbs] - Update to gnupg-2.2.11. Fixes #11321.
[bdubbs] - Update to cryptsetup-2.0.5. Fixes #11294.
[bdubbs] - Update to ConsoleKit2-1.2.1. Fixes #11297.
November 12th, 2018
November 11th, 2018
[ken] - Stop trying to use system poppler in texlive. Fixes #11338.
November 10th, 2018
November 8th, 2018
November 3rd, 2018
[timtas] - Update to curl-7.62.0. Fixes #11304.
November 2nd, 2018
[ken] - Add a symlink to make-ca so that Perl modules can find the system certificates, and drop module Mozilla::CA. Fixes #11307.
November 1st, 2018
October 29th, 2018
[thomas] - Update to bind-9.12.3. Fixes #11265.
October 28th, 2018
[ken] - Change the firefox instructions: stop recommending system ICU because the build fails with the current version, and change to using clang which saves build space (measurement is for 7.0, but 6.0 is good enough and smaller).
[ken] - Update to xorg-server-1.20.3 [security fix]. Fixes #11284.
October 25th, 2018
October 24th, 2018
October 23rd, 2018
October 21st, 2018
[ken] - Openjpeg-2.3.0 : add patch to ensure shared lib is installed when static lib is not built. Second attempt to fix #11195.
[ken] - Add cbindgen-0.6.6, getting ready for firefox-63. Fixes #11189.
[ken] - sqlite-3.25+ no-longer enables FTS3 as a side effect of enabling FTS4, it needs to be specifically enabled. Fixes #11272.
October 20th, 2018
[ken] - Patch ghostscript for yet more vulnerabilities, exploitable from maliciously crafted PDF or PostScript files. Fixes #11240. My particular thanks go to Douglas for his help with this.
October 18th, 2018
October 16th, 2018
October 15th, 2018
October 13th, 2018
October 13th, 2018
October 11th, 2018
[ken] - Perl module File::ShareDir::Install has only core dependencies. Fixes #11244.
[renodr] - Update to gjs-1.54.1. Fixes #11182.
[renodr] - Update to ModemManager-1.8.2. Fixes #11177.
[thomas] - Make OpenLDAP using modules as .so instead of (removed) .la files. Fixes #11225.
[bdubbs] - Update to volume_key-0.3.12. Fixes #11227.
[renodr] - Update to poppler-0.69.0. Fixes #11172.
October 10th, 2018
[renodr] - Update to sbc-1.4. Fixes #11168>.
October 9th, 2018
[ken] - Patch ghostscript for latest vulnerability, exploitable from evince, gimp and other apps and apparently by browsing in gnome (nautilus will open files in evince-thumbnailer). Fixes #11230.
[bdubbs] - Update to unbound-1.8.1. Fixes #11229.
[bdubbs] - Update to libuv-v1.23.2. Fixes #11228.
[bdubbs] - Update to gpgme-1.12.0. Fixes #11226.
[renodr] - Update to gtk+-3.24.1. Fixes #11163.
[renodr] - Replace gnome-themes-standard with gnome-themes-extra (Upstream renamed it), and updated gnome-themes-extra to 3.28. Thanks goes to Xi to reporting. Fixes #11187.
[bdubbs] - Update to mariadb-10.3.10. Fixes #11214.
[bdubbs] - Update to cmake-3.12.3. Fixes #11206.
[bdubbs] - Update to mercurial-4.7.2. Fixes #11201.
[bdubbs] - Install a lightdm support file with fixes to ensure the system environment matches the environment when starting the graphical interface from the command line. Fixes #11154.
[ken] - Update texlive patch (security fix) and allow it to build with both poppler-0.68.0 and -0.69.0. Fixes #11223.
October 8th, 2018
[bdubbs] - Update to v4l-utils-1.16.0. Fixes #11220.
[bdubbs] - Update to babl-0.1.58. Fixes #11218.
[bdubbs] - Update to highlight-3.46. Fixes #11222.
[renodr] - Update to adwaita-icon-theme-3.30.0. Fixes #11186.
[bdubbs] - Update to zsh-5.6.2. Fixes #11132.
[bdubbs] - Update to unbound-1.8.0. Fixes #11135.
[bdubbs] - Update to mupdf-1.14.0. Fixes #11215.
October 7th, 2018
[thomas] - Update to dovecot-2.3.3. Fixes #11202.
[bdubbs] - Update to unrar-5.6.8. Fixes #11213.
[bdubbs] - Update to udisks-2.8.1. Fixes #11192.
[bdubbs] - Update to libblockdev-2.20. Fixes #11190.
[bdubbs] - Update to nghttp2-1.34.0. Fixes #11207.
[bdubbs] - Update to x265-2.9. Fixes #11219.
[bdubbs] - Update to liblinear-221. Fixes #11212.
[bdubbs] - Update to ghostscript-9.25. Fixes #11147.
[bdubbs] - Update to lxterminal-0.3.2. Fixes #11178.
[bdubbs] - Update to feh-2.28. Fixes #11160.
[bdubbs] - Update to lib{burn,isoburn,isofs}-1.5.0. Fixes #11158.
[bdubbs] - Update to tumbler-0.2.3. Fixes #11145.
October 6th, 2018
[ken] - note that tests for both IO::Socket::SSL and its dependency of Net::SSLeay are broken with openssl-1.1.1.
[ken] - IO::Socket::SSL needs 'yes' if scripting, and should require ca-certificates. Fixes #11216.
[renodr] - Update to libsoup-2.64.1. In addition, a flag was added to the meson line to disable GSSAPI support, as it's set by default and requires Kerberos to be installed. Fixes #11196 and #11184.
[renodr] - Update to json-glib-1.4.4. Fixes #11159.
[bdubbs] - Update to gstreamer-1.14.4 (and plugins). Fixes #11157.
[thomas] - Update to php-7.2.10. Fixes #11143.
[thomas] - Update to httpd-2.4.35. Fixes #11174.
October 5th, 2018
[bdubbs] - Update to libreoffice-6.1.2.1. Fixes #11146.
[renodr] - Update to git-2.19.1. This is a security update for CVE-2018-17456, which allows attackers to execute code via .gitmodules. An update is available for minor versions all the way back to 2.14.5. This update should be treated as urgent. Fixes #11217.
[renodr] - Update to xterm-337. Fixes #11167.
[renodr] - Update to xf86-video-ati-18.1.0. Fixes #11051. This driver update solves issues with GNOME and KDE Plasma on devices with ATI cards installed.
[renodr] - Update to xf86-video-amdgpu-18.1.0. Fixes #11149.
[renodr] - Update to libinput-1.12.1. Fixes #11136.
[renodr] - Update to libepoxy-1.5.3. Fixes #11210.
[renodr] - Update to libdrm-2.4.95. Fixes #11211.
[renodr] - Update to wayland-protocols-1.16. Fixes #11138.
[renodr] - Update to Mesa-18.2.2. Fixes #11175.
[renodr] - Update to harfbuzz-1.9.0. Fixes #11133.
[renodr] - Update to libxcb-1.13.1. Fixes #11194.
[renodr] - Update to git-2.19.0. Fixes #11134.
October 4th, 2018
[renodr] - Require MIT KRB5 in keyutils.
[renodr] - Update to apr-1.6.5. Fixes #11151.
[renodr] - Update to vala-0.42.2. Fixes #11161.
[renodr] - Update to glib-2.58.1. Fixes #11208.
[renodr] - Update to highlight-3.45. Fixes #11302.
[renodr] - Update to unrar-5.6.7. Fixes #11200.
[renodr] - Update to sg3_utils-1.44. Fixes #11141.
[renodr] - Update to IO::Socket:SSL-2.060 (Perl Module). Fixes #11155.
[renodr] - Update to pcre2-10.32. Fixes #11137.
[renodr] - Update to sqlite-3.25.2. Fixes #11153.
October 3rd, 2018
[renodr] - Update to libuv-1.23.1. Fixes #11171.
[ken] - Perl module List::AllUtils does not use Number::Compare or Text::Glob, and Test::LeakTrace no longer needs the 'unsafe' variant of the standard installation.
[renodr] - Update to gc-8.0.0. Fixes #11156.
[renodr] - Fix build instructions in js60 - add a missing "\". Fixes #11197. Thanks, Spiky!
[ken] - Update to firefox-62.0.3 (security fixes). Fixes #11205.
[thomas] - Export CFLAGS in dhcp to avoid a compile error caused by new versions of gcc. Fixes #11199.
[thomas] - Use stable branch (9.12.2-P2) for bind and bind-utils. Fixes #11166.
October 2nd, 2018
[ken] - Perl module XML::LibXML::Simple stopped using File::Slurp::Tiny a while ago.
October 1st, 2018
[ken] - Update to llvm-7.0.0 Fixes #11165.
September 30th, 2018
September 27th, 2018
September 26th, 2018
[ken] - perl module Business::ISBN has stopped requiring Mojolicious - noted from Changes in the current version.
September 25th, 2018
[renodr] - Add Jansson for Samba. Fixes #11183.
September 23rd, 2018
[ken] - Data::Uniqid (perl module) no longer requires a patch to remove a failing test - in currnet perl-5.28.0 the fourth test still fails but 'make check' returns a status of 0 despite this.
[ken] - Update to firefox-62.0.2 (includes security fix). Fixes #11179.
[renodr] - Update to WebKitGTK+-2.22.2. Fixes #11107. WebM playback and YouTube playback is still broken until gstreamer and Epiphany get updated.
September 22nd, 2018
September 19th, 2018
September 18th, 2018
[ken] - In Samba, perl module Parse::Yapp was misidentified as now being part of perl - it can be pulled in for some other module when using cpan shell. Reinstate it as recommended and add its program yapp to the files installed by perl modules.
September 15th, 2018
[thomas] - Fix instructions in rpcbind. Fixes #11152.
September 11th, 2018
[thomas] - Update to nano-3.0. Fixes #11130.
September 10th, 2018
[ken] - Wayne reported that --enable-system-hunspell is no longer recognized by firefox. Removed.
[bdubbs] - Update to lxml-4.2.5 (Python module). Fixes #11131.
[bdubbs] - Update to mesa-18.2.0. Fixes #11127.
[bdubbs] - Update to vlc-3.0.4. Fixes #11089.
[bdubbs] - Update to ghostscript-9.24. Fixes #11108.
[bdubbs] - Update to wireshark-2.6.3. Fixes #11082.
[bdubbs] - Update to lightdm-1.28.0/lightdm-gtk-greeter-2.0.5. Fixes #11050.
September 9th, 2018
[bdubbs] - Update to soundtouch-2.1.0. Fixes #11129.
[bdubbs] - Update to PNMixer-0.7.2. Fixes #11071.
[bdubbs] - Update to tumbler-0.2.2. Fixes #11128.
[bdubbs] - Update to opencv-3.4.3. Fixes #11081.
[bdubbs] - Update to cmake-3.12.2. Fixes #11124.
[bdubbs] - Update to mercurial-4.7.1. Fixes #11117.
[bdubbs] - Update to curl-7.61.1. Fixes #11113.
[bdubbs] - Update to libdrm-2.4.94. Fixes #11054.
[bdubbs] - Update to poppler-0.68.0. Fixes #11047.
September 8th, 2018
[bdubbs] - Update to gdb-8.2. Fixes #11112.
[bdubbs] - Update to unrar-5.6.6. Fixes #11101.
[bdubbs] - Update to links-2.17. Fixes #11126.
[bdubbs] - Update to nfs-utils-2.3.3. Fixes #11125.
[bdubbs] - Add instructions for regression tests to keyutils. Completes #11073.
[renodr] - Update to atk-2.30.0. Fixes #11070.
[renodr] - Update to gjs-1.54.0. Fixes #11093.
[renodr] - Update to geoclue-2.4.12. Fixes #11027.
[renodr] - Add mozjs60 for gjs. Fixes #11110.
September 6th, 2018
[renodr] - Update to gtk+-3.24.0. Fixes #11106.
[renodr] - Update to gdk-pixbuf-2.38.0. Fixes #11105.
[renodr] - Update to pyatspi2-2.30.0. Fixes #11102.
[renodr] - Update to at-spi2-atk/at-spi2-core-2.30.0. Fixes #11104.
[renodr] - Update to gsettings-desktop-schemas-3.28.1. Partially fixes #11090.
[renodr] - Added libpsl. Fixes #11121.
[renodr] - Update to libsoup-2.64.0. Fixes #11103.
[renodr] - Update to glib-networking-2.58.0. Fixes #11094.
[bdubbs] - Update to libarchive-3.3.3. Fixes #11115.
[bdubbs] - Update to keyutils-1.5.11. Fixes #11073.
[bdubbs] - Update to stunnel-5.49. Fixes #11099.
[bdubbs] - Update to zsh-5.6. Fixes #11100.
[thomas] - Update to tidy-html5-5.6.0. Fixes #11109.
[dj] - Update to make-ca-0.9. Fixes #11114.
September 5th, 2018
[bdubbs] - Update to iso-codes-4.1. Fixes #11116.
[bdubbs] - Update to fuse-3.2.6. Fixes #11087.
[bdubbs] - Update to gnupg-2.2.10. Fixes #11084.
[bdubbs] - Update to p11-kit-0.23.14. Fixes #11072.
[bdubbs] - Update to sysstat-11.6.5. Fixes #11078.
[bdubbs] - Update to nspr-4.20. Fixes #11074.
[bdubbs] - Update to xfsprogs-4.18.0. Fixes #11057.
[ken] - Update to firefox-62.0. Fixes #11111.
[renodr] - Update to vala-0.42.0. Fixes #11042.
[renodr] - Update to samba-4.8.5. Fixes #11059.
September 4th, 2018
September 3rd, 2018
[bdubbs] - Update to gtk-doc-1.29. Fixes #11075.
[bdubbs] - Update to wayland-1.16.0. Fixes #11058.
[bdubbs] - Update to nghttp2-1.33.0. Fixes #11064.
[bdubbs] - Update to fontconfig-2.13.1. Fixes #11085.
[bdubbs] - Update to pango-1.42.4. Fixes #11044.
[bdubbs] - Update to openssh-7.8p1 (includes ssh-askpass-7.8p1). Fixes #11052.
[bdubbs] - Update to sudo-1.8.25. Fixes #11032.
[thomas] - Update to at-3.1.23. Fixes #11077.
[thomas] - Update to dhcpcd-7.0.8. Fixes #11043.
September 2nd, 2018
[ken] - The command to build firefox is './mach build' not './mach'. Apologies to everyone who hits this.
[bdubbs] - Update to nss-3.39. Fixes #11086.
[bdubbs] - Update to hexchat-2.14.2. Fixes #11083.
[bdubbs] - Update to libuv-v1.23.0. Fixes #11025.
[bdubbs] - Update to iso-codes-4.0. Fixes #11063.
[bdubbs] - Update to rpcbind-1.25. Fixes #11024.
[bdubbs] - Update to libtirpc-1.1.4. Fixes #11069.
[bdubbs] - Update to Archive-Zip-1.63 (Perl Module). Fixes #11053.
[bdubbs] - Update to Text-CSV-1.97 (Perl Module). Fixes #11030.
September 1st, 2018
[bdubbs] - Release of BLFS-8.3.
Last updated on 2019-02-28 11:44:59 -0800
The linuxfromscratch.org server is hosting a number of mailing lists that are used for the development of the BLFS book. 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/mail.html.
Last updated on 2007-04-04 12:42:53 -0700
The BLFS Project has created a Wiki for users to comment on pages and instructions at http://wiki.linuxfromscratch.org/blfs/wiki. Comments are welcome from all users.
The following are the rules for posting:
Users must register and log in to edit a page.
Suggestions to change the book should be made by creating a new ticket, not by making comments in the Wiki.
Questions with your specific installation problems should be made by subscribing and mailing to the BLFS Support Mailing List at mailto:blfs-support AT linuxfromscratch D0T org.
Discussions of build instructions should be made by subscribing and mailing to the BLFS Development List at mailto:blfs-dev AT linuxfromscratch D0T org.
Inappropriate material will be removed.
Last updated on 2007-04-04 12:42:53 -0700
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.
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 modprobe.conf
and has it been loaded?
You should use lsmod as the
root
user to see if
it's loaded. Check the sys.log
file or run modprobe <driver>
to review any error message. If it loads properly, you
may need to add the modprobe command 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 usermod -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 ...” requires a thorough review
of permissions prior to asking.
BLFS liberally uses /opt/
.
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 most
cases, the package instructions will walk you through
the changes, but some will not. The section called
“Going Beyond
BLFS” is available to help you check.
<package>
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 8.4),
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,
if you are installing a BLFS package on a non-LFS system.
(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.
Last updated on 2009-09-24 22:43:37 -0700
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 a line. Many thanks to all of the LFS community for their assistance with this project.
Bruce Dubbs
Pierre Labastie
DJ Lucas
Ken Moffat
Douglas Reno
The list of contributors is far too large to provide detailed information about the contributions for each contributor. Over the years, the following individuals have provided significant inputs to the book:
Timothy Bauscher
Daniel Bauman
Jeff Bauman
Andy Benton
Wayne Blaszczyk
Paul Campbell
Nathan Coulson
Jeroen Coumans
Guy Dalziel
Robert Daniels
Richard Downing
Manuel Canales Esparcia
Jim Gifford
Manfred Glombowski
Ag Hatzimanikas
Mark Hymers
James Iwanek
David Jensen
Jeremy Jones
Seth Klein
Alex Kloss
Eric Konopka
Larry Lawrence
Chris Lynn
Andrew McMurry
Randy McMurchy
Denis Mugnier
Billy O'Connor
Fernando de Oliveira
Alexander Patrakov
Olivier Peres
Andreas Pedersen
Henning Rohde
Matt Rogers
James Robertson
Henning Rohde
Chris Staub
Jesse Tie-Ten-Quee
Ragnar Thomsen
Thomas Trepl
Tushar Teredesai
Jeremy Utley
Zack Winkles
Christian Wurst
Igor Živković
Fernando Arbeiza
Miguel Bazdresch
Gerard Beekmans
Oliver Brakmann
Jeremy Byron
Ian Chilton
David Ciecierski
Jim Harris
Lee Harris
Marc Heerdink
Steffen Knollmann
Eric Konopka
Scot McPherson
Ted Riley
Last updated on 2018-09-01 14:51:57 -0700
Please direct your emails to one of the BLFS mailing lists. See Mailing lists for more information on the available mailing lists.
Last updated on 2012-02-05 21:15:51 -0800
This chapter is used to explain some of the policies used throughout the book, to introduce important concepts and to explain some issues you may see with some of the included packages.
Those people who have built an LFS system may be aware of the general principles of downloading and unpacking software. Some of that information is repeated here for those new to building their own software.
Each set of installation instructions contains a URL from which you can download the package. The patches; however, are stored on the LFS servers and are available via HTTP. These are referenced as needed in the installation instructions.
While you can keep the source files anywhere you like, we assume that you have unpacked the package and changed into the directory created by the unpacking process (the 'build' directory). We also assume you have uncompressed any required patches and they are in the directory immediately above the 'build' directory.
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 during
configuration or compilation, 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
Makefile
s and C code, but if in
doubt, start from a clean tree.
The golden rule of Unix System Administration is to use your
superpowers only when necessary. Hence, BLFS recommends that
you build software as an unprivileged user and only become
the root
user when installing
the software. This philosophy is followed in all the packages
in this book. Unless otherwise specified, all instructions
should be executed as an unprivileged user. The book will
advise you on instructions that need root
privileges.
If a file is in .tar
format and
compressed, it is unpacked by running one of the following
commands:
tar -xvf filename.tar.gz tar -xvf filename.tgz tar -xvf filename.tar.Z tar -xvf filename.tar.bz2
You may omit using the v
parameter in the commands shown above and below if you wish
to suppress the verbose listing of all the files in the
archive as they are extracted. This can help speed up the
extraction as well as make any errors produced during the
extraction more obvious to you.
You can also use a slightly different method:
bzcat filename.tar.bz2 | tar -xv
Finally, you sometimes need to be able to unpack patches
which are generally not in .tar
format. The best way to do this is to copy the patch file to
the parent of the 'build' directory and then run one of the
following commands depending on whether the file is a
.gz
or .bz2
file:
gunzip -v patchname.gz bunzip2 -v patchname.bz2
Generally, to verify that the downloaded file is genuine and
complete, many package maintainers also distribute md5sums of
the files. To verify the md5sum of the downloaded files,
download both the file and the corresponding md5sum file to
the same directory (preferably from different on-line
locations), and (assuming file.md5sum
is the md5sum file downloaded)
run the following command:
md5sum -c file.md5sum
If there are any errors, they will be reported. Note that the
BLFS book includes md5sums for all the source files also. To
use the BLFS supplied md5sums, you can create a file.md5sum
(place the md5sum data and the
exact name of the downloaded file on the same line of a file,
separated by white space) and run the command shown above.
Alternately, simply run the command shown below and compare
the output to the md5sum data shown in the BLFS book.
md5sum <name_of_downloaded_file>
For larger packages, it is convenient to create log files
instead of staring at the screen hoping to catch a particular
error or warning. Log files are also useful for debugging and
keeping records. The following command allows you to create
an installation log. Replace <command>
with the
command you intend to execute.
( <command>
2>&1 | tee compile.log && exit $PIPESTATUS )
2>&1
redirects error
messages to the same location as standard output. The
tee command
allows viewing of the output while logging the results to a
file. The parentheses around the command run the entire
command in a subshell and finally the exit $PIPESTATUS command
ensures the result of the <command>
is returned
as the result and not the result of the tee command.
For many modern systems with multiple processors (or cores) the compilation time for a package can be reduced by performing a "parallel make" by either setting an environment variable or telling the make program how many processors are available. For instance, a Core2Duo can support two simultaneous processes with:
export MAKEFLAGS='-j2'
or just building with:
make -j2
Generally the number of processes should not exceed the
number of cores supported by the CPU. To list the processors
on your system, issue: grep
processor /proc/cpuinfo
.
In some cases, using multiple processors may result in a 'race' condition where the success of the build depends on the order of the commands run by the make program. For instance, if an executable needs File A and File B, attempting to link the program before one of the dependent components is available will result in a failure. This condition usually arises because the upstream developer has not properly designated all the prerequisites needed to accomplish a step in the Makefile.
If this occurs, the best way to proceed is to drop back to a single processor build. Adding '-j1' to a make command will override the similar setting in the MAKEFLAGS environment variable.
When running the package tests or the install portion of the package build process, we do not recommend using an option greater than '-j1' unless specified otherwise. The installation procedures or checks have not been validated using parallel procedures and may fail with issues that are difficult to debug.
There are times when automating the building of a package can
come in handy. Everyone has their own reasons for wanting to
automate building, and everyone goes about it in their own
way. Creating Makefile
s,
Bash scripts, Perl scripts or simply a list of
commands used to cut and paste are just some of the methods
you can use to automate building BLFS packages. Detailing how
and providing examples of the many ways you can automate the
building of packages is beyond the scope of this section.
This section will expose you to using file redirection and
the yes command
to help provide ideas on how to automate your builds.
You will find times throughout your BLFS journey when you will come across a package that has a command prompting you for information. This information might be configuration details, a directory path, or a response to a license agreement. This can present a challenge to automate the building of that package. Occasionally, you will be prompted for different information in a series of questions. One method to automate this type of scenario requires putting the desired responses in a file and using redirection so that the program uses the data in the file as the answers to the questions.
Building the CUPS package is a good example of how redirecting a file as input to prompts can help you automate the build. If you run the test suite, you are asked to respond to a series of questions regarding the type of test to run and if you have any auxiliary programs the test can use. You can create a file with your responses, one response per line, and use a command similar to the one shown below to automate running the test suite:
make check < ../cups-1.1.23-testsuite_parms
This effectively makes the test suite use the responses in the file as the input to the questions. Occasionally you may end up doing a bit of trial and error determining the exact format of your input file for some things, but once figured out and documented you can use this to automate building the package.
Sometimes you will only need to provide one response, or provide the same response to many prompts. For these instances, the yes command works really well. The yes command can be used to provide a response (the same one) to one or more instances of questions. It can be used to simulate pressing just the Enter key, entering the Y key or entering a string of text. Perhaps the easiest way to show its use is in an example.
First, create a short Bash script by entering the following commands:
cat > blfs-yes-test1 << "EOF"
#!/bin/bash
echo -n -e "\n\nPlease type something (or nothing) and press Enter ---> "
read A_STRING
if test "$A_STRING" = ""; then A_STRING="Just the Enter key was pressed"
else A_STRING="You entered '$A_STRING'"
fi
echo -e "\n\n$A_STRING\n\n"
EOF
chmod 755 blfs-yes-test1
Now run the script by issuing ./blfs-yes-test1 from the command line. It will wait for a response, which can be anything (or nothing) followed by the Enter key. After entering something, the result will be echoed to the screen. Now use the yes command to automate the entering of a response:
yes | ./blfs-yes-test1
Notice that piping yes by itself to the script results in y being passed to the script. Now try it with a string of text:
yes 'This is some text' | ./blfs-yes-test1
The exact string was used as the response to the script. Finally, try it using an empty (null) string:
yes '' | ./blfs-yes-test1
Notice this results in passing just the press of the Enter key to the script. This is useful for times when the default answer to the prompt is sufficient. This syntax is used in the Net-tools instructions to accept all the defaults to the many prompts during the configuration step. You may now remove the test script, if desired.
In order to automate the building of some packages, especially those that require you to read a license agreement one page at a time, requires using a method that avoids having to press a key to display each page. Redirecting the output to a file can be used in these instances to assist with the automation. The previous section on this page touched on creating log files of the build output. The redirection method shown there used the tee command to redirect output to a file while also displaying the output to the screen. Here, the output will only be sent to a file.
Again, the easiest way to demonstrate the technique is to show an example. First, issue the command:
ls -l /usr/bin | more
Of course, you'll be required to view the output one page at
a time because the more filter was used. Now
try the same command, but this time redirect the output to a
file. The special file /dev/null
can be used instead of the
filename shown, but you will have no log file to examine:
ls -l /usr/bin | more > redirect_test.log 2>&1
Notice that this time the command immediately returned to the shell prompt without having to page through the output. You may now remove the log file.
The last example will use the yes command in combination with output redirection to bypass having to page through the output and then provide a y to a prompt. This technique could be used in instances when otherwise you would have to page through the output of a file (such as a license agreement) and then answer the question of “do you accept the above?”. For this example, another short Bash script is required:
cat > blfs-yes-test2 << "EOF"
#!/bin/bash
ls -l /usr/bin | more
echo -n -e "\n\nDid you enjoy reading this? (y,n) "
read A_STRING
if test "$A_STRING" = "y"; then A_STRING="You entered the 'y' key"
else A_STRING="You did NOT enter the 'y' key"
fi
echo -e "\n\n$A_STRING\n\n"
EOF
chmod 755 blfs-yes-test2
This script can be used to simulate a program that requires you to read a license agreement, then respond appropriately to accept the agreement before the program will install anything. First, run the script without any automation techniques by issuing ./blfs-yes-test2.
Now issue the following command which uses two automation techniques, making it suitable for use in an automated build script:
yes | ./blfs-yes-test2 > blfs-yes-test2.log 2>&1
If desired, issue tail blfs-yes-test2.log to see the end of the paged output, and confirmation that y was passed through to the script. Once satisfied that it works as it should, you may remove the script and log file.
Finally, keep in mind that there are many ways to automate and/or script the build commands. There is not a single “correct” way to do it. Your imagination is the only limit.
For each package described, BLFS lists the known dependencies. These are listed under several headings, whose meaning is as follows:
Required means that the target package cannot be correctly built without the dependency having first been installed.
Recommended means that BLFS strongly suggests this package is installed first for a clean and trouble-free build, that won't have issues either during the build process, or at run-time. The instructions in the book assume these packages are installed. Some changes or workarounds may be required if these packages are not installed.
Optional means that this package might be installed for added functionality. Often BLFS will describe the dependency to explain the added functionality that will result.
On occasion you may run into a situation in the book when a package will not build or work properly. Though the Editors attempt to ensure that every package in the book builds and works properly, sometimes a package has been overlooked or was not tested with this particular version of BLFS.
If you discover that a package will not build or work properly, you should see if there is a more current version of the package. Typically this means you go to the maintainer's web site and download the most current tarball and attempt to build the package. If you cannot determine the maintainer's web site by looking at the download URLs, use Google and query the package's name. For example, in the Google search bar type: 'package_name download' (omit the quotes) or something similar. Sometimes typing: 'package_name home page' will result in you finding the maintainer's web site.
In LFS, stripping of debugging symbols was discussed a couple of times. When building BLFS packages, there are generally no special instructions that discuss stripping again. It is probably not a good idea to strip an executable or a library while it is in use, so exiting any windowing environment is a good idea. Then you can do:
find /{,usr/}{bin,lib,sbin} \ -type f \( -name \*.so* -a ! -name \*dbg \) \ -exec strip --strip-unneeded {} \;
If you install programs in other directories such as
/opt
or /usr/local
, you may want to strip the files
there too.
For more information on stripping, see http://www.technovelty.org/linux/stripping-shared-libraries.html.
Last updated on 2019-02-26 20:49:50 -0800
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 manage. The only really hard and
fast rule is that Unix distributions should not touch
/usr/local
, except perhaps to
create 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
with optional instructions to install
into /opt
for some specific
packages.
Last updated on 2007-04-04 12:42:53 -0700
As you follow the various sections in the book, you will observe that the book occasionally includes 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 (including the patches referenced in the books) to enable you to configure your LFS the way you like it.
Last updated on 2007-04-04 12:42:53 -0700
The BLFS Bootscripts package contains the init scripts that are used throughout the book. It is assumed that you will be using the BLFS Bootscripts package in conjunction with a compatible LFS-Bootscripts package. Refer to ../../../../lfs/view/8.4/chapter07/bootscripts.html for more information on the LFS-Bootscripts package.
Package Information
The BLFS Bootscripts package will be used throughout the BLFS
book for startup scripts. Unlike LFS, each init script has a
separate install target in the BLFS Bootscripts package. It is
recommended you keep the package source directory around until
completion of your BLFS system. When a script is requested from
BLFS Bootscripts, simply change to the directory and as the
root
user, execute the given
make install-<init-script>
command. This command installs the init script to its proper
location (along with any auxiliary configuration scripts) and
also creates the appropriate symlinks to start and stop the
service at the appropriate run-level.
You should review each bootscript before installation to ascertain that it satisfies your need. Also verify that the start and stop symlinks it creates match your preferences.
From time to time the bootscripts are updated to accommodate new packages or to make minor corrections. All versions of the bootscripts are located at http://anduin.linuxfromscratch.org/BLFS/blfs-bootscripts/.
Last updated on 2016-08-28 02:28:15 -0700
In LFS we installed a package, libtool, that is used by many packages to build on a variety of Unix platforms. This includes platforms such as AIX, Solaris, IRIX, HP-UX, and Cygwin as well as Linux. The origins of this tool are quite dated. It was intended to manage libraries on systems with less advanced capabilities than a modern Linux system.
On a Linux system, libtool specific files are generally unneeded. Normally libraries are specified in the build process during the link phase. Since a linux system uses the Executable and Linkable Format (ELF) for executables and libraries, information needed to complete the task is embedded in the files. At run time the program loader can query the appropriate files and properly load and execute the program.
The problem is that libtool usually creates one or more text files for package libraries called libtool archives. These small files have a ".la" extention and contain information that is similar to that embedded in the libraries. When building a package that uses libtool, the process automatically looks for these files. If a package is updated and no longer uses the .la file, then the build process can break.
The solution is to remove the .la files. However there is a catch. Some packages, such as ImageMagick-7.0.8-27, use a libtool function, lt_dlopen, to load libraries as needed during execution and resolve their dependencies at run time. In this case, the .la files should remain.
The script below, removes all unneeded .la files and saves them in a directory, /var/local/la-files by default, not in the normal library path. It also searches all pkg-config files (.pc) for embedded references to .la files and fixes them to be conventional library references needed when an application or library is built. It can be run as needed to clean up the directories that may be causing problems.
cat > /usr/sbin/remove-la-files.sh << "EOF"
#!/bin/bash
# /usr/sbin/remove-la-files.sh
# Written for Beyond Linux From Scratch
# by Bruce Dubbs <bdubbs@linuxfromscratch.org>
# Make sure we are running with root privs
if test "${EUID}" -ne 0; then
echo "Error: $(basename ${0}) must be run as the root user! Exiting..."
exit 1
fi
# Make sure PKG_CONFIG_PATH is set if discarded by sudo
source /etc/profile
OLD_LA_DIR=/var/local/la-files
mkdir -p $OLD_LA_DIR
# Only search directories in /opt, but not symlinks to directories
OPTDIRS=$(find /opt -mindepth 1 -maxdepth 1 -type d)
# Move any found .la files to a directory out of the way
find /usr/lib $OPTDIRS -name "*.la" ! -path "/usr/lib/ImageMagick*" \
-exec mv -fv {} $OLD_LA_DIR \;
###############
# Fix any .pc files that may have .la references
STD_PC_PATH='/usr/lib/pkgconfig
/usr/share/pkgconfig
/usr/local/lib/pkgconfig
/usr/local/share/pkgconfig'
# For each directory that can have .pc files
for d in $(echo $PKG_CONFIG_PATH | tr : ' ') $STD_PC_PATH; do
# For each pc file
for pc in $d/*.pc ; do
if [ $pc == "$d/*.pc" ]; then continue; fi
# Check each word in a line with a .la reference
for word in $(grep '\.la' $pc); do
if $(echo $word | grep -q '.la$' ); then
mkdir -p $d/la-backup
cp -fv $pc $d/la-backup
basename=$(basename $word )
libref=$(echo $basename|sed -e 's/^lib/-l/' -e 's/\.la$//')
# Fix the .pc file
sed -i "s:$word:$libref:" $pc
fi
done
done
done
EOF
chmod +x /usr/sbin/remove-la-files.sh
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/la-files
Last updated on 2017-12-23 07:56:03 -0800
The original libraries were simply an archive of routines from which the required routines were extracted and linked into the executable program. These are described as static libraries (libfoo.a). On some old operating systems they are the only type available.
On almost all Linux platforms there are also shared libraries (libfoo.so) - one copy of the library is loaded into virtual memory, and shared by all the programs which call any of its functions. This is space efficient.
In the past, essential programs such as a shell were often
linked statically so that some form of minimal recovery
system would exist even if shared libraries, such as libc.so,
became damaged (e.g. moved to lost+found
after fsck following an unclean
shutdown). Nowadays, most people use an alternative system
install or a Live CD if they have to recover. Journaling
filesystems also reduce the likelihood of this sort of
problem.
Developers, at least while they are developing, often prefer to use static versions of the libraries which their code links to.
Within the book, there are various places where configure switches such as --disable-static are employed, and other places where the possibility of using system versions of libraries instead of the versions included within another package is discussed. The main reason for this is to simplify updates of libraries.
If a package is linked to a dynamic library, updating to a newer library version is automatic once the newer library is installed and the program is (re)started (provided the library major version is unchanged, e.g. going from libfoo.so.2.0 to libfoo.so.2.1. Going to libfoo.so.3 will require recompilation - ldd can be used to find which programs use the old version). If a program is linked to a static library, the program always has to be recompiled. If you know which programs are linked to a particular static library, this is merely an annoyance. But usually you will not know which programs to recompile.
Most libraries are shared, but if you do something unusual,
such as moving a shared library to /lib
accidentally breaking the .so
symlink in /usr/lib
while keeping the static library
in /lib
, the static library
will be silently linked into the programs which need it.
One way to identify when a static library is used, is to deal
with it at the end of the installation of every package.
Write a script to find all the static libraries in
/usr/lib
or wherever you are
installing to, and either move them to another directory so
that they are no longer found by the linker, or rename them
so that libfoo.a becomes e.g. libfoo.a.hidden. The static
library can then be temporarily restored if it is ever
needed, and the package needing it can be identified. You may
choose to exclude some of the static libraries from glibc if
you do this (libc_nonshared.a, libg.a,
libieee.a, libm.a, libpthread_nonshared.a, librpcsvc.a,
libsupc++.a
) to simplify compilation.
If you use this approach, you may discover that more packages than you were expecting use a static library. That was the case with nettle-2.4 in its default static-only configuration: It was required by GnuTLS-3.0.19, but also linked into package(s) which used GnuTLS, such as glib-networking-2.32.3.
Many packages put some of their common functions into a static library which is only used by the programs within the package and, crucially, the library is not installed as a standalone library. These internal libraries are not a problem - if the package has to be rebuilt to fix a bug or vulnerability, nothing else is linked to them.
When BLFS mentions system libraries, it means shared versions of libraries. Some packages such as Firefox-65.0.1 and ghostscript-9.26 include many other libraries. When they link to them, they link statically so this also makes the programs bigger. The version they ship is often older than the version used in the system, so it may contain bugs - sometimes developers go to the trouble of fixing bugs in their included libraries, other times they do not.
Sometimes, deciding to use system libraries is an easy decision. Other times it may require you to alter the system version (e.g. for libpng-1.6.36 if used for Firefox-65.0.1). Occasionally, a package ships an old library and can no longer link to the current version, but can link to an older version. In this case, BLFS will usually just use the shipped version. Sometimes the included library is no longer developed separately, or its upstream is now the same as the package's upstream and you have no other packages which will use it. In those cases, you might decide to use the included static library even if you usually prefer to use system libraries.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/libraries
Last updated on 2015-09-20 15:38:20 -0700
This page contains information about locale related problems and issues. In the following paragraphs you'll find a generic overview of things that can come up when configuring your system for various locales. Many (but not all) existing locale related problems can be classified and fall under one of the headings below. The severity ratings below use the following criteria:
Critical: The program doesn't perform its main function. The fix would be very intrusive, it's better to search for a replacement.
High: Part of the functionality that the program provides is not usable. If that functionality is required, it's better to search for a replacement.
Low: The program works in all typical use cases, but lacks some functionality normally provided by its equivalents.
If there is a known workaround for a specific package, it will appear on that package's page. For the most recent information about locale related issues for individual packages, check the User Notes in the BLFS Wiki.
Severity: Critical
Some programs require the user to specify the character
encoding for their input or output data and present only a
limited choice of encodings. This is the case for the
-X
option in a2ps-4.14 and Enscript-1.6.6, the -input-charset
option in unpatched Cdrtools-3.02a09, and the character
sets offered for display in the menu of Links-2.18. If the required
encoding is not in the list, the program usually becomes
completely unusable. For non-interactive programs, it may be
possible to work around this by converting the document to a
supported input character set before submitting to the
program.
A solution to this type of problem is to implement the necessary support for the missing encoding as a patch to the original program or to find a replacement.
Severity: High for non-text documents, low for text documents
Some programs, nano-3.2 or JOE-4.6 for example, assume that documents are always in the encoding implied by the current locale. While this assumption may be valid for the user-created documents, it is not safe for external ones. When this assumption fails, non-ASCII characters are displayed incorrectly, and the document may become unreadable.
If the external document is entirely text based, it can be converted to the current locale encoding using the iconv program.
For documents that are not text-based, this is not possible. In fact, the assumption made in the program may be completely invalid for documents where the Microsoft Windows operating system has set de facto standards. An example of this problem is ID3v1 tags in MP3 files (see the BLFS Wiki ID3v1Coding page for more details). For these cases, the only solution is to find a replacement program that doesn't have the issue (e.g., one that will allow you to specify the assumed document encoding).
Among BLFS packages, this problem applies to nano-3.2, JOE-4.6, and all media players except Audacious-3.10.1.
Another problem in this category is when someone cannot read the documents you've sent them because their operating system is set up to handle character encodings differently. This can happen often when the other person is using Microsoft Windows, which only provides one character encoding for a given country. For example, this causes problems with UTF-8 encoded TeX documents created in Linux. On Windows, most applications will assume that these documents have been created using the default Windows 8-bit encoding.
In extreme cases, Windows encoding compatibility issues may be solved only by running Windows programs under Wine.
Severity: Critical
The POSIX standard mandates that the filename encoding is the
encoding implied by the current LC_CTYPE locale category.
This information is well-hidden on the page which specifies
the behavior of Tar and
Cpio programs. Some programs
get it wrong by default (or simply don't have enough
information to get it right). The result is that they create
filenames which are not subsequently shown correctly by
ls, or they
refuse to accept filenames that ls shows properly. For the
GLib-2.58.3 library, the problem can be
corrected by setting the G_FILENAME_ENCODING
environment variable to
the special "@locale" value. Glib2 based programs that don't respect
that environment variable are buggy.
The Zip-3.0 and UnZip-6.0 have this problem because they hard-code the expected filename encoding. UnZip contains a hard-coded conversion table between the CP850 (DOS) and ISO-8859-1 (UNIX) encodings and uses this table when extracting archives created under DOS or Microsoft Windows. However, this assumption only works for those in the US and not for anyone using a UTF-8 locale. Non-ASCII characters will be mangled in the extracted filenames.
The general rule for avoiding this class of problems is to avoid installing broken programs. If this is impossible, the convmv command-line tool can be used to fix filenames created by these broken programs, or intentionally mangle the existing filenames to meet the broken expectations of such programs.
In other cases, a similar problem is caused by importing filenames from a system using a different locale with a tool that is not locale-aware (e.g., OpenSSH-7.9p1). In order to avoid mangling non-ASCII characters when transferring files to a system with a different locale, any of the following methods can be used:
Transfer anyway, fix the damage with convmv.
On the sending side, create a tar archive with the
--format=posix
switch passed to tar (this will be the
default in a future version of tar).
Mail the files as attachments. Mail clients specify the encoding of attached filenames.
Write the files to a removable disk formatted with a FAT or FAT32 filesystem.
Transfer the files using Samba.
Transfer the files via FTP using RFC2640-aware server (this currently means only wu-ftpd, which has bad security history) and client (e.g., lftp).
The last four methods work because the filenames are automatically converted from the sender's locale to UNICODE and stored or sent in this form. They are then transparently converted from UNICODE to the recipient's locale encoding.
Severity: High or critical
Many programs were written in an older era where multibyte locales were not common. Such programs assume that C "char" data type, which is one byte, can be used to store single characters. Further, they assume that any sequence of characters is a valid string and that every character occupies a single character cell. Such assumptions completely break in UTF-8 locales. The visible manifestation is that the program truncates strings prematurely (i.e., at 80 bytes instead of 80 characters). Terminal-based programs don't place the cursor correctly on the screen, don't react to the "Backspace" key by erasing one character, and leave junk characters around when updating the screen, usually turning the screen into a complete mess.
Fixing this kind of problems is a tedious task from a programmer's point of view, like all other cases of retrofitting new concepts into the old flawed design. In this case, one has to redesign all data structures in order to accommodate to the fact that a complete character may span a variable number of "char"s (or switch to wchar_t and convert as needed). Also, for every call to the "strlen" and similar functions, find out whether a number of bytes, a number of characters, or the width of the string was really meant. Sometimes it is faster to write a program with the same functionality from scratch.
Among BLFS packages, this problem applies to xine-ui-0.99.10 and all the shells.
Severity: Low
LFS expects that manual pages are in the language-specific (usually 8-bit) encoding, as specified on the LFS Man DB page. However, some packages install translated manual pages in UTF-8 encoding (e.g., Shadow, already dealt with), or manual pages in languages not in the table. Not all BLFS packages have been audited for conformance with the requirements put in LFS (the large majority have been checked, and fixes placed in the book for packages known to install non-conforming manual pages). If you find a manual page installed by any of BLFS packages that is obviously in the wrong encoding, please remove or convert it as needed, and report this to BLFS team as a bug.
You can easily check your system for any non-conforming manual pages by copying the following short shell script to some accessible location,
#!/bin/sh
# Begin checkman.sh
# Usage: find /usr/share/man -type f | xargs checkman.sh
for a in "$@"
do
# echo "Checking $a..."
# Pure-ASCII manual page (possibly except comments) is OK
grep -v '.\\"' "$a" | iconv -f US-ASCII -t US-ASCII >/dev/null 2>&1 \
&& continue
# Non-UTF-8 manual page is OK
iconv -f UTF-8 -t UTF-8 "$a" >/dev/null 2>&1 || continue
# Found a UTF-8 manual page, bad.
echo "UTF-8 manual page: $a" >&2
done
# End checkman.sh
and then issuing the following command (modify the command
below if the checkman.sh script is not
in your PATH
environment
variable):
find /usr/share/man -type f | xargs checkman.sh
Note that if you have manual pages installed in any location
other than /usr/share/man
(e.g., /usr/local/share/man
),
you must modify the above command to include this additional
location.
Last updated on 2017-06-29 22:13:10 -0700
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.
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://xahlee.org/UnixResource_dir/_/ldpath.html.
If you modify /etc/ld.so.conf
, remember to update
/etc/ld.so.cache
by
executing ldconfig as the
root
user.
Add $PREFIX/man
to
/etc/man_db.conf
or expand
MANPATH
.
Add $PREFIX/info
to
INFOPATH
.
Add $PREFIX/lib/pkgconfig
to PKG_CONFIG_PATH
. Some
packages are now installing .pc
files in $PREFIX/share/pkgconfig
, so you may
have to include this directory also.
Add $PREFIX/include
to
CPPFLAGS
when compiling
packages that depend on the package you installed.
Add $PREFIX/lib
to
LDFLAGS
when compiling
packages that depend on a library installed by the
package.
If you are in search of a package that is not in the book, the following are different ways you can search for the desired package.
If you know the name of the package, then search Freecode
for it at http://freecode.com/. Also
search Google at http://google.com/. Sometimes a
search for the rpm
at
http://rpmfind.net/ or the
deb
at http://www.debian.org/distrib/packages#search_packages
can also lead to a link to the package.
If you know the name of the executable, but not the package that the executable belongs to, first try a Google search with the name of the executable. If the results are overwhelming, try searching for the given executable in the Debian repository at http://www.debian.org/distrib/packages#search_contents.
Some general hints on handling new packages:
Many of the newer packages follow the ./configure && make && make install process. 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://www.linuxfromscratch.org/search.html for the error or if that fails, try searching Google. Often, a distribution will have already solved the problem (many of them use development versions of packages, so they see the changes sooner than those of us who normally use stable released versions). But be cautious - all builders tend to carry patches which are no longer necessary, and to have fixes which are only required because of their particular choices in how they build a package. You may have to search deeply to find a fix for the package version you are trying to use, or even to find the package (names are sometimes not what you might expect, e.g. ghostscript often has a prefix or a suffix in its name), but the following notes might help:
Arch http://www.archlinux.org/packages/
- enter the package name in the 'Keywords' box,
select the package name, select the 'Source Files'
field, and then select the PKGBUILD
entry to see how they
build this package.
Debian ftp://ftp.uk.debian.org/debian/pool
(use your country's version if there is one) - the
source will be in .tar.gz tarballs (either the
original upstream .orig
source, or else a
dfsg
containing those
parts which comply with debian's free software
guidelines) accompanied by versioned .diff.gz or
.tar.gz additions. These additions often show how
the package is built, and may contain patches. In
the .diff.gz versions, any patches create files in
debian/patches
.
Fedora http://pkgs.fedoraproject.org/cgit/ - this site is still occasionally overloaded, but it is an easy way of looking at .spec files and patches. If you know their name for the package (e.g. mesa.git) you can append that to the URI to get to it. If not, use the search box. If the site is unavailable, try looking for a local mirror of ftp.fedora.com (the primary site is usually unavailable if fedora cgit is not responding) and download a source rpm to see what they do.
Gentoo - the mirrors for ebuilds and patches seem
to be well-hidden, and they change frequently.
Also, if you have found a mirror, you need to know
which directory the application has been assigned
to. The ebuilds themselves can be found at
http://packages.gentoo.org/
- use the search field. If there are any patches, a
mirror will have them in the files/
directory. Depending on
your browser, or the mirror, you might need to
download the ebuild to be able to read it. Treat
the ebuild as a sort of pseudo-code / shell
combination - look in particular for sed commands and
patches, or hazard a guess at the meanings of the
functions such as dodoc.
openSUSE http://download.opensuse.org/factory/repo/src-oss/suse/src/ - source only seems to be available in source rpms.
Slackware - the official package browser is
currently broken. The site at http://slackbuilds.org/
has current and previous versions in their
unofficial repository with links to homepages,
downloads, and some individual files, particularly
the .SlackBuild
files.
Ubuntu ftp://ftp.ubuntu.com/ubuntu/pool/ - see the debian notes above.
If everything else fails, try the blfs-support mailing-list.
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://downloads.linuxfromscratch.org/deb2targz.tar.bz2
and http://downloads.linuxfromscratch.org/rpm2targz.tar.bz2
to convert the archives into a simple tar.gz
format.
You may also find an rpm2cpio script useful. The Perl version in the linux kernel archives at http://lkml.indiana.edu/hypermail/linux/kernel/0210.2/att-0093/01-rpm2cpio works for most source rpms. The rpm2targz script will use an rpm2cpio script or binary if one is on your path. Note that rpm2cpio will unpack a source rpm in the current directory, giving a tarball, a spec file, and perhaps patches or other files.
Last updated on 2016-08-14 12:25:49 -0700
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 non-Unix like backgrounds to Linux find
the concept of text-only configuration files slightly strange. In
Linux, just about all configuration is done via the manipulation
of 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 a text file. The advantage of text-only configuration
is that you can edit parameters using your favorite text editor,
whether that be vim, emacs, or any other editor.
The first task is making a recovery boot device in Creating a Custom Boot Device because it's the most critical need. Hardware issues relevant to firmware and other devices is addressed next. The system is then configured to ease addition of new users, because this can affect the choices you make in the two subsequent topics—The Bash Shell Startup Files and The vimrc Files.
The remaining topics, Customizing your Logon with /etc/issue, Random number generation, and Autofs-5.1.5 are then addressed, in that order. They don't have much interaction with the other topics in this chapter.
This section is really about creating a rescue device. 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.
In a modern system, there are many devices that can be used as a rescue device: floppy, cdrom, usb drive, or even a network card. Which one you use depends on your hardware and your BIOS. In the past, a rescue device was thought to be a floppy disk. Today, many systems do not even have a floppy drive.
Building a complete rescue device is a challenging task. In many ways, it is equivalent to building an entire LFS system. In addition, it would be a repetition of information already available. For these reasons, the procedures for a rescue device image are not presented here.
The software of today's systems has grown large. Linux 2.6 no longer supports booting directly from a floppy. In spite of this, there are solutions available using older versions of Linux. One of the best is Tom's Root/Boot Disk available at http://www.toms.net/rb/. This will provide a minimal Linux system on a single floppy disk and provides the ability to customize the contents of your disk if necessary.
There are several sources that can be used for a rescue CD-ROM. Just about any commercial distribution's installation CD-ROMs or DVDs will work. These include RedHat, Ubuntu, and SuSE. One very popular option is Knoppix.
Also, the LFS Community has developed its own LiveCD available at http://www.linuxfromscratch.org/livecd/. This LiveCD, is no longer capable of building an entire LFS/BLFS system, but is still a good rescue CD-ROM. If you download the ISO image, use xorriso to copy the image to a CD-ROM.
The instructions for using GRUB2 to make a custom rescue CD-ROM are also available in LFS Chapter 8.
A USB Pen drive, sometimes called a Thumb drive, is recognized by Linux as a SCSI device. Using one of these devices as a rescue device has the advantage that it is usually large enough to hold more than a minimal boot image. You can save critical data to the drive as well as use it to diagnose and recover a damaged system. Booting such a drive requires BIOS support, but building the system consists of formatting the drive, adding GRUB as well as the Linux kernel and supporting files.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/CreatingaCustomBootDevice
Last updated on 2017-04-23 10:21:19 -0700
An LFS system can be used without a graphical desktop, and unless or until you install X Window System you will have to work in the console. Most, if not all, PCs boot with an 8x16 font - whatever the actual screen size. There are a few things you can do to alter the display on the console. Most of them involve changing the font, but the first alters the commandline used by grub.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/aboutconsolefonts
Modern screens often have a lot more pixels then the screens used in the past. If your screen is 1600 pixels wide, an 8x16 font will give you 200 columns of text - unless your monitor is enormous, the text will be tiny. One of the ways to work around this is to tell grub to use a smaller size, such as 1024x768 or 800x600 or even 640x480. Even if your screen does not have a 4:3 aspect ratio, this should work.
To try this, you can reboot and edit grub's command-line to
insert a 'video=' parameter between the 'root=/dev/sdXn' and
'ro', for example root=/dev/sda2
video=1024x768 ro
based on the example in LFS section
8.4.4 : ../../../../lfs/view/8.4/chapter08/grub.html
.
If you decide that you wish to do this, you can then (as the
root
user) edit /boot/grub/grub.cfg
.
In LFS the kbd package is
used. The fonts it provides are PC Screen Fonts, usually
called PSF, and they were installed into /usr/share/consolefonts
. Where these
include a unicode mapping table, the file suffix is often
changed to .psfu
although
packages such as terminus-font (see below) do not add the
'u'. These fonts are usually compressed with gzip to save
space, but that is not essential.
The initial PC text screens had 8 colours, or 16 colours if the bright versions of the original 8 colours were used. A PSF font can include up to 256 characters (technically, glyphs) while allowing 16 colours, or up to 512 characters (in which case, the bright colours will not be available). Clearly, these console fonts cannot be used to display CJK text - that would need thousands of available glyphs.
Some fonts in kbd can cover more than 512 codepoints ('characters'), with varying degrees of fidelity: unicode contains several whitespace codepoints which can all be mapped to a space, varieties of dashes can be mapped to a minus sign, smart quotes can map to the regular ASCII quotes rather than to whatever is used for "codepoint not present or invalid", and those cyrillic or greek letters which look like latin letters can be mapped onto them, so 'A' can also do duty for cyrillic A and greek Alpha, and 'P' can also do duty for cyrillic ER and greek RHO. Unfortunately, where a font has been created from a BDF file (the method in terminus and debian's console-setup ) such mapping of additional codepoints onto an existing glyph is not always done, although the terminus ter-vXXn fonts do this well.
There are over 120 combinations of font and size in
kbd: often a font is
provided at several character sizes, and sometimes varieties
cover different subsets of unicode. Most are 8 pixels wide,
in heights from 8 to 16 pixels, but there are a few which are
9 pixels wide, some others which are 12x22, and even one
(latarcyrheb-sun32.psfu
) which
has been scaled up to 16x32. Using a bigger font is another
way of making text on a large screen easier to read.
You can test fonts as a normal user. If you have a font which has not been installed, you can load it with :
setfont /path/to/yourfont.ext
For the fonts already installed you only need the name, so
using gr737a-9x16.psfu.gz
as an
example:
setfont gr737a-9x16
To see the glyphs in the font, use:
showconsolefont
If the font looks as if it might be useful, you can then go on to test it more thoroughly.
When you find a font which you wish to use, as the
root
user) edit
/etc/sysconfig/console
as
described in LFS section 7.6.5 ../../../../lfs/view/8.4/chapter07/usage.html.
.
For fonts not supplied with the kbd package you will need to optionally
compress it / them with gzip and then install it /
them as the root
user.
Although some console fonts are created from BDF files, which is a text format with hex values for the pixels in each row of the character, there are more-modern tools available for editing psf fonts. The psftools package allows you to dump a font to a text representation with a dash for a pixel which is off (black) and a hash for a pixel which is on (white). You can then edit the text file to add more characters, or reshape them, or map extra codepoints onto them, and then create a new psf font with your changes.
The Terminus Font
package provides fixed-width bitmap fonts designed for long
(8 hours and more per day) work with computers. Under
'Character variants' on that page is a list of patches (in
the alt/
directory). If you are
using a graphical browser to look at that page, you can see
what the patches do, e.g. 'll2' makes 'l' more visibly
different from 'i' and '1'.
By default terminus-fonts will try to create several types of font, and it will fail if bdftopcf from Xorg Applications has not been installed. The configure script is only really useful if you go on to install all the fonts (console and X11 bitmap) to the correct directories, as in a distro. To build only the PSF fonts and their dependencies, run:
make psf
This will create more than 240 ter-*.psf fonts. The 'b' suffix indicates bright, 'n' indicates normal. You can then test them to see if any fit your requirements. Unless you are creating a distro, there seems little point in installing them all.
As an example, to install the last of these fonts, you can
gzip it and then as the root
user:
install -v -m644 ter-v32n.psf.gz /usr/share/consolefonts
Last updated on 2018-09-30 20:09:39 -0700
On some recent PCs it can be necessary, or desirable, to load
firmware to make them work at their best. There is a directory,
/lib/firmware
, where the kernel
or kernel drivers look for firmware images.
Preparing firmware for multiple different machines, as a distro would do, is outside the scope of this book.
Currently, most firmware can be found at a git
repository:
http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/.
For convenience, the LFS Project has created a mirror, updated
daily, where these firmware files can be accessed via
wget
or a web
browser at http://anduin.linuxfromscratch.org/BLFS/linux-firmware/.
To get the firmware, either point a browser to one of the above
repositories and then download the item(s) which you need, or
install git
and
clone that repository.
For some other firmware, particularly for Intel microcode and certain wifi devices, the needed firmware is not available in the above repository. Some of this will be addressed below, but a search of the Internet for needed firmware is sometimes necessary.
Firmware files are conventionally referred to as blobs because you cannot determine what they will do. Note that firmware is distributed under various different licenses which do not permit disassembly or reverse-engineering.
Firmware for PCs falls into four categories:
Updates to the CPU to work around errata, usually referred to as microcode.
Firmware for video controllers. On x86 machines this seems to mostly apply to ATI devices (Radeon and AMDGPU chips) and Nvidia Maxwell and Pascal cards which all require firmware to be able to use KMS (kernel modesetting - the preferred option) as well as for Xorg. For earlier radeon chips (before the R600), the firmware is still in the kernel.
Firmware updates for wired network ports. Mostly they work even without the updates, but probably they will work better with the updated firmware. For some modern laptops, firmware for both wired ethernet (e.g. rtl_nic) and also for bluetooth devices (e.g. qca) is required before the wired network can be used.
Firmware for other devices, such as wifi. These devices are not required for the PC to boot, but need the firmware before these devices can be used.
Although not needed to load a firmware blob, the following tools may be useful for determining, obtaining, or preparing the needed firmware in order to load it into the system: cpio-2.12, git-2.20.1, pciutils-3.6.2, and Wget-1.20.1
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/aboutfirmware
In general, microcode can be loaded by the BIOS or UEFI, and it might be updated by upgrading to a newer version of those. On linux, you can also load the microcode from the kernel if you are using an AMD family 10h or later processor (first introduced late 2007), or an Intel processor from 1998 and later (Pentium4, Core, etc), if updated microcode has been released. These updates only last until the machine is powered off, so they need to be applied on every boot.
Intel provide frequent updates of their microcode. It is not uncommon to find a newer version of microcode for an Intel processor even two years after its release. New versions of AMD firmware are rare and usually only apply to a few models, although motherboard manufacturers get extra updates which maybe update microcode along with the changes to support newer CPUs and faster memory.
There used to be two ways of loading the microcode, described as 'early' and 'late'. Early loading happens before userspace has been started, late loading happens after userspace has started. Not surprisingly, early loading was preferred, (see e.g. an explanatory comment in a kernel commit noted at x86/microcode: Early load microcode on LWN.) Indeed, it is needed to work around one particular erratum in early Intel Haswell processors which had TSX enabled. (See Intel Disables TSX Instructions: Erratum Found in Haswell, Haswell-E/EP, Broadwell-Y.) Without this update glibc can do the wrong thing in uncommon situations.
As a result, early loading is now expected, although for the
moment (4.18 kernels) it is still possible to manually force
late loading of microcode for testing. You will need to
reconfigure your kernel for either method. The instructions
here will create a kernel .config
to suite early loading, before
forcing late loading to see if there is any microcode. If
there is, the instructions then show you how to create an
initrd for early loading.
To confirm what processor(s) you have (if more than one, they will be identical) look in /proc/cpuinfo.
The first step is to get the most recent version of the
Intel microcode. This must be done by navigating to
https://downloadcenter.intel.com/download/28087/Linux-Processor-Microcode-Data-File
and following the instructions there. As of this writing
the most recent version of the microcode is microcode-20180807.tgz
. Extract this file
in the normal way to create an intel-ucode
directory, containing various
blobs with names in the form XX-YY-ZZ. This tarball does
not contain a top-level directory, two files (microcode.dat
which is the old-style of updates, still used by some linux
distros, and releasenote) will be extracted into the
current directory.
The above URL may not be the latest page. If it is not, a line at the top of the page will direct you to the latest page.
Now you need to determine your processor's identity to see if there is any microcode for it. Determine the decimal values of the cpu family, model and stepping by running the following command (it will also report the current microcode version):
head -n7 /proc/cpuinfo
Convert the cpu family, model and stepping to pairs of hexadecimal digits. For a Haswell i7-4790 (described as Intel(R) Core(TM) i7-4790 CPU) the relevant values are cpu family 6, model 60, stepping 3 so in this case the required identification is 06-3c-03. A look at the blobs will show that there is one for this CPU (although it might have already been applied by the BIOS). If there is a blob for your system then test if it will be applied by copying it (replace <XX-YY-ZZ> by the identifier for your machine) to where the kernel can find it:
mkdir -pv /lib/firmware/intel-ucode cp -v intel-ucode/<XX-YY-ZZ> /lib/firmware/intel-ucode
Now that the Intel microcode has been prepared, use the following options when you configure the kernel to load Intel microcode:
General Setup --->
[y] Initial RAM filesystem and RAM disk (initramfs/initrd) support [CONFIG_BLK_DEV_INITRD]
Processor type and features --->
[y] CPU microcode loading support [CONFIG_MICROCODE]
[y] Intel microcode loading support [CONFIG_MICROCODE_INTEL]
After you have successfully booted the new system, force late loading by using the command:
echo 1 > /sys/devices/system/cpu/microcode/reload
Then use the following command to see if anything was loaded:
dmesg | grep -e 'microcode' -e 'Linux version' -e 'Command line'
This example from the Haswell i7 which was released in Q2 2014 and is not affected by the TSX errata shows it has been updated from revision 0x19 in the BIOS/UEFI (which this version of the kernel now complains about) to revision 0x24. Unlike in older kernels, the individual CPUs are not separately reported:
[ 0.000000] Linux version 4.18.0-rc8 (root@plexi) (gcc version 8.2.0 (GCC))
#2 SMP PREEMPT Sat Aug 11 22:26:26 BST 2018
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.18.0-rc8-sda5 root=/dev/sda5 ro resume=/dev/sdb1
[ 0.000000] [Firmware Bug]: TSC_DEADLINE disabled due to Errata;
please update microcode to version: 0x22 (or later)
[ 0.482712] microcode: sig=0x306c3, pf=0x2, revision=0x19
[ 0.274963] microcode: Microcode Update Driver: v2.2.
[ 1475.941353] microcode: updated to revision 0x25, date = 2018-04-02
[ 1475.944753] x86/CPU: CPU features have changed after loading microcode, but might not take effect
If the microcode was not updated, there is no new microcode for this system's processor. If it did get updated, you can now proceed to the section called “Early loading of microcode”.
Begin by downloading a container of firmware for your CPU
family from
http://anduin.linuxfromscratch.org/BLFS/linux-firmware/amd-ucode/.
The family is always specified in hex. Families 10h to 14h
(16 to 20) are in microcode_amd.bin. Families 15h, 16h and
17h have their own containers. Create the required
directory and put the firmware you downloaded into it as
the root
user:
mkdir -pv /lib/firmware/amd-ucode cp -v microcode_amd* /lib/firmware/amd-ucode
When you configure the kernel, use the following options to load AMD microcode:
General Setup --->
[y] Initial RAM filesystem and RAM disk (initramfs/initrd) support [CONFIG_BLK_DEV_INITRD]
Processor type and features --->
[y] CPU microcode loading support [CONFIG_MICROCODE]
[y] AMD microcode loading support [CONFIG_MICROCODE_AMD]
After you have successfully booted the new system, force late loading by using the command:
echo 1 > /sys/devices/system/cpu/microcode/reload
Then use the following command to see if anything was loaded:
dmesg | grep -e 'microcode' -e 'Linux version' -e 'Command line'
This historic example from an old Athlon(tm) II X2 shows it has been updated. At that time, all CPUs were still reported in the microcode details on AMD machines (the current position for AMD machines where newer microcode is available is unknown) :
[ 0.000000] Linux version 4.15.3 (ken@testserver) (gcc version 7.3.0 (GCC))
#1 SMP Sun Feb 18 02:08:12 GMT 2018
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.15.3-sda5 root=/dev/sda5 ro
[ 0.307619] microcode: CPU0: patch_level=0x010000b6
[ 0.307671] microcode: CPU1: patch_level=0x010000b6
[ 0.307743] microcode: Microcode Update Driver: v2.2.
[ 187.928891] microcode: CPU0: new patch_level=0x010000c8
[ 187.928899] microcode: CPU1: new patch_level=0x010000c8
If the microcode was not updated, there is no new microcode for this system's processor. If it did get updated, you can now proceed to the section called “Early loading of microcode”.
If you have established that updated microcode is available for your system, it is time to prepare it for early loading. This requires an additional package, cpio-2.12 and the creation of an initrd which will need to be added to grub.cfg.
It does not matter where you prepare the initrd, and once it is working you can apply the same initrd to later LFS systems or newer kernels on this same machine, at least until any newer microcode is released. Use the following commands:
mkdir -p initrd/kernel/x86/microcode cd initrd
For an AMD machine, use the following command (replace <MYCONTAINER> with the name of the container for your CPU's family):
cp -v /lib/firmware/amd-ucode/<MYCONTAINER> kernel/x86/microcode/AuthenticAMD.bin
Or for an Intel machine copy the appropriate blob using this command:
cp -v /lib/firmware/intel-ucode/<XX-YY-ZZ> kernel/x86/microcode/GenuineIntel.bin
Now prepare the initrd:
find . | cpio -o -H newc > /boot/microcode.img
You now need to add a new entry to /boot/grub/grub.cfg and here you should add a new line after the linux line within the stanza. If /boot is a separate mountpoint:
initrd /microcode.img
or this if it is not:
initrd /boot/microcode.img
If you are already booting with an initrd (see the
section called “About initramfs”) you must
specify the microcode initrd first, using a line such as
initrd /microcode.img
/other-initrd.img
(adapt that as above if
/boot is not a separate mountpoint).
You can now reboot with the added initrd, and then use the same command to check that the early load worked.
dmesg | grep -e 'microcode' -e 'Linux version' -e 'Command line'
The places and times where early loading happens are very different in AMD and Intel machines. First, an Intel example from an updated kernel, showing that the first notification comes before the kernel version is mentioned:
[ 0.000000] microcode: microcode updated early to revision 0x25, date = 2018-04-02
[ 0.000000] Linux version 4.18.1-rc1 (ken@plexi) (gcc version 8.2.0 (GCC))
#2 SMP PREEMPT Tue Aug 14 20:22:35 BST 2018
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.18.1-rc1-sda5 root=/dev/sda5 ro resume=/dev/sdb1
[ 0.275864] microcode: sig=0x306c3, pf=0x2, revision=0x25
[ 0.275911] microcode: Microcode Update Driver: v2.2.
A historic AMD example:
[ 0.000000] Linux version 4.15.3 (ken@testserver) (gcc version 7.3.0 (GCC))
#2 SMP Sun Feb 18 02:32:03 GMT 2018
[ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.15.3-sda5 root=/dev/sda5 ro
[ 0.307619] microcode: microcode updated early to new patch_level=0x010000c8
[ 0.307678] microcode: CPU0: patch_level=0x010000c8
[ 0.307723] microcode: CPU1: patch_level=0x010000c8
[ 0.307795] microcode: Microcode Update Driver: v2.2.
These instructions do NOT apply to old radeons before the
R600 family. For those, the firmware is in the kernel's
/lib/firmware/
directory. Nor
do they apply if you intend to avoid a graphical setup such
as Xorg and are content to use the default 80x25 display
rather than a framebuffer.
Early radeon devices only needed a single 2K blob of firmware. Recent devices need several different blobs, and some of them are much bigger. The total size of the radeon firmware directory is over 500K — on a large modern system you can probably spare the space, but it is still redundant to install all the unused files each time you build a system.
A better approach is to install pciutils-3.6.2 and
then use lspci
to identify which
VGA controller is installed.
With that information, check the RadeonFeature page of the Xorg wiki for Decoder ring for engineering vs marketing names to identify the family (you may need to know this for the Xorg driver in BLFS — Southern Islands and Sea Islands use the radeonsi driver) and the specific model.
Now that you know which controller you are using, consult the Radeon page of the Gentoo wiki which has a table listing the required firmware blobs for the various chipsets. Note that Southern Islands and Sea Islands chips use different firmware for kernel 3.17 and later compared to earlier kernels. Identify and download the required blobs then install them:
mkdir -pv /lib/firmware/radeon cp -v <YOUR_BLOBS> /lib/firmware/radeon
There are actually two ways of installing this firmware. BLFS, in the 'Kernel Configuration for additional firmware' section part of the Xorg ATI Driver-18.1.0 section gives an example of compiling the firmware into the kernel - that is slightly faster to load, but uses more kernel memory. Here we will use the alternative method of making the radeon driver a module. In your kernel config set the following:
Device Drivers --->
Graphics support --->
Direct Rendering Manager --->
<*> Direct Rendering Manager (XFree86 ... support) [CONFIG_DRM]
<m> ATI Radeon [CONFIG_DRM_RADEON]
Loading several large blobs from /lib/firmware takes a noticeable time, during which the screen will be blank. If you do not enable the penguin framebuffer logo, or change the console size by using a bigger font, that probably does not matter. If desired, you can slightly reduce the time if you follow the alternate method of specifying 'y' for CONFIG_DRM_RADEON covered in BLFS at the link above — you must specify each needed radeon blob if you do that.
Some Nvidia graphics chips need firmware updates to take advantage of all the card's capability. These are generally the GeForce 8, 9, 9300, and 200-900 series chips. For more exact information, see https://nouveau.freedesktop.org/wiki/VideoAcceleration/#firmware.
First, the kernel Nvidia driver must be activated:
Device Drivers --->
Graphics support --->
Direct Rendering Manager --->
<*> Direct Rendering Manager (XFree86 ... support) [CONFIG_DRM]
<*/m> Nouveau (NVIDIA) cards [CONFIG_DRM_NOUVEAU]
The steps to install the Nvidia firmware are:
wget https://raw.github.com/imirkin/re-vp2/master/extract_firmware.py wget http://us.download.nvidia.com/XFree86/Linux-x86/325.15/NVIDIA-Linux-x86-325.15.run sh NVIDIA-Linux-x86-325.15.run --extract-only python extract_firmware.py mkdir -p /lib/firmware/nouveau cp -d nv* vuc-* /lib/firmware/nouveau/
The kernel likes to load firmware for some network drivers, particularly those from Realtek (the /lib/linux-firmware/rtl_nic/) directory, but they generally appear to work without it. Therefore, you can boot the kernel, check dmesg for messages about this missing firmware, and if necessary download the firmware and put it in the specified directory in /lib/firmware so that it will be found on subsequent boots. Note that with current kernels this works whether or not the driver is compiled in or built as a module, there is no need to build this firmware into the kernel. Here is an example where the R8169 driver has been compiled in but the firmware was not made available. Once the firmware had been provided, there was no mention of it on later boots.
dmesg | grep firmware | grep r8169
[ 7.018028] r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168g-2.fw failed with error -2
[ 7.018036] r8169 0000:01:00.0 eth0: unable to load firmware patch rtl_nic/rtl8168g-2.fw (-2)
Identifying the correct firmware will typically require you
to install pciutils-3.6.2, and then use
lspci
to
identify the device. You should then search online to check
which module it uses, which firmware, and where to obtain the
firmware — not all of it is in linux-firmware.
If possible, you should begin by using a wired connection when you first boot your LFS system. To use a wireless connection you will need to use a network tools such as Wireless Tools-29 and wpa_supplicant-2.7.
Firmware may also be needed for other devices such as some SCSI controllers, bluetooth adaptors, or TV recorders. The same principles apply.
Last updated on 2019-02-19 16:07:32 -0800
Although most devices needed by packages in BLFS and beyond are
set up properly by udev using
the default rules installed by LFS in /etc/udev/rules.d
, there are cases where the
rules must be modified or augmented.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/aboutdevices
If there are multiple sound cards in a system, the "default"
sound card becomes random. The method to establish sound card
order depends on whether the drivers are modules or not. If
the sound card drivers are compiled into the kernel, control
is via kernel command line parameters in /boot/grub/grub.cfg
. For example, if a
system has both an FM801 card and a SoundBlaster PCI card,
the following can be appended to the command line:
snd-fm801.index=0 snd-ens1371.index=1
If the sound card drivers are built as modules, the order can
be established in the /etc/modprobe.conf
file with:
options snd-fm801 index=0
options snd-ens1371 index=1
USB devices usually have two kinds of device nodes associated with them.
The first kind is created by device-specific drivers (e.g., usb_storage/sd_mod or usblp) in the kernel. For example, a USB mass storage device would be /dev/sdb, and a USB printer would be /dev/usb/lp0. These device nodes exist only when the device-specific driver is loaded.
The second kind of device nodes (/dev/bus/usb/BBB/DDD, where BBB is the bus number and DDD is the device number) are created even if the device doesn't have a kernel driver. By using these "raw" USB device nodes, an application can exchange arbitrary USB packets with the device, i.e., bypass the possibly-existing kernel driver.
Access to raw USB device nodes is needed when a userspace program is acting as a device driver. However, for the program to open the device successfully, the permissions have to be set correctly. By default, due to security concerns, all raw USB devices are owned by user root and group usb, and have 0664 permissions (the read access is needed, e.g., for lsusb to work and for programs to access USB hubs). Packages (such as SANE and libgphoto2) containing userspace USB device drivers also ship udev rules that change the permissions of the controlled raw USB devices. That is, rules installed by SANE change permissions for known scanners, but not printers. If a package maintainer forgot to write a rule for your device, report a bug to both BLFS (if the package is there) and upstream, and you will need to write your own rule.
There is one situation when such fine-grained access control with pre-generated udev rules doesn't work. Namely, PC emulators such as KVM, QEMU and VirtualBox use raw USB device nodes to present arbitrary USB devices to the guest operating system (note: patches are needed in order to get this to work without the obsolete /proc/bus/usb mount point described below). Obviously, maintainers of these packages cannot know which USB devices are going to be connected to the guest operating system. You can either write separate udev rules for all needed USB devices yourself, or use the default catch-all "usb" group, members of which can send arbitrary commands to all USB devices.
Before Linux-2.6.15, raw USB device access was performed not with /dev/bus/usb/BBB/DDD device nodes, but with /proc/bus/usb/BBB/DDD pseudofiles. Some applications (e.g., VMware Workstation) still use only this deprecated technique and can't use the new device nodes. For them to work, use the "usb" group, but remember that members will have unrestricted access to all USB devices. To create the fstab entry for the obsolete usbfs filesystem:
usbfs /proc/bus/usb usbfs devgid=14,devmode=0660 0 0
Adding users to the "usb" group is inherently insecure, as they can bypass access restrictions imposed through the driver-specific USB device nodes. For instance, they can read sensitive data from USB hard drives without being in the "disk" group. Avoid adding users to this group, if you can.
Fine-tuning of device attributes such as group name and
permissions is possible by creating extra udev rules, matching on something like
this. The vendor and product can be found by searching the
/sys/devices
directory entries
or using udevadm
info after the device has been attached. See
the documentation in the current udev directory of /usr/share/doc
for details.
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="05d8", SYSFS{idProduct}=="4002", \
GROUP:="scanner", MODE:="0660"
The above line is used for descriptive purposes only. The scanner udev rules are put into place when installing SANE-1.0.27.
In some cases, it makes sense to disable udev completely and create static devices. Servers are one example of this situation. Does a server need the capability of handling dynamic devices? Only the system administrator can answer that question, but in many cases the answer will be no.
If dynamic devices are not desired, then static devices must
be created on the system. In the default configuration, the
/etc/rc.d/rcS.d/S10udev
boot
script mounts a tmpfs
partition over the /dev
directory. This problem can be overcome by mounting the root
partition temporarily:
If the instructions below are not followed carefully, your system could become unbootable.
mount --bind / /mnt cp -a /dev/* /mnt/dev rm /etc/rc.d/rcS.d/{S10udev,S50udev_retry} umount /mnt
At this point, the system will use static devices upon the next reboot. Create any desired additional devices using mknod.
If you want to restore the dynamic devices, recreate the
/etc/rc.d/rcS.d/{S10udev,S50udev_retry}
symbolic links and reboot again. Static devices do not need
to be removed (console and null are always needed) because
they are covered by the tmpfs
partition. Disk usage for devices is negligible (about
20–30 bytes per entry.)
If the initial boot process does not set up the /dev/dvd
device properly, it can be
installed using the following modification to the default
udev rules. As the root
user,
run:
sed '1d;/SYMLINK.*cdrom/ a\ KERNEL=="sr0", ENV{ID_CDROM_DVD}=="1", SYMLINK+="dvd", OPTIONS+="link_priority=-100"' \ /lib/udev/rules.d/60-cdrom_id.rules > /etc/udev/rules.d/60-cdrom_id.rules
Last updated on 2018-01-10 02:44:47 -0800
Together, the /usr/sbin/useradd command and
/etc/skel
directory (both are
easy to set up and use) provide a way to assure new users are
added to your LFS system with the same beginning settings for
things such as the PATH
, keyboard
processing and other environmental variables. Using these two
facilities makes it easier to assure this initial state for
each new user added to the system.
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.
The useradd
program uses a collection of default values kept in
/etc/default/useradd
. This file
is created in a base LFS installation by the Shadow package. If it has been removed or
renamed, the useradd program uses some
internal defaults. You can see the default values by running
/usr/sbin/useradd
-D.
To change these values, simply modify the /etc/default/useradd
file as the root
user. An alternative to directly
modifying the file is to run useradd as the root
user while supplying the desired
modifications on the command line. Information on how to do
this can be found in the useradd man page.
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 two sections, The Bash Shell Startup Files
and The vimrc Files. 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 instead just sends 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 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 (perform as the root
user):
useradd -m <newuser>
Last updated on 2007-10-16 06:49:09 -0700
Throughout BLFS, many packages install programs that run as
daemons or in some way should have a user or group name
assigned. Generally these names are used to map a user ID (uid)
or group ID (gid) for system use. Generally the specific uid or
gid numbers used by these applications are not significant. The
exception of course, is that root
has a uid and gid of 0 (zero) that is
indeed special. The uid values are stored in /etc/passwd
and the gid values are found in
/etc/group
.
Customarily, Unix systems classify users and groups into two
categories: system users and regular users. The system users
and groups are given low numbers and regular users and groups
have numeric values greater than all the system values. The
cutoff for these numbers is found in two parameters in the
/etc/login.defs
configuration
file. The default UID_MIN value is 1000 and the default GID_MIN
value is 1000. If a specific uid or gid value is not specified
when creating a user with useradd or a group with
groupadd the
values assigned will always be above these cutoff values.
Additionally, the Linux Standard Base recommends that system uid and gid values should be below 100.
Below is a table of suggested uid/gid values used in BLFS beyond those defined in a base LFS installation. These can be changed as desired, but provide a suggested set of consistent values.
Table 3.1. UID/GID Suggested Values
Name | uid | gid |
---|---|---|
bin | 1 | |
lp | 9 | |
adm | 16 | |
atd | 17 | 17 |
messagebus | 18 | 18 |
lpadmin | 19 | |
named | 20 | 20 |
gdm | 21 | 21 |
fcron | 22 | 22 |
systemd-journal | 23 | |
apache | 25 | 25 |
smmsp | 26 | 26 |
polkitd | 27 | 27 |
rpc | 28 | 28 |
exim | 31 | 31 |
postfix | 32 | 32 |
postdrop | 33 | |
sendmail | 34 | |
34 | ||
vmailman | 35 | 35 |
news | 36 | 36 |
kdm | 37 | 37 |
mysql | 40 | 40 |
postgres | 41 | 41 |
dovecot | 42 | 42 |
dovenull | 43 | 43 |
ftp | 45 | 45 |
proftpd | 46 | 46 |
vsftpd | 47 | 47 |
rsyncd | 48 | 48 |
sshd | 50 | 50 |
stunnel | 51 | 51 |
svn | 56 | 56 |
svntest | 57 | |
games | 60 | 60 |
kvm | 61 | |
wireshark | 62 | |
lightdm | 63 | 63 |
sddm | 64 | 64 |
lightdm | 65 | 65 |
scanner | 70 | |
colord | 71 | 71 |
systemd-bus-proxy | 72 | 72 |
systemd-journal-gateway | 73 | 73 |
systemd-journal-remote | 74 | 74 |
systemd-journal-upload | 75 | 75 |
systemd-network | 76 | 76 |
systemd-resolve | 77 | 77 |
systemd-timesync | 78 | 78 |
systemd-coredump | 79 | 79 |
ldap | 83 | 83 |
avahi | 84 | 84 |
avahi-autoipd | 85 | 85 |
netdev | 86 | |
ntp | 87 | 87 |
unbound | 88 | 88 |
plugdev | 90 | |
wheel | 97 | |
anonymous | 98 | |
nobody | 99 | |
nogroup | 99 |
One value that is missing is 65534. This value is customarily
assigned to the user nobody
and
group nogroup
and is
unnecessary.
Last updated on 2018-11-21 11:47:19 -0800
The shell program /bin/bash
(hereafter referred to as just "the shell") uses a collection
of startup files to help create an environment. 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. This shell
invocation normally reads /etc/profile
and its private equivalent
~/.bash_profile
(or ~/.profile
if called as /bin/sh) upon startup.
An interactive non-login shell is normally started at the
command-line using a shell program (e.g., [prompt]$
/bin/bash) or by the
/bin/su command.
An interactive non-login shell is also started with a terminal
program such as xterm or konsole from within a
graphical environment. This type of shell invocation normally
copies the parent environment and then reads the user's
~/.bashrc
file for additional
startup configuration instructions.
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 these shell invocations, only the environment inherited from the parent shell is used.
The file ~/.bash_logout
is not
used for an invocation of the shell. It is read and executed
when a user exits from an interactive login shell.
Many distributions use /etc/bashrc
for system wide initialization of
non-login shells. This file is usually called from the user's
~/.bashrc
file and is not built
directly into bash itself. This convention
is followed in this section.
For more information see info bash -- Nodes: Bash Startup Files and Interactive Shells.
Most of the instructions below are used to create files
located in the /etc
directory
structure which requires you to execute the commands as the
root
user. If you elect to
create the files in user's home directories instead, you
should run the commands as an unprivileged user.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/bash-shell-startup-files
Here is a base /etc/profile
.
This file starts by setting up some helper functions and some
basic parameters. It specifies some bash history parameters
and, for security purposes, disables keeping a permanent
history file for the root
user. It also sets a default user prompt. It then calls
small, single purpose scripts in the /etc/profile.d
directory to provide most of
the initialization.
For more information on the escape sequences you can use for
your prompt (i.e., 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>
# modifications by Dagmar d'Surreal <rivyqntzne@pbzpnfg.arg>
# 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.
# Functions to help us manage paths. Second argument is the name of the
# path variable to be modified (default: PATH)
pathremove () {
local IFS=':'
local NEWPATH
local DIR
local PATHVARIABLE=${2:-PATH}
for DIR in ${!PATHVARIABLE} ; do
if [ "$DIR" != "$1" ] ; then
NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
fi
done
export $PATHVARIABLE="$NEWPATH"
}
pathprepend () {
pathremove $1 $2
local PATHVARIABLE=${2:-PATH}
export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
}
pathappend () {
pathremove $1 $2
local PATHVARIABLE=${2:-PATH}
export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
}
export -f pathremove pathprepend pathappend
# Set the initial path
export PATH=/bin:/usr/bin
if [ $EUID -eq 0 ] ; then
pathappend /sbin:/usr/sbin
unset HISTFILE
fi
# Setup some environment variables.
export HISTSIZE=1000
export HISTIGNORE="&:[bf]g:exit"
# Set some defaults for graphical systems
export XDG_DATA_DIRS=${XDG_DATA_DIRS:-/usr/share/}
export XDG_CONFIG_DIRS=${XDG_CONFIG_DIRS:-/etc/xdg/}
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/xdg-$USER}
# Setup a red prompt for root and a green one for users.
NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
if [[ $EUID == 0 ]] ; then
PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
else
PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi
for script in /etc/profile.d/*.sh ; do
if [ -r $script ] ; then
. $script
fi
done
unset script RED GREEN NORMAL
# End /etc/profile
EOF
Now create the /etc/profile.d
directory, where the individual initialization scripts are
placed:
install --directory --mode=0755 --owner=root --group=root /etc/profile.d
Using the bash completion script below is controversial. Not all users like it. It adds many (usually over 1000) lines to the bash environment and makes it difficult to use the 'set' command to examine simple environment variables. Omitting this script does not interfere with the ability of bash to use the tab key for file name completion.
This script imports bash completion scripts, installed by many other BLFS packages, to allow TAB command line completion.
cat > /etc/profile.d/bash_completion.sh << "EOF"
# Begin /etc/profile.d/bash_completion.sh
# Import bash completion scripts
# If the bash-completion package is installed, use its configuration instead
if [ -f /usr/share/bash-completion/bash_completion ]; then
# Check for interactive bash and that we haven't already been sourced.
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
# Check for recent enough version of bash.
if [ ${BASH_VERSINFO[0]} -gt 4 ] || \
[ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r /usr/share/bash-completion/bash_completion ]; then
# Source completion code.
. /usr/share/bash-completion/bash_completion
fi
fi
fi
else
# bash-completions are not installed, use only bash completion directory
if shopt -q progcomp; then
for script in /etc/bash_completion.d/* ; do
if [ -r $script ] ; then
. $script
fi
done
fi
fi
# End /etc/profile.d/bash_completion.sh
EOF
Make sure that the directory exists:
install --directory --mode=0755 --owner=root --group=root /etc/bash_completion.d
For a more complete installation, see http://wiki.linuxfromscratch.org/blfs/wiki/bash-shell-startup-files#bash-completions.
This script uses the ~/.dircolors
and /etc/dircolors
files to control the
colors of file names in a directory listing. They control
colorized output of things like ls --color. The
explanation of how to initialize these files is at the end
of this section.
cat > /etc/profile.d/dircolors.sh << "EOF"
# Setup for /bin/ls and /bin/grep to support color, the alias is in /etc/bashrc.
if [ -f "/etc/dircolors" ] ; then
eval $(dircolors -b /etc/dircolors)
fi
if [ -f "$HOME/.dircolors" ] ; then
eval $(dircolors -b $HOME/.dircolors)
fi
alias ls='ls --color=auto'
alias grep='grep --color=auto'
EOF
This script adds some useful paths to the PATH
and can be used to customize other PATH
related environment variables (e.g. LD_LIBRARY_PATH, etc)
that may be needed for all users.
cat > /etc/profile.d/extrapaths.sh << "EOF"
if [ -d /usr/local/lib/pkgconfig ] ; then
pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
fi
if [ -d /usr/local/bin ]; then
pathprepend /usr/local/bin
fi
if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then
pathprepend /usr/local/sbin
fi
# Set some defaults before other applications add to these paths.
pathappend /usr/share/man MANPATH
pathappend /usr/share/info INFOPATH
EOF
This script sets up the default inputrc
configuration file. If the user
does not have individual settings, it uses the global file.
cat > /etc/profile.d/readline.sh << "EOF"
# Setup the INPUTRC environment variable.
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then
INPUTRC=/etc/inputrc
fi
export INPUTRC
EOF
Setting the umask value is important for security. Here the default group write permissions are turned off for system users and when the user name and group name are not the same.
cat > /etc/profile.d/umask.sh << "EOF"
# By default, the umask should be set.
if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then
umask 002
else
umask 022
fi
EOF
This script sets an environment variable necessary for native language support. A full discussion on determining this variable can be found on the LFS Bash Shell Startup Files page.
cat > /etc/profile.d/i18n.sh << "EOF"
# Set up i18n variables
export LANG=<ll>
_<CC>
.<charmap>
<@modifiers>
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>
# updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>
# 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
# Provides colored /bin/ls and /bin/grep commands. Used in conjunction
# with code in /etc/profile.
alias ls='ls --color=auto'
alias grep='grep --color=auto'
# Provides prompt for non-login shells, specifically shells started
# in the X environment. [Review the LFS archive thread titled
# PS1 Environment Variable for a great case study behind this script
# addendum.]
NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
if [[ $EUID == 0 ]] ; then
PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
else
PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi
unset RED GREEN NORMAL
# End /etc/bashrc
EOF
Here is a base ~/.bash_profile
.
If you want each new user to have this file automatically,
just change the output of the 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>
# updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>
# 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
pathprepend $HOME/bin
fi
# Having . in the PATH is dangerous
#if [ $EUID -gt 99 ]; then
# pathappend .
#fi
# End ~/.bash_profile
EOF
Here is a base ~/.profile
. The
comments and instructions for using /etc/skel
for .bash_profile
above also apply here. Only
the target file names are different.
cat > ~/.profile << "EOF"
# Begin ~/.profile
# Personal environment variables and startup programs.
if [ -d "$HOME/bin" ] ; then
pathprepend $HOME/bin
fi
# Set up user specific i18n variables
#export LANG=<ll>
_<CC>
.<charmap>
<@modifiers>
# End ~/.profile
EOF
Here is a base ~/.bashrc
.
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
# Set up user specific i18n variables
#export LANG=<ll>
_<CC>
.<charmap>
<@modifiers>
# End ~/.bashrc
EOF
This is an empty ~/.bash_logout
that can be used as a template. 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 shown 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.
dircolors -p > /etc/dircolors
If you wish to customize the colors used for different file
types, you can edit the /etc/dircolors
file. The instructions for
setting the colors are embedded in the file.
Finally, 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.
Last updated on 2018-12-02 14:36:16 -0800
The LFS book installs Vim as its text editor. At this point it should be noted that there are a lot of different editing applications 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 creates a basic vimrc
file. In this section you'll find an
attempt to enhance this file. At startup, vim reads the global
configuration file (/etc/vimrc
)
as well as a user-specific file (~/.vimrc
). Either or both can be tailored to
suit the needs of your particular system.
Here is a slightly expanded .vimrc
that you can put in ~/.vimrc
to provide user specific effects. 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 the home directory of
users already on the system, such as root
. Be sure to set permissions, owner,
and group if you do copy anything directly from /etc/skel
.
" Begin .vimrc
set columns=80
set wrapmargin=8
set ruler
" End .vimrc
Note that the comment tags are " instead of the more usual # or
//. This is correct, the syntax for vimrc
is slightly unusual.
Below you'll find a quick explanation of what each of the options in this example file means here:
set columns=80
: This simply
sets the number of columns used on the screen.
set wrapmargin=8
: This is the
number of characters from the right window border where
wrapping starts.
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.
Last updated on 2007-10-16 06:02:24 -0700
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
not interpret the escape
sequences shown below.
One of the most common things which people want to do is 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
issue the command 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 characters
(normally '^[[H^[[2J') on the first line alone.
Terminal escape sequences are special codes recognized by the terminal. The ^[ represents an ASCII ESC character. The sequence ESC [ H puts the cursor in the upper left hand corner of the screen and ESC 2 J erases the screen. For more information on terminal escape sequences see http://rtfm.etla.org/xterm/ctlseq.html
The following sequences 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 character sequences to display various information. All
issue
sequences 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., i686.
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.6.11.12.
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.
Last updated on 2007-04-04 12:42:53 -0700
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.
Install the /etc/rc.d/init.d/random
init script included
with the blfs-bootscripts-20180105 package.
make install-random
Last updated on 2016-06-03 20:04:06 -0700
The lsb_release script gives information about the Linux Standards Base (LSB) status of the distribution.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://downloads.sourceforge.net/lsb/lsb-release-1.4.tar.gz
Download MD5 sum: 30537ef5a01e0ca94b7b8eb6a36bb1e4
Download size: 12 KB
Estimated disk space required: 80 KB
Estimated build time: less than 0.1 SBU
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/lsb_release
First fix a minor display problem:
sed -i "s|n/a|unavailable|" lsb_release
Install lsb_release by running the following commands:
./help2man -N --include ./lsb_release.examples \ --alt_version_key=program_version ./lsb_release > lsb_release.1
Now, as the root
user:
install -v -m 644 lsb_release.1 /usr/share/man/man1 && install -v -m 755 lsb_release /usr/bin
The configuration for this package was done in
LFS. The file /etc/lsb-release
should already exist. Be
sure that the DISTRIB_CODENAME entry has been set properly.
Last updated on 2019-02-15 10:41:18 -0800
Security takes many forms in a computing environment. After some initial discussion, 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. The Network Security Services (NSS) and Netscape Portable Runtime (NSPR) libraries can be installed and shared among the many applications requiring them. For applications that don't offer the best security, you can use the Stunnel package to wrap an application daemon inside an SSL tunnel.
Prevention of breaches, like a trojan, are assisted by applications like GnuPG, specifically the ability to confirm signed packages, which recognizes modifications of the tarball 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.
All software has bugs. Sometimes, a bug can be exploited, for example to allow users to gain enhanced privileges (perhaps gaining a root shell, or simply accessing or deleting other user's files), or to allow a remote site to crash an application (denial of service), or for theft of data. These bugs are labelled as vulnerabilities.
The main place where vulnerabilities get logged is cve.mitre.org. Unfortunately, many vulnerability numbers (CVE-yyyy-nnnn) are initially only labelled as "reserved" when distributions start issuing fixes. Also, some vulnerabilities apply to particular combinations of configure options, or only apply to old versions of packages which have long since been updated in BLFS.
BLFS differs from distributions - there is no BLFS security team, and the editors only become aware of vulnerabilities after they are public knowledge. Sometimes, a package with a vulnerability will not be updated in the book for a long time. Issues can be logged in the Trac system, which might speed up resolution.
The normal way for BLFS to fix a vulnerability is, ideally, to update the book to a new fixed release of the package. Sometimes that happens even before the vulnerability is public knowledge, so there is no guarantee that it will be shown as a vulnerability fix in the Changelog. Alternatively, a sed command, or a patch taken from a distribution, may be appropriate.
The bottom line is that you are responsible for your own security, and for assessing the potential impact of any problems.
To keep track of what is being discovered, you may wish to follow the security announcements of one or more distributions. For example, Debian has Debian security. Fedora's links on security are at the Fedora wiki. Details of Gentoo linux security announcements are discussed at Gentoo security. Finally, the Slackware archives of security announcements are at Slackware security.
The most general English source is perhaps the Full Disclosure Mailing List, but please read the comment on that page. If you use other languages you may prefer other sites such as http://www.heise.de/security heise.de (German) or cert.hr (Croatian). These are not linux-specific. There is also a daily update at lwn.net for subscribers (free access to the data after 2 weeks, but their vulnerabilities database at lwn.net/Vulnerabilities is unrestricted).
For some packages, subscribing to their 'announce' lists will provide prompt news of newer versions.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/vulnerabilities
Last updated on 2015-09-20 15:38:20 -0700
Public Key Infrastructure (PKI) is a method to validate the authenticity of an otherwise unknown entity across untrusted networks. PKI works by establishing a chain of trust, rather than trusting each individual host or entity explicitly. In order for a certificate presented by a remote entity to be trusted, that certificate must present a complete chain of certificates that can be validated using the root certificate of a Certificate Authority (CA) that is trusted by the local machine.
Establishing trust with a CA involves validating things like company address, ownership, contact information, etc., and ensuring that the CA has followed best practices, such as undergoing periodic security audits by independent investigators and maintaining an always available certificate revocation list. This is well outside the scope of BLFS (as it is for most Linux distributions). The certificate store provided here is taken from the Mozilla Foundation, who have established very strict inclusion policies described here.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://github.com/djlucas/make-ca/releases/download/v1.2/make-ca-1.2.tar.xz
Download size: 28 KB
Download MD5 Sum: 5b68cf77b02d5681f8419b8acfd139c0
Estimated disk space required: 6.6 MB (with all runtime deps)
Estimated build time: 0.1 SBU (with all runtime deps)
p11-kit-0.23.15 (required at runtime to generate certificate stores from trust anchors)
Java-11.0.2 or OpenJDK-11.0.2 (to generate a java PKCS#12 store), and NSS-3.42.1 (to generate a shared NSSDB)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/make-ca
The make-ca script will
download and process the certificates included in the
certdata.txt
file for use as
trust anchors for the p11-kit-0.23.15 trust module.
Additionally, it will generate system certificate stores used
by BLFS applications (if the recommended and optional
applications are present on the system). Any local
certificates stored in /etc/ssl/local
will be imported to both the
trust anchors and the generated certificate stores
(overriding Mozilla's trust).
To install the various certificate stores, first install the
make-ca script into the
correct location. As the root
user:
make install
As the root
user, after
installing p11-kit-0.23.15, download the
certificate source and prepare for system use with the
following command:
If running the script a second time with the same version
of certdata.txt
, for
instance, to add additional stores as the requisite
software is installed, add the -r
switch to the command
line. If packaging, run make-ca --help to see all
available command line options.
/usr/sbin/make-ca -g
Previous versions of BLFS used the path /etc/ssl/ca-bundle.crt
for the GnuTLS-3.6.6
certificate store. If software is still installed that
references this file, create a compatibility symlink for the
old location as the root
user:
ln -sfv /etc/pki/tls/certs/ca-bundle.crt \ /etc/ssl/ca-bundle.crt
You should periodically update the store with the above
command either manually, or via a cron job.
If you've installed Fcron-3.2.1 and completed the section
on periodic jobs, execute the following commands, as
the root
user, to
create a weekly cron job:
install -vdm755 /etc/cron.weekly &&
cat > /etc/cron.weekly/update-pki.sh << "EOF" &&
#!/bin/bash
/usr/sbin/make-ca -g
EOF
chmod 754 /etc/cron.weekly/update-pki.sh
For most users, no additional configuration is necessary,
however, the default certdata.txt
file provided by make-ca is
obtained from the mozilla-release branch, and is modified to
provide a Mercurial revision. This will be the correct
version for most systems. There are several other variants of
the file available for use that might be preferred for one
reason or another, including the files shipped with Mozilla
products in this book. RedHat and OpenSUSE, for instance, use
the version included in NSS-3.42.1. Additional upstream downloads
are available at the links included in /etc/make-ca.conf.dist
. Simply copy the
file to /etc/make-ca.conf
and
edit as appropriate.
There are three trust types that are recognized by the
make-ca script, SSL/TLS,
S/Mime, and code signing. For OpenSSL, these are serverAuth
, emailProtection
, and codeSigning
respectively. If
one of the three trust arguments is omitted, the certificate
is neither trusted, nor rejected for that role. Clients that
use OpenSSL or NSS encountering this certificate will
present a warning to the user. Clients using GnuTLS without p11-kit support are not aware of trusted
certificates. To include this CA into the ca-bundle.crt
, email-ca-bundle.crt
, or objsign-ca-bundle.crt
files (the
GnuTLS legacy bundles), it
must have the appropriate trust arguments.
The /etc/ssl/local
directory is
available to add additional CA certificates to the system.
For instance, you might need to add an organization or
government CA certificate. Files in this directory must be in
the OpenSSL trusted
certificate format. To create an OpenSSL trusted certificate from a
regular PEM encoded file, you need to add trust arguments to
the openssl
command, and create a new certificate. For example, using the
CAcert
roots, if you want to trust both for all three roles, the
following commands will create appropriate OpenSSL trusted
certificates (run as the root
user after Wget-1.20.1 is installed):
install -vdm755 /etc/ssl/local && wget http://www.cacert.org/certs/root.crt && wget http://www.cacert.org/certs/class3.crt && openssl x509 -in root.crt -text -fingerprint -setalias "CAcert Class 1 root" \ -addtrust serverAuth -addtrust emailProtection -addtrust codeSigning \ > /etc/ssl/local/CAcert_Class_1_root.pem && openssl x509 -in class3.crt -text -fingerprint -setalias "CAcert Class 3 root" \ -addtrust serverAuth -addtrust emailProtection -addtrust codeSigning \ > /etc/ssl/local/CAcert_Class_3_root.pem
Occasionally, there may be instances where you don't agree
with Mozilla's inclusion of a particular certificate
authority. If you'd like to override the default trust of a
particular CA, simply create a copy of the existing
certificate in /etc/ssl/local
with different trust arguments. For example, if you'd like to
distrust the "Makebelieve_CA_Root" file, run the following
commands:
install -vdm755 /etc/ssl/local && openssl x509 -in /etc/ssl/certs/Makebelieve_CA_Root.pem \ -text \ -fingerprint -setalias "Disabled Makebelieve CA Root" \ -addreject serverAuth \ -addreject emailProtection \ -addreject codeSigning \ > /etc/ssl/local/Disabled_Makebelieve_CA_Root.pem && /usr/sbin/make-ca -r -f
Last updated on 2019-02-23 21:09:58 -0800
The ConsoleKit package is a framework for keeping track of the various users, sessions, and seats present on a system. It provides a mechanism for software to react to changes of any of these items or of any of the metadata associated with them.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://github.com/Consolekit2/ConsoleKit2/releases/download/1.2.1/ConsoleKit2-1.2.1.tar.bz2
Download MD5 sum: 17d31475f9b08969e55ea60750f4f219
Download size: 1.1 MB
Estimated disk space required: 18 MB
Estimated build time: 0.2 SBU
dbus-glib-0.110 and Xorg Libraries
Linux-PAM-1.3.0, Polkit-0.115, and pm-utils-1.4.1 (run-time dependency to allow ConsoleKit2 to put the system in “Suspend” or “Hibernation” mode)
If you intend NOT to install polkit, you will need to manually edit the ConsoleKit.conf file to lock down the service. Failure to do so may be a huge SECURITY HOLE.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/consolekit
Install ConsoleKit by running the following commands:
./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var \ --enable-udev-acl \ --enable-pam-module \ --enable-polkit \ --with-xinitrc-dir=/etc/X11/app-defaults/xinitrc.d \ --docdir=/usr/share/doc/ConsoleKit-1.2.1 \ --with-systemdsystemunitdir=no && make
This package does not come with a test suite.
Now, as the root
user:
make install && mv -v /etc/X11/app-defaults/xinitrc.d/90-consolekit{,.sh}
--enable-udev-acl
:
This switch enables building of the udev-acl tool, which is
used to allow normal users to access device nodes normally
only accessible to root
.
--enable-pam-module
:
This switch enables building of the ConsoleKit PAM module which is needed for
ConsoleKit to work correctly
with PAM. Remove if
Linux PAM is NOT installed.
--enable-polkit
:
Enable PolicyKit support.
--with-xinitrc-dir=/etc/X11/app-defaults/xinitrc.d
:
Fix the location of the 90-consolekit.sh script. Notice that
the script has been renamed after installation, because
xinitrc only sources script names ending with extension
.sh.
--with-systemdsystemunitdir=no
:
Disable attempting to build with systemd libraries.
--enable-docbook-docs
: Use this
switch if xmlto is installed
and you wish to build the user and API documentation.
If you use Linux PAM, it
needs to be configured to activate ConsoleKit upon user login. This can
be achieved by editing the /etc/pam.d/system-session
file as the
root
user:
cat >> /etc/pam.d/system-session << "EOF"
# Begin ConsoleKit addition
session optional pam_loginuid.so
session optional pam_ck_connector.so nox11
# End ConsoleKit addition
EOF
You will also need a helper script that creates a file in
/var/run/console
named as the
currently logged in user and that contains the D-Bus address of the session. You can
create the script by running the following commands as the
root
user:
cat > /usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck << "EOF" #!/bin/sh TAGDIR=/var/run/console [ -n "$CK_SESSION_USER_UID" ] || exit 1 [ "$CK_SESSION_IS_LOCAL" = "true" ] || exit 0 TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" if [ "$1" = "session_added" ]; then mkdir -p "$TAGDIR" echo "$CK_SESSION_ID" >> "$TAGFILE" fi if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" [ -s "$TAGFILE" ] || rm -f "$TAGFILE" fi EOF chmod -v 755 /usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck
See /usr/share/doc/ConsoleKit/spec/ConsoleKit.html for more configuration.
is a utility that provides information from the ConsoleKit database about what users have logged into the system. |
|
is a utility for starting a command in its own ConsoleKit session. |
|
list sessions with respective properties. Also good for debugging purposes. |
|
write system restart to log. |
|
write system start to log. |
|
write system stop to log. |
|
is the ConsoleKit daemon. |
Last updated on 2019-02-17 10:23:01 -0800
The CrackLib package contains a library used to enforce strong passwords by comparing user selected passwords to words in chosen word lists.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://github.com/cracklib/cracklib/releases/download/cracklib-2.9.6/cracklib-2.9.6.tar.gz
Download MD5 sum: c52f463585d85924b28cdc1e373ae06d
Download size: 628 KB
Estimated disk space required: 3.8 MB
Estimated build time: less than 0.1 SBU
Recommended word list for English-speaking countries (size: 5.3 MB; md5sum: cae1257e3a9f95c917cc9dbbab852316): https://github.com/cracklib/cracklib/releases/download/cracklib-2.9.6/cracklib-words-2.9.6.gz
There are additional word lists available for download, e.g., from http://www.cotse.com/tools/wordlists.htm. CrackLib can utilize as many, or as few word lists you choose to install.
Users tend to base their passwords on regular words of the spoken language, and crackers know that. CrackLib is intended to filter out such bad passwords at the source using a dictionary created from word lists. To accomplish this, the word list(s) for use with CrackLib must be an exhaustive list of words and word-based keystroke combinations likely to be chosen by users of the system as (guessable) passwords.
The default word list recommended above for downloading mostly satisfies this role in English-speaking countries. In other situations, it may be necessary to download (or even create) additional word lists.
Note that word lists suitable for spell-checking are not usable as CrackLib word lists in countries with non-Latin based alphabets, because of “word-based keystroke combinations” that make bad passwords.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/cracklib
Install CrackLib by running the following commands:
sed -i '/skipping/d' util/packer.c && ./configure --prefix=/usr \ --disable-static \ --with-default-dict=/lib/cracklib/pw_dict && make
Now, as the root
user:
make install && mv -v /usr/lib/libcrack.so.* /lib && ln -sfv ../../lib/$(readlink /usr/lib/libcrack.so) /usr/lib/libcrack.so
Issue the following commands as the root
user to install the recommended word
list and create the CrackLib
dictionary. Other word lists (text based, one word per line)
can also be used by simply installing them into /usr/share/dict
and adding them to the
create-cracklib-dict
command.
install -v -m644 -D ../cracklib-words-2.9.6.gz \ /usr/share/dict/cracklib-words.gz && gunzip -v /usr/share/dict/cracklib-words.gz && ln -v -sf cracklib-words /usr/share/dict/words && echo $(hostname) >> /usr/share/dict/cracklib-extra-words && install -v -m755 -d /lib/cracklib && create-cracklib-dict /usr/share/dict/cracklib-words \ /usr/share/dict/cracklib-extra-words
If desired, check the proper operation of the library as an unprivileged user by issuing the following command:
make test
If you are installing CrackLib after your LFS system has been completed and you have the Shadow package installed, you must reinstall Shadow-4.6 if you wish to provide strong password support on your system. If you are now going to install the Linux-PAM-1.3.0 package, you may disregard this note as Shadow will be reinstalled after the Linux-PAM installation.
sed -i '/skipping/d' util/packer.c: Remove a meaningless warning.
--with-default-dict=/lib/cracklib/pw_dict
:
This parameter forces the installation of the CrackLib dictionary to the /lib
hierarchy.
--disable-static
:
This switch prevents installation of static versions of the
libraries.
mv -v /usr/lib/libcrack.so.2*
/lib and ln -v
-sf ../../lib/libcrack.so.2.8.1 ...: These
two commands move the libcrack.so.2.9.0
library and associated
symlink from /usr/lib
to
/lib
, then recreates the
/usr/lib/libcrack.so
symlink
pointing to the relocated file.
install -v -m644 -D
...: This command creates the /usr/share/dict
directory (if it doesn't
already exist) and installs the compressed word list there.
ln -v -s cracklib-words
/usr/share/dict/words: The word list is
linked to /usr/share/dict/words
as historically, words
is the
primary word list in the /usr/share/dict
directory. Omit this
command if you already have a /usr/share/dict/words
file installed on
your system.
echo $(hostname)
>>...: The value of hostname is echoed to a
file called cracklib-extra-words
. This extra file is
intended to be a site specific list which includes easy to
guess passwords such as company or department names, user
names, product names, computer names, domain names, etc.
create-cracklib-dict ...: This command creates the CrackLib dictionary from the word lists. Modify the command to add any additional word lists you have installed.
is used to determine if a password is strong. |
|
is used to format text files (lowercases all words, removes control characters and sorts the lists). |
|
creates a database with words read from standard input. |
|
displays on standard output the database specified. |
|
is used to create the CrackLib dictionary from the given word list(s). |
|
provides a fast dictionary lookup method for strong password enforcement. |
Last updated on 2019-02-15 13:01:29 -0800
cryptsetup is used to set up transparent encryption of block devices using the kernel crypto API.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://www.kernel.org/pub/linux/utils/cryptsetup/v2.0/cryptsetup-2.0.6.tar.xz
Download MD5 sum: ec03e09cbe978a19fa6d6194ac642bae
Download size: 10 MB
Estimated disk space required: 25 MB (add 9 MB for tests)
Estimated build time: 0.2 SBU (add 12 SBU for tests)
JSON-C-0.13.1, libgcrypt-1.8.4, LVM2-2.03.02, and popt-1.16
libpwquality-1.4.0, Python-2.7.15, and passwdqc
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/cryptsetup
Encrypted block devices require kernel support. To use it, the appropriate kernel configuration parameters need to be set:
Device Drivers --->
[*] Multiple devices driver support (RAID and LVM) ---> [CONFIG_MD]
<*/M> Device mapper support [CONFIG_BLK_DEV_DM]
<*/M> Crypt target support [CONFIG_DM_CRYPT]
Cryptographic API --->
<*/M> XTS support [CONFIG_CRYPTO_XTS]
<*/M> SHA224 and SHA256 digest algorithm [CONFIG_CRYPTO_SHA256]
<*/M> AES cipher algorithms [CONFIG_CRYPTO_AES]
<*/M> AES cipher algorithms (x86_64) [CONFIG_CRYPTO_AES_X86_64]
<*/M> User-space interface for symmetric key cipher algorithms
[CONFIG_CRYPTO_USER_API_SKCIPHER]
For tests:
<*/M> Twofish cipher algorithm [CONFIG_CRYPTO_TWOFISH]
Install cryptsetup by running the following commands:
./configure --prefix=/usr \ --with-crypto_backend=openssl && make
To test the result, issue as the root
user: make check. Some tests may
fail if the kernel configuration parameters above are not
set. One (of 12) tests is known to fail.
Now, as the root
user:
make install
--with-crypto_backend=openssl
:
This parameter selects the cryptographic libraries to use
with the application. gcrypt
is the default.
Because of the number of possible configurations, setup of encrypted volumes is beyond the scope of the BLFS book. Please see the configuration guide in the cryptsetup FAQ.
is used to setup dm-crypt managed device-mapper mappings. |
|
is a for offline LUKS device re-encryption. |
|
is a tool to manage dm-integrity (block level integrity) volumes. |
|
is used to configure dm-verity managed device-mapper mappings. Device-mapper verity target provides read-only transparent integrity checking of block devices using kernel crypto API. |
Last updated on 2019-02-16 19:14:14 -0800
The Cyrus SASL package contains a Simple Authentication and Security Layer, a method for adding authentication support to connection-based protocols. To use SASL, a protocol includes a command for identifying and authenticating a user to a server and for optionally negotiating protection of subsequent protocol interactions. If its use is negotiated, a security layer is inserted between the protocol and the connection.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.27/cyrus-sasl-2.1.27.tar.gz
Download MD5 sum: a33820c66e0622222c5aefafa1581083
Download size: 3.9 MB
Estimated disk space required: 26 MB
Estimated build time: 0.1 SBU
Linux-PAM-1.3.0, MIT Kerberos V5-1.17, MariaDB-10.3.13 or MySQL, OpenJDK-11.0.2, OpenLDAP-2.4.47, PostgreSQL-11.2, SQLite-3.27.1, krb4 and Dmalloc
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/cyrus-sasl
This package does not support parallel build.
Install Cyrus SASL by running the following commands:
./configure --prefix=/usr \ --sysconfdir=/etc \ --enable-auth-sasldb \ --with-dbpath=/var/lib/sasl/sasldb2 \ --with-saslauthd=/var/run/saslauthd && make -j1
This package does not come with a test suite. If you are planning on using the GSSAPI authentication mechanism, test it after installing the package using the sample server and client programs which were built in the preceding step. Instructions for performing the tests can be found at http://www.linuxfromscratch.org/hints/downloads/files/cyrus-sasl.txt.
Now, as the root
user:
make install && install -v -dm755 /usr/share/doc/cyrus-sasl-2.1.27/html && install -v -m644 saslauthd/LDAP_SASLAUTHD /usr/share/doc/cyrus-sasl-2.1.27 && install -v -m644 doc/html/*.html /usr/share/doc/cyrus-sasl-2.1.27/html && install -v -dm700 /var/lib/sasl
--with-dbpath=/var/lib/sasl/sasldb2
:
This switch forces the sasldb database to be
created in /var/lib/sasl
instead of /etc
.
--with-saslauthd=/var/run/saslauthd
:
This switch forces saslauthd to use the FHS
compliant directory /var/run/saslauthd
for variable run-time
data.
--enable-auth-sasldb
:
This switch enables SASLDB authentication backend.
--with-dblib=gdbm
: This switch
forces GDBM to be used
instead of Berkeley DB.
--with-ldap
: This switch enables
the OpenLDAP support.
--enable-ldapdb
: This switch
enables the LDAPDB authentication backend. There is a
circular dependency with this parameter. See http://wiki.linuxfromscratch.org/blfs/wiki/cyrus-sasl
for a solution to this problem.
--enable-java
: This switch
enables compiling of the Java support libraries.
--enable-login
: This option
enables unsupported LOGIN authentication.
--enable-ntlm
: This option
enables unsupported NTLM authentication.
install -v -m644 ...: These commands install documentation which is not installed by the make install command.
install -v -m700 -d /var/lib/sasl: This directory must exist when starting saslauthd or using the sasldb plugin. If you're not going to be running the daemon or using the plugins, you may omit the creation of this directory.
/etc/saslauthd.conf
(for
saslauthd
LDAP configuration) and /etc/sasl2/Appname.conf
(where "Appname"
is the application defined name of the application)
See file:///usr/share/doc/cyrus-sasl-2.1.27/sysadmin.html for information on what to include in the application configuration files.
See file:///usr/share/doc/cyrus-sasl-2.1.27/LDAP_SASLAUTHD for configuring saslauthd with OpenLDAP.
See file:///usr/share/doc/cyrus-sasl-2.1.27/gssapi.html for configuring saslauthd with Kerberos.
If you need to run the saslauthd daemon at
system startup, install the /etc/rc.d/init.d/saslauthd
init script
included in the blfs-bootscripts-20180105 package
using the following command:
make install-saslauthd
You'll need to modify /etc/sysconfig/saslauthd
and modify the
AUTHMECH
parameter with your
desired authentication mechanism.
is used to list loadable SASL plugins and their properties. |
|
is the SASL authentication server. |
|
is used to list the users in the SASL password
database |
|
is used to set and delete a user's SASL password
and mechanism specific secrets in the SASL password
database |
|
is a test utility for the SASL authentication server. |
|
is a general purpose authentication library for server and client applications. |
Last updated on 2019-02-16 01:24:48 -0800
The GnuPG package is GNU's tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC2440 and the S/MIME standard as described by several RFCs. GnuPG 2 is the stable version of GnuPG integrating support for OpenPGP and S/MIME.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.2.13.tar.bz2
Download MD5 sum: 563b959d0c3856e34526e9ca51c80d7b
Download size: 6.4 MB
Estimated disk space required: 149 MB (with all tests; add 24 MB for docs)
Estimated build time: 0.4 SBU (using parallelism=4; add 0.5 SBU for tests)
Libassuan-2.5.3, libgcrypt-1.8.4, libgpg-error-1.35, Libksba-1.3.5, and npth-1.6
pinentry-1.1.0 (Run-time requirement for most of the package's functionality)
cURL-7.64.0, GnuTLS-3.6.6, ImageMagick-7.0.8-27 (for the convert utility, used for generating the documentation), libusb-1.0.22, an MTA, OpenLDAP-2.4.47, SQLite-3.27.1, texlive-20180414 (or install-tl-unx), fig2dev (for generating documentation), and GNU adns
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gnupg2
If you are upgrading from gnupg prior to version 2.1,
upstream developers recommend backing up ~/.gnupg
because some additional
configuration will probably be necessary and you could lose
your keys. You can find instructions at http://jo-ke.name/wp/?p=111
and
https://wiki.archlinux.org/index.php/GnuPG#.22Lost.22_keys.2C_upgrading_to_gnupg_version_2.1.
If the top directory path where the source is unpacked contains symbolic links, the openpgp tests may fail. If this is your case and you wish to run the test suite, fix that with:
sed -e '/noinst_SCRIPTS = gpg-zip/c sbin_SCRIPTS += gpg-zip' \ -i tools/Makefile.in
Install GnuPG by running the following commands:
./configure --prefix=/usr \ --enable-symcryptrun \ --docdir=/usr/share/doc/gnupg-2.2.13 && make && makeinfo --html --no-split -o doc/gnupg_nochunks.html doc/gnupg.texi && makeinfo --plaintext -o doc/gnupg.txt doc/gnupg.texi
If you have texlive-20180414 installed and you wish to create documentation in alternate formats, issue the following commands (fig2dev is needed for the ps format):
make -C doc pdf ps html
To test the results, issue: make check.
Note that if you have already installed GnuPG, the instructions below will
overwrite /usr/share/man/man1/gpg-zip.1
. Now, as the
root
user:
make install && install -v -m755 -d /usr/share/doc/gnupg-2.2.13/html && install -v -m644 doc/gnupg_nochunks.html \ /usr/share/doc/gnupg-2.2.13/html/gnupg.html && install -v -m644 doc/*.texi doc/gnupg.txt \ /usr/share/doc/gnupg-2.2.13
If you created alternate formats of the documentation,
install it using the following command as the root
user:
install -v -m644 doc/gnupg.html/* \ /usr/share/doc/gnupg-2.2.13/html && install -v -m644 doc/gnupg.{pdf,dvi,ps} \ /usr/share/doc/gnupg-2.2.13
sed ... tools/Makefile.in: This command is needed to build the gpg-zip program.
--docdir=/usr/share/doc/gnupg-2.2.13
:
This switch changes the default docdir to /usr/share/doc/gnupg-2.2.13
.
--enable-symcryptrun
:
This switch enables building the symcryptrun program.
--enable-all-tests
: allows more
tests to be run with make
check.
--enable-g13
: This switch enables
building the g13 program.
is used to create and populate user's |
|
is a wrapper script used to run gpgconf with the
|
|
is a tool that takes care of accessing the OpenPGP keyservers. |
|
is a tool to contact a running dirmngr and test whether a certificate has been revoked. |
|
is a tool to create, mount or unmount an encrypted file system container (optional). |
|
is a daemon used to manage secret (private) keys independently from any protocol. It is used as a backend for gpg2 and gpgsm as well as for a couple of other utilities. |
|
is a utility used to communicate with a running gpg-agent. |
|
is the OpenPGP part of the GNU Privacy Guard (GnuPG). It is a tool used to provide digital encryption and signing services using the OpenPGP standard. |
|
is a utility used to automatically and reasonably
safely query and modify configuration files in the
|
|
is a utility currently only useful for debugging.
Run it with |
|
executes the given scheme program or spawns an interactive shell. |
|
is a tool similar to gpg2 used to provide digital encryption and signing services on X.509 certificates and the CMS protocol. It is mainly used as a backend for S/MIME mail processing. |
|
is a tool to encrypt or sign files into an archive. |
|
is a verify only version of gpg2. |
|
encrypts or signs files into an archive. |
|
is used to list, export and import Keybox data. |
|
is a simple symmetric encryption tool. |
|
is used to listen to a Unix Domain socket created by any of the GnuPG tools. |
Last updated on 2019-02-16 19:14:14 -0800
The GnuTLS package contains libraries and userspace tools which provide a secure layer over a reliable transport layer. Currently the GnuTLS library implements the proposed standards by the IETF's TLS working group. Quoting from the TLS protocol specification:
“The TLS protocol provides communications privacy over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery.”
GnuTLS provides support for TLS 1.2, TLS 1.1, TLS 1.0, and SSL 3.0 protocols, TLS extensions, including server name and max record size. Additionally, the library supports authentication using the SRP protocol, X.509 certificates and OpenPGP keys, along with support for the TLS Pre-Shared-Keys (PSK) extension, the Inner Application (TLS/IA) extension and X.509 and OpenPGP certificate handling.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.6.tar.xz
Download MD5 sum: 30c5b63686edcd260d87d8fb8a06977f
Download size: 7.9 MB
Estimated disk space required: 145 MB (add 94 MB for tests)
Estimated build time: 0.6 SBU (using parallelism=4; add 6.7 SBU for tests)
make-ca-1.2, libunistring-0.9.10, libtasn1-4.13, and p11-kit-0.23.15
Doxygen-1.8.15, GTK-Doc-1.29, Guile-2.2.4, libidn-1.35 or libidn2-2.1.1 Net-tools-CVS_20101030 (used during the test suite), texlive-20180414 or install-tl-unx, Unbound-1.9.0 (to build the DANE library), Valgrind-3.14.0 (used during the test suite), autogen, cmocka and datefudge (used during the test suite if the DANE library is built), and Trousers (Trusted Platform Module support)
Note that if you do not install libtasn1-4.13, an older version shipped in the GnuTLS tarball will be used instead.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gnutls
Install GnuTLS by running the following commands:
./configure --prefix=/usr \ --disable-guile \ --with-default-trust-store-pkcs11="pkcs11:" && make
To test the results, issue: make check. If a prior
version of GnuTLS (or the
same version but without all of the recommended dependencies)
has been installed, some tests may fail. If /usr/lib/libgnutls.so
and the target of
that symlink are moved or renamed so that they cannot be
found, all tests should pass and the install procedure will
restore libgnutls.so
and the
versioned library it points to.
Now, as the root
user:
make install
If you passed --enable-gtk-doc
to
the configure
script, the API will automatically be installed. Otherwise,
if desired, you can still install the API documentation to
the /usr/share/gtk-doc/html/gnutls
directory
using the following command as the root
user:
make -C doc/reference install-data-local
--with-default-trust-store-pkcs11="pkcs11:"
:
This switch tells gnutls to use the PKCS #11 trust store as
the default trust. Omit this switch if p11-kit-0.23.15 is not
installed.
--with-default-trust-store-file=/etc/pki/tls/certs/ca-bundle.crt
:
This switch tells configure where to find the
legacy CA certificate bundle and to use it instead of PKCS
#11 module by default. Use this if p11-kit-0.23.15 is not
installed.
--enable-gtk-doc
: Use this
parameter if GTK-Doc is
installed and you wish to rebuild and install the API
documentation.
--enable-openssl-compatibility
:
Use this switch if you wish to build the OpenSSL
compatibility library.
--without-p11-kit
: use this
switch if you have not installed p11-kit.
--with-included-unistring
: uses
the bundled version of libunistring, instead of the system
one. Use this switch if you have not installed libunistring-0.9.10.
is used to generate X.509 certificates, certificate requests, and private keys. |
|
is a tool used to generate and check DNS resource records for the DANE protocol. |
|
is a simple client program to set up a TLS connection to some other computer. |
|
is a simple client program to set up a TLS connection to some other computer and produces very verbose progress results. |
|
is a simple server program that listens to incoming TLS connections. |
|
is a program that can parse and print information about OCSP requests/responses, generate requests and verify responses. |
|
is a program that allows handling data from PKCS #11 smart cards and security modules. |
|
is a simple program that generates random keys for use with TLS-PSK. |
|
is a simple program that emulates the programs in the Stanford SRP (Secure Remote Password) libraries using GnuTLS. |
|
contains the core API functions and X.509 certificate API functions. |
Last updated on 2019-02-15 13:01:29 -0800
The GPGME package is a C library that allows cryptography support to be added to a program. It is designed to make access to public key crypto engines like GnuPG or GpgSM easier for applications. GPGME provides a high-level crypto API for encryption, decryption, signing, signature verification and key management.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.12.0.tar.bz2
Download MD5 sum: 902fca3a94907efe4e929b2ade545a7c
Download size: 1.6 MB
Estimated disk space required: 163 MB (with all bindings)
Estimated build time: 0.6 SBU (with parallelism=4; with all bindings, add 0.5 SBU for tests)
Doxygen-1.8.15 (for API documentation), GnuPG-2.2.13 (required if Qt or SWIG are installed; used during the testsuite), Clisp-2.49, Python-2.7.15, Qt-5.12.1, and/or SWIG-3.0.12 (for language bindings)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gpgme
Install GPGME by running the following commands:
./configure --prefix=/usr --disable-gpg-test && make
To test the results, you should have GnuPG-2.2.13 installed and remove the --disable-gpg-test above. Issue: make check.
Now, as the root
user:
make install
--disable-gpg-test
:
if this parameter is not passed to configure, the test
programs are built during make stage, which requires
GnuPG-2.2.13. This parameter is not needed
if GnuPG-2.2.13 is installed.
Last updated on 2019-02-16 19:14:14 -0800
The Haveged package contains a daemon that generates an unpredictable stream of random numbers and feeds the /dev/random device.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://downloads.sourceforge.net/haveged/haveged-1.9.2.tar.gz
Download MD5 sum: fb1d8b3dcbb9d06b30eccd8aa500fd31
Download size: 484 KB
Estimated disk space required: 20 MB (with tests)
Estimated build time: 0.1 SBU (with tests)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/haveged
Install Haveged by running the following commands:
./configure --prefix=/usr && make
To test the results, issue: make check.
Now, as the root
user:
make install && mkdir -pv /usr/share/doc/haveged-1.9.2 && cp -v README /usr/share/doc/haveged-1.9.2
If you want the Haveged
daemon to start automatically when the system is booted,
install the /etc/rc.d/init.d/haveged
init script
included in the blfs-bootscripts-20180105 package
(as the root
user):
make install-haveged
Last updated on 2019-02-15 10:41:18 -0800
The next part of this chapter deals with firewalls. The principal firewall tool for Linux is Iptables. You will need to install Iptables if you intend on using any form of a firewall.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): http://www.netfilter.org/projects/iptables/files/iptables-1.8.2.tar.bz2
Download (FTP): ftp://ftp.netfilter.org/pub/iptables/iptables-1.8.2.tar.bz2
Download MD5 sum: 944558e88ddcc3b9b0d9550070fa3599
Download size: 664 KB
Estimated disk space required: 17 MB
Estimated build time: 0.2 SBU
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/iptables
A firewall in Linux is accomplished through a portion of the kernel called netfilter. The interface to netfilter is Iptables. To use it, the appropriate kernel configuration parameters are found in:
[*] Networking support ---> [CONFIG_NET]
Networking Options --->
[*] Network packet filtering framework (Netfilter) ---> [CONFIG_NETFILTER]
The installation below does not include building some
specialized extension libraries which require the raw
headers in the Linux
source code. If you wish to build the additional extensions
(if you aren't sure, then you probably don't), you can look
at the INSTALL
file to see an
example of how to change the KERNEL_DIR=
parameter to
point at the Linux source
code. Note that if you upgrade the kernel version, you may
also need to recompile Iptables and that the BLFS team has
not tested using the raw kernel headers.
For some non-x86 architectures, the raw kernel headers may
be required. In that case, modify the KERNEL_DIR=
parameter to
point at the Linux source
code.
Install Iptables by running the following commands:
./configure --prefix=/usr \ --sbindir=/sbin \ --disable-nftables \ --enable-libipq \ --with-xtlibdir=/lib/xtables && make
This package does not come with a test suite.
Now, as the root
user:
make install && ln -sfv ../../sbin/xtables-legacy-multi /usr/bin/iptables-xml && for file in ip4tc ip6tc ipq iptc xtables do mv -v /usr/lib/lib${file}.so.* /lib && ln -sfv ../../lib/$(readlink /usr/lib/lib${file}.so) /usr/lib/lib${file}.so done
--disable-nftables
:
This switch disables building nftables compat. Omit this
switch if you have installed nftables.
--enable-libipq
: This
switch enables building of libipq.so
which can be used by some
packages outside of BLFS.
--with-xtlibdir=/lib/xtables
:
Ensure all Iptables modules
are installed in the /lib/xtables
directory.
--enable-nfsynproxy
: This switch
enables installation of nfsynproxy SYNPROXY configuration tool.
ln -sfv ../../sbin/xtables-legacy-multi /usr/bin/iptables-xml: Ensure the symbolic link for iptables-xml is relative.
Introductory instructions for configuring your firewall are presented in the next section: Firewalling
To set up the iptables firewall at boot, install the
/etc/rc.d/init.d/iptables
init script included in the blfs-bootscripts-20180105 package.
make install-iptables
is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. |
|
is used to restore IP Tables from data specified on STDIN. Use I/O redirection provided by your shell to read from a file. |
|
is used to dump the contents of an IP Table in easily parseable format to STDOUT. Use I/O-redirection provided by your shell to write to a file. |
|
is used to convert the output of iptables-save to
an XML format. Using the |
|
are a set of commands for IPV6 that parallel the iptables commands above. |
|
(optional) configuration tool. SYNPROXY target makes handling of large SYN floods possible without the large performance penalties imposed by the connection tracking in such cases. |
|
is a binary that behaves according to the name it is called by. |
Last updated on 2019-02-18 13:07:03 -0800
Before you read this part of the chapter, you should have already installed iptables as described in the previous section.
The general purpose of a firewall is to protect a computer or a network against malicious access.
In a perfect world, every daemon or service on every machine is perfectly configured and immune to flaws such as buffer overflows or other problems regarding its security. Furthermore, you trust every user accessing your services. In this world, you do not need to have a firewall.
In the real world however, daemons may be misconfigured and exploits against essential services are freely available. You may wish to choose which services are accessible by certain machines or you may wish to limit which machines or applications are allowed external access. Alternatively, you may simply not trust some of your applications or users. You are probably connected to the Internet. In this world, a firewall is essential.
Don't assume however, that having a firewall makes careful configuration redundant, or that it makes any negligent misconfiguration harmless. It doesn't prevent 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 properly configured and up to date. A firewall is not a cure all, but should be an essential part of your overall security strategy.
The word firewall can have several different meanings.
This is a hardware device or software program commercially sold (or offered via freeware) by companies such as Symantec which claims that it secures a home or desktop computer connected to the Internet. This type of firewall is highly relevant for users who do not know how their computers might be accessed via the Internet or how to disable that access, especially if they are always online and connected via broadband links.
This is a system 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 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 relatively secure.
This is often an old computer you may have retired and nearly forgotten, performing masquerading or routing functions, but offering non-firewall services such as a web-cache or mail. This may be used for home networks, but is not to be considered as secure as a firewall only machine because the combination of server and router/firewall on one machine raises the complexity of the setup.
This box performs masquerading or routing, but grants public access to some branch of your network which, because of public IPs and a physically separated structure, is essentially a separate network with direct Internet access. The servers on this network are those which must be easily accessible from both the Internet and intranet. The firewall protects both networks. This type of firewall has a minimum of three network interfaces.
This introduction on how to setup a firewall 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 of how a firewall works. They are not intended to fit into any particular configuration and may not provide complete protection from an attack.
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. There you will find a list of URLs that contain quite comprehensive information about building your own firewall.
The firewall configuration script installed in the iptables section differs from the standard configuration script. It only has two of the standard targets: start and status. The other targets are clear and lock. For instance if you issue:
/etc/rc.d/init.d/iptables start
the firewall will be restarted just as it is upon system startup. The status target will present a list of all currently implemented rules. The clear target turns off all firewall rules and the lock target will block all packets in and out of the computer with the exception of the loopback interface.
The main startup firewall is located in the file /etc/rc.d/rc.iptables
. The sections below
provide three different approaches that can be used for a
system.
You should always run your firewall rules from a script. This ensures consistency and a record of what was done. It also allows retention of comments that are essential for understanding the rules long after they were written.
A Personal Firewall is designed to let you access all the 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. It is still applicable to the Linux 2.6 kernels.
cat > /etc/rc.d/rc.iptables << "EOF"
#!/bin/sh
# Begin rc.iptables
# Insert connection-tracking modules
# (not needed if built into the kernel)
modprobe nf_conntrack
modprobe xt_LOG
# Enable broadcast echo Protection
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
# Disable Source Routed Packets
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
echo 0 > /proc/sys/net/ipv4/conf/default/accept_source_route
# Enable TCP SYN Cookie Protection
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
# Disable ICMP Redirect Acceptance
echo 0 > /proc/sys/net/ipv4/conf/default/accept_redirects
# Do not send Redirect Messages
echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/default/send_redirects
# Drop Spoofed Packets coming in on an interface, where responses
# would result in the reply going out a different interface.
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
# Log packets with impossible addresses.
echo 1 > /proc/sys/net/ipv4/conf/all/log_martians
echo 1 > /proc/sys/net/ipv4/conf/default/log_martians
# be verbose on dynamic ip-addresses (not needed in case of static IP)
echo 2 > /proc/sys/net/ipv4/ip_dynaddr
# disable Explicit Congestion Notification
# too many routers are still ignorant
echo 0 > /proc/sys/net/ipv4/tcp_ecn
# Set a known state
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# These lines are here in case rules are already in place and the
# script is ever rerun on the fly. We want to remove all rules and
# pre-existing user defined chains before we implement new rules.
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
# 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
# (e.g. port mode ftp)
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
# Log everything else. What's Windows' latest exploitable vulnerability?
iptables -A INPUT -j LOG --log-prefix "FIREWALL:INPUT "
# End $rc_base/rc.iptables
EOF
chmod 700 /etc/rc.d/rc.iptables
This script is quite simple, it drops all traffic coming into your computer that wasn't initiated from your computer, 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, take a look at BusyBox example number 4.
Even if you have daemons or services running on your system, these will be inaccessible everywhere but from your computer itself. If you want to allow access to services on your machine, such as ssh or ping, take a look at BusyBox.
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 for the firewall itself, make sure that there are no unnecessary servers running on it such as X11 et al. As a general principle, the firewall itself should not access any untrusted service (think of a remote server giving answers that makes a daemon on your system crash, or even worse, that implements a worm via a buffer-overflow).
cat > /etc/rc.d/rc.iptables << "EOF"
#!/bin/sh
# Begin rc.iptables
echo
echo "You're using the example configuration for a setup of a firewall"
echo "from Beyond Linux From Scratch."
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 configuration rules below."
echo "You can find additional 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 nf_conntrack
modprobe nf_conntrack_ftp
modprobe xt_conntrack
modprobe xt_LOG
modprobe xt_state
# Enable broadcast echo Protection
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
# Disable Source Routed Packets
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
# Enable TCP SYN Cookie Protection
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
# Disable ICMP Redirect Acceptance
echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
# Don't send Redirect Messages
echo 0 > /proc/sys/net/ipv4/conf/default/send_redirects
# Drop Spoofed Packets coming in on an interface where responses
# would result in the reply going out a different interface.
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
# Log packets with impossible addresses.
echo 1 > /proc/sys/net/ipv4/conf/all/log_martians
# Be verbose on dynamic ip-addresses (not needed in case of static IP)
echo 2 > /proc/sys/net/ipv4/ip_dynaddr
# Disable Explicit Congestion Notification
# Too many routers are still ignorant
echo 0 > /proc/sys/net/ipv4/tcp_ecn
# Set a known state
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# These lines are here in case rules are already in place and the
# script is ever rerun on the fly. We want to remove all rules and
# pre-existing user defined chains before we implement new rules.
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
# Allow local connections
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow forwarding if the initiated on the intranet
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD ! -i ppp+ -m conntrack --ctstate NEW -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 policy rules)
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 "
# Enable IP Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
EOF
chmod 700 /etc/rc.d/rc.iptables
With this script your intranet should be reasonably secure against external attacks. No one should be able to setup a new connection to any internal service and, if it's masqueraded, makes your intranet invisible to the Internet. Furthermore, your firewall should be relatively safe because there are no services running that a cracker could attack.
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 (e.g., eth1) which you are
using.
This scenario isn't too different from the Masquerading Router, but additionally offers some services to your intranet. Examples of this can be when you want to administer your firewall from another host on your intranet or use it as a proxy or a name server.
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 the references at the end of this section for more information.
Be cautious. Every service you have enabled makes your setup more complex and your firewall less secure. You are exposed to the risks of misconfigured services or running a service with an exploitable bug. A firewall should generally not run any extra services. See the introduction to the Masquerading Router for some more details.
If you want to add services such as internal Samba or name servers that do not need to access the Internet themselves, the additional statements are quite simple and should still be acceptable from a security standpoint. Just add the following lines into the script before the logging rules.
iptables -A INPUT -i ! ppp+ -j ACCEPT
iptables -A OUTPUT -o ! ppp+ -j ACCEPT
If daemons, such as squid, have to access the Internet themselves, you could open OUTPUT generally and restrict INPUT.
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -j ACCEPT
However, it is generally not advisable to leave OUTPUT unrestricted. You lose any control over trojans who would like to "call home", and a bit of redundancy in case you've (mis-)configured a service so that it broadcasts its existence to the world.
To accomplish this, you should 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 conntrack --ctstate ESTABLISHED \
-j ACCEPT
Your caching name server (e.g., named) does its lookups via UDP:
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
You want to be able to ping your computer 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 system to obtain usernames. Although there's really little harm in this, having an identd running is not recommended because many security experts feel the service gives out too much additional information.
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
To log and drop invalid packets (packets that came in after netfilter's timeout or some types of network scans) insert these rules at the top of the chain:
iptables -I INPUT 0 -p tcp -m conntrack --ctstate INVALID \
-j LOG --log-prefix "FIREWALL:INVALID "
iptables -I INPUT 1 -p tcp -m conntrack --ctstate INVALID -j DROP
Anything coming from the outside should not have a private address, this is a common attack called IP-spoofing:
iptables -A INPUT -i ppp+ -s 10.0.0.0/8 -j DROP
iptables -A INPUT -i ppp+ -s 172.16.0.0/12 -j DROP
iptables -A INPUT -i ppp+ -s 192.168.0.0/16 -j DROP
There are other addresses that you may also want to drop: 0.0.0.0/8, 127.0.0.0/8, 224.0.0.0/3 (multicast and experimental), 169.254.0.0/16 (Link Local Networks), and 192.0.2.0/24 (IANA defined test network).
If your firewall is a DHCP client, you need to allow those packets:
iptables -A INPUT -i ppp0 -p udp -s 0.0.0.0 --sport 67 \
-d 255.255.255.255 --dport 68 -j ACCEPT
To simplify debugging and be fair to anyone who'd like to access a service you have disabled, purposely or by mistake, you could 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
These are only examples to show you some of the
capabilities of the firewall code in Linux. Have a look at
the man page of iptables. There you will find much more
information. The port numbers needed for this can be found
in /etc/services
, in case you
didn't find them by trial and error in your log file.
Finally, there is one fact you 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 valuable information, you need to spend the time to protect it properly.
www.netfilter.org - Homepage of the netfilter/iptables project
Netfilter related FAQ
Netfilter related HOWTO's
en.tldp.org/LDP/nag2/x-087-2-firewall.html
en.tldp.org/HOWTO/Security-HOWTO.html
en.tldp.org/HOWTO/Firewall-HOWTO.html
www.linuxsecurity.com/docs/
www.little-idiot.de/firewall (German & outdated, but very comprehensive)
linux.oreillynet.com/pub/a/linux/2000/03/10/netadmin/ddos.html
staff.washington.edu/dittrich/misc/ddos
www.e-infomax.com/ipmasq
www.circlemud.org/~jelson/writings/security/index.htm
www.securityfocus.com
www.cert.org - tech_tips
security.ittoolbox.com
www.insecure.org/reading.html
Last updated on 2016-06-04 22:57:10 -0700
The libcap package was installed in LFS, but if Linux-PAM support is desired, the PAM module must be built (after installation of Linux-PAM).
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.26.tar.xz
Download MD5 sum: 968ac4d42a1a71754313527be2ab5df3
Download size: 68 KB
Estimated disk space required: 616 KB
Estimated build time: less than 0.1 SBU
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/libcap
Install libcap by running the following commands:
make -C pam_cap
This package does not come with a test suite.
Now, as the root
user:
install -v -m755 pam_cap/pam_cap.so /lib/security && install -v -m644 pam_cap/capability.conf /etc/security
Last updated on 2019-02-15 13:01:29 -0800
The Linux PAM package contains Pluggable Authentication Modules used to enable the local system administrator to choose how applications authenticate users.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): http://linux-pam.org/library/Linux-PAM-1.3.0.tar.bz2
Download MD5 sum: da4b2289b7cfb19583d54e9eaaef1c3a
Download size: 1.3 MB
Estimated disk space required: 28 MB (with tests)
Estimated build time: 0.5 SBU (with tests)
Optional Documentation
Download (HTTP): http://linux-pam.org/documentation/Linux-PAM-1.2.0-docs.tar.bz2
Download MD5 sum: 558378b8be9b8b5c987326f4529f2130
Download size 480 KB
Berkeley DB-5.3.28, CrackLib-2.9.6, libtirpc-1.1.4 and Prelude
docbook-xml-4.5, docbook-xsl-1.79.2, fop-2.3, libxslt-1.1.33 and either w3m-0.5.3 or elinks (but with a link calling it 'links') and remove the documentation switch.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/linux-pam
If you downloaded the documentation, unpack the tarball by issuing the following command.
tar -xf ../Linux-PAM-1.2.0-docs.tar.bz2 --strip-components=1
Install Linux PAM by running the following commands:
./configure --prefix=/usr \ --sysconfdir=/etc \ --libdir=/usr/lib \ --disable-regenerate-docu \ --enable-securedir=/lib/security \ --docdir=/usr/share/doc/Linux-PAM-1.3.0 && make
To test the results, a suitable /etc/pam.d/other
configuration file must
exist.
If you have a system with Linux PAM installed and working,
be careful when modifying the files in /etc/pam.d
, since your system may become
totally unusable. If you want to run the tests, you do not
need to create another /etc/pam.d/other
file. The installed one
can be used for that purpose.
You should also be aware that make install overwrites
the configuration files in /etc/security
as well as /etc/environment
. In case you have
modified those files, be sure to back them up.
For a first installation, create the configuration file by
issuing the following commands as the root
user:
install -v -m755 -d /etc/pam.d && cat > /etc/pam.d/other << "EOF" auth required pam_deny.so account required pam_deny.so password required pam_deny.so session required pam_deny.so EOF
Now run the tests by issuing make check. Ensure there are no errors produced by the tests before continuing the installation. Note that the checks are quite long. It may be useful to redirect the output to a log file in order to inspect it thoroughly.
Only in case of a first installation, remove the
configuration file created earlier by issuing the following
command as the root
user:
rm -fv /etc/pam.d/*
Now, as the root
user:
make install && chmod -v 4755 /sbin/unix_chkpwd && for file in pam pam_misc pamc do mv -v /usr/lib/lib${file}.so.* /lib && ln -sfv ../../lib/$(readlink /usr/lib/lib${file}.so) /usr/lib/lib${file}.so done
--enable-securedir=/lib/security
:
This switch sets install location for the PAM modules.
--disable-regenerate-docu
:
This switch prevents this version of the package trying to
build its documentation, and failing, if the required
dependencies except
w3m-0.5.3
are present, but Links-2.18 is present. Remove this switch if
you have installed w3m (or elinks, with a link so it can be
invoked as 'links').
chmod -v 4755
/sbin/unix_chkpwd: The unix_chkpwd helper program
must be setuid so that non-root
processes can access the shadow
file.
Configuration information is placed in /etc/pam.d/
. Below is an example file:
# 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
Now set up some generic files. As root:
install -vdm755 /etc/pam.d && cat > /etc/pam.d/system-account << "EOF" &&# Begin /etc/pam.d/system-account account required pam_unix.so # End /etc/pam.d/system-account
EOF cat > /etc/pam.d/system-auth << "EOF" &&# Begin /etc/pam.d/system-auth auth required pam_unix.so # End /etc/pam.d/system-auth
EOF cat > /etc/pam.d/system-session << "EOF"# Begin /etc/pam.d/system-session session required pam_unix.so # End /etc/pam.d/system-session
EOF
The remaining generic file depends on whether CrackLib-2.9.6 is installed. If it is installed, use:
cat > /etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password
# check new passwords for strength (man pam_cracklib)
password required pam_cracklib.so authtok_type=UNIX retry=1 difok=5 \
minlen=9 dcredit=1 ucredit=1 \
lcredit=1 ocredit=1 minclass=0 \
maxrepeat=0 maxsequence=0 \
maxclassrepeat=0 \
dictpath=/lib/cracklib/pw_dict
# use sha512 hash for encryption, use shadow, and use the
# authentication token (chosen password) set by pam_cracklib
# above (or any previous modules)
password required pam_unix.so sha512 shadow use_authtok
# End /etc/pam.d/system-password
EOF
In its default configuration, pam_cracklib will allow
multiple case passwords as short as 6 characters, even
with the minlen
value set to 11. You should review the pam_cracklib(8)
man page and determine if these default values are
acceptable for the security of your system.
If CrackLib-2.9.6 is NOT installed, use:
cat > /etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password
# use sha512 hash for encryption, use shadow, and try to use any previously
# defined authentication token (chosen password) set by any prior module
password required pam_unix.so sha512 shadow try_first_pass
# End /etc/pam.d/system-password
EOF
Now add a restrictive /etc/pam.d/other
configuration file. With
this file, programs that are PAM aware will not run unless
a configuration file specifically for that application is
created.
cat > /etc/pam.d/other << "EOF"
# Begin /etc/pam.d/other
auth required pam_warn.so
auth required pam_deny.so
account required pam_warn.so
account required pam_deny.so
password required pam_warn.so
password required pam_deny.so
session required pam_warn.so
session required pam_deny.so
# End /etc/pam.d/other
EOF
The PAM man page (man pam) provides a good starting point for descriptions of fields and allowable entries. The Linux-PAM System Administrators' Guide is recommended for additional information.
Refer to http://debian.securedservers.com/kernel/pub/linux/libs/pam/modules.html for a list of various third-party modules available.
You should now reinstall the Shadow-4.6 package.
is a helper binary that creates home directories. |
|
is used to interrogate and manipulate the login counter file. |
|
is used to interrogate and manipulate the login counter file, but does not have some limitations that pam_tally does. |
|
is used to check if the default timestamp is valid |
|
is a helper binary that verifies the password of the current user. |
|
is a helper binary that updates the password of a given user. |
|
provides the interfaces between applications and the PAM modules. |
Last updated on 2019-02-15 13:01:29 -0800
liboauth is a collection of POSIX-C functions implementing the OAuth Core RFC 5849 standard. Liboauth provides functions to escape and encode parameters according to OAuth specification and offers high-level functionality to sign requests or verify OAuth signatures as well as perform HTTP requests.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://downloads.sourceforge.net/liboauth/liboauth-1.0.3.tar.gz
Download MD5 sum: 689b46c2b3ab1a39735ac33f714c4f7f
Download size: 496 KB
Estimated disk space required: 3.5 MB
Estimated build time: less than 0.1 SBU
Required patch for use with openssl: http://www.linuxfromscratch.org/patches/blfs/8.4/liboauth-1.0.3-openssl-1.1.0-3.patch
NSS-3.42.1 and Doxygen-1.8.15 (to build documentation)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/liboauth
Apply a patch for the current version of openssl:
patch -Np1 -i ../liboauth-1.0.3-openssl-1.1.0-3.patch
Install liboauth by running the following commands:
./configure --prefix=/usr --disable-static && make
If you have installed Doxygen-1.8.15, issue make dox to build the documentation.
To test the results, issue: make check.
Now, as the root
user:
make install
If you have previously built the documentation, install it by
running the following commands as the root
user:
install -v -dm755 /usr/share/doc/liboauth-1.0.3 && cp -rv doc/html/* /usr/share/doc/liboauth-1.0.3
--disable-static
:
This switch prevents installation of static versions of the
libraries.
--enable-nss
: Use this switch if
you want to use Mozilla NSS instead of OpenSSL.
Last updated on 2019-02-18 13:07:03 -0800
The libpwquality package provides common functions for password quality checking and also scoring them based on their apparent randomness. The library also provides a function for generating random passwords with good pronounceability.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://github.com/libpwquality/libpwquality/releases/download/libpwquality-1.4.0/libpwquality-1.4.0.tar.bz2
Download MD5 sum: b8defcc7280a90e9400d6689c93a279c
Download size: 440 KB
Estimated disk space required: 4.0 MB
Estimated build time: less than 0.1 SBU
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/libpwquality
Install libpwquality by running the following commands:
./configure --prefix=/usr --disable-static \ --with-securedir=/lib/security \ --with-python-binary=python3 && make
This package does not come with a test suite.
Now, as the root
user:
make install
--with-python-binary=python3
:
This parameter gives the location of the Python binary. The default is python
, and requires Python-2.7.15.
Libpwquality is intended to
be a functional replacement for the pam_cracklib.so
module with additional
options. To replace the pam_cracklib.so
module with the
pam_pwquality.so
module,
execute the following commands as the root
user:
mv /etc/pam.d/system-password{,.orig} &&
cat > /etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password
# check new passwords for strength (man pam_pwquality)
password required pam_pwquality.so authtok_type=UNIX retry=1 difok=1 \
minlen=8 dcredit=0 ucredit=0 \
lcredit=0 ocredit=0 minclass=1 \
maxrepeat=0 maxsequence=0 \
maxclassrepeat=0 geoscheck=0 \
dictcheck=1 usercheck=1 \
enforcing=1 badwords="" \
dictpath=/lib/cracklib/pw_dict
# use sha512 hash for encryption, use shadow, and use the
# authentication token (chosen password) set by pam_pwquality
# above (or any previous modules)
password required pam_unix.so sha512 shadow use_authtok
# End /etc/pam.d/system-password
EOF
Last updated on 2015-09-25 08:48:24 -0500
MIT Kerberos V5 is a free implementation of Kerberos 5. Kerberos is a network authentication protocol. It centralizes the authentication database and uses kerberized applications to work with servers or services that support Kerberos allowing single logins and encrypted communication over internal networks or the Internet.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://kerberos.org/dist/krb5/1.17/krb5-1.17.tar.gz
Download MD5 sum: 3b729d89eb441150e146780c4138481b
Download size: 8.4 MB
Estimated disk space required: 104 MB (add 26 MB for tests)
Estimated build time: 0.4 SBU (using parallelism=4; add 2.2 SBU for tests)
DejaGnu-1.6.2 (for full test coverage), GnuPG-2.2.13 (to authenticate the package), keyutils-1.6, OpenLDAP-2.4.47, Python-2.7.15 (used during the testsuite), rpcbind-1.2.5 (used during the testsuite), and Valgrind-3.14.0 (used during the test suite)
Some sort of time synchronization facility on your system (like ntp-4.2.8p12) is required since Kerberos won't authenticate if there is a time difference between a kerberized client and the KDC server.
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/mitkrb
Build MIT Kerberos V5 by running the following commands:
cd src && sed -i -e 's@\^u}@^u cols 300}@' tests/dejagnu/config/default.exp && sed -i -e '/eq 0/{N;s/12 //}' plugins/kdb/db2/libdb2/test/run.test && ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var/lib \ --with-system-et \ --with-system-ss \ --with-system-verto=no \ --enable-dns-for-realm && make
To test the build, issue as the root
user: make -k check. You need at
least Tcl-8.6.9, which is used to drive the
testsuite. Furthermore, DejaGnu-1.6.2 must be available for
some of the tests to run. If you have a former version of MIT
Kerberos V5 installed, it may happen that the test suite pick
up the installed versions of the libraries, rather than the
newly built ones. If so, it is better to run the tests after
the installation. The t_ccselect test is known to fail.
Now, as the root
user:
make install && for f in gssapi_krb5 gssrpc k5crypto kadm5clnt kadm5srv \ kdb5 kdb_ldap krad krb5 krb5support verto ; do find /usr/lib -type f -name "lib$f*.so*" -exec chmod -v 755 {} \; done && mv -v /usr/lib/libkrb5.so.3* /lib && mv -v /usr/lib/libk5crypto.so.3* /lib && mv -v /usr/lib/libkrb5support.so.0* /lib && ln -v -sf ../../lib/libkrb5.so.3.3 /usr/lib/libkrb5.so && ln -v -sf ../../lib/libk5crypto.so.3.1 /usr/lib/libk5crypto.so && ln -v -sf ../../lib/libkrb5support.so.0.1 /usr/lib/libkrb5support.so && mv -v /usr/bin/ksu /bin && chmod -v 755 /bin/ksu && install -v -dm755 /usr/share/doc/krb5-1.17 && cp -vfr ../doc/* /usr/share/doc/krb5-1.17
The first sed increases the width of the virtual terminal used for some tests to prevent some spurious text in the output which is taken as a failure. The second sed removes a test that is known to fail.
--localstatedir=/var/lib
: This
option is used so that the Kerberos variable run-time data is
located in /var/lib
instead of
/usr/var
.
--with-system-et
:
This switch causes the build to use the system-installed
versions of the error-table support software.
--with-system-ss
:
This switch causes the build to use the system-installed
versions of the subsystem command-line interface software.
--with-system-verto=no
: This
switch fixes a bug in the package: it does not recognize its
own verto library installed previously. This is not a
problem, if reinstalling the same version, but if you are
updating, the old library is used as system's one, instead of
installing the new version.
--enable-dns-for-realm
: This
switch allows realms to be resolved using the DNS server.
--with-ldap
: Use this switch if
you want to compile the OpenLDAP database backend module.
mv -v /usr/lib/libk...
/lib and ln -v
-sf ../../lib/libk... /usr/lib/libk...: Move
critical libraries to the /lib
directory so that they are available when the /usr
filesystem is not mounted.
find /usr/lib -type f -name "lib$f*.so*" -exec chmod -v 755 {} \;: This command changes the permisison of installed libraries.
mv -v /usr/bin/ksu
/bin: Moves the ksu program to the
/bin
directory so that it is
available when the /usr
filesystem is not mounted.
You should consider installing some sort of password
checking dictionary so that you can configure the
installation to only accept strong passwords. A
suitable dictionary to use is shown in the CrackLib-2.9.6 instructions. Note
that only one file can be used, but you can concatenate
many files into one. The configuration file shown below
assumes you have installed a dictionary to /usr/share/dict/words
.
Create the Kerberos configuration file with the following
commands issued by the root
user:
cat > /etc/krb5.conf << "EOF"
# Begin /etc/krb5.conf
[libdefaults]
default_realm = <EXAMPLE.ORG>
encrypt = true
[realms]
<EXAMPLE.ORG>
= {
kdc = <belgarath.example.org>
admin_server = <belgarath.example.org>
dict_file = /usr/share/dict/words
}
[domain_realm]
.<example.org>
= <EXAMPLE.ORG>
[logging]
kdc = SYSLOG:INFO:AUTH
admin_server = SYSLOG:INFO:AUTH
default = SYSLOG:DEBUG:DAEMON
# End /etc/krb5.conf
EOF
You will need to substitute your domain and proper
hostname for the occurrences of the <belgarath>
and
<example.org>
names.
default_realm
should be the
name of your domain changed to ALL CAPS. This isn't
required, but both Heimdal and MIT recommend it.
encrypt = true
provides
encryption of all traffic between kerberized clients and
servers. It's not necessary and can be left off. If you
leave it off, you can encrypt all traffic from the client
to the server using a switch on the client program
instead.
The [realms]
parameters tell
the client programs where to look for the KDC
authentication services.
The [domain_realm]
section
maps a domain to a realm.
Create the KDC database:
kdb5_util create -r <EXAMPLE.ORG>
-s
Now you should populate the database with principals
(users). For now, just use your regular login name or
root
.
kadmin.localkadmin.local:
add_policy dict-onlykadmin.local:
addprinc -policy dict-only<loginname>
The KDC server and any machine running kerberized server daemons must have a host key installed:
kadmin.local:
addprinc -randkey host/<belgarath.example.org>
After choosing the defaults when prompted, you will have to export the data to a keytab file:
kadmin.local:
ktadd host/<belgarath.example.org>
This should have created a file in /etc
named krb5.keytab
(Kerberos 5). This file
should have 600 (root
rw
only) permissions. Keeping the keytab files from public
access is crucial to the overall security of the Kerberos
installation.
Exit the kadmin program (use quit or exit) and return back to the shell prompt. Start the KDC daemon manually, just to test out the installation:
/usr/sbin/krb5kdc
Attempt to get a ticket with the following command:
kinit <loginname>
You will be prompted for the password you created. After you get your ticket, you can list it with the following command:
klist
Information about the ticket should be displayed on the screen.
To test the functionality of the keytab file, issue the following command:
ktutilktutil:
rkt /etc/krb5.keytabktutil:
l
This should dump a list of the host principal, along with the encryption methods used to access the principal.
At this point, if everything has been successful so far, you can feel fairly confident in the installation and configuration of the package.
For additional information consult the documentation for krb5-1.17 on which the above instructions are based.
If you want to start Kerberos services at boot, install the
/etc/rc.d/init.d/krb5
init
script included in the blfs-bootscripts-20180105
package using the following command:
make install-krb5
is a GSSAPI test client. |
|
is a GSSAPI test server. |
|
is a host keytable manipulation utility. |
|
is an utility used to make modifications to the Kerberos database. |
|
is an utility similar to kadmin, but if the database is db2, the local client kadmin.local, is intended to run directly on the master KDC without Kerberos authentication. |
|
is a server for administrative access to a Kerberos database. |
|
allows an administrator to manage realms, Kerberos services and ticket policies. |
|
is the KDC database utility. |
|
removes the current set of tickets. |
|
is used to authenticate to the Kerberos server as a principal and acquire a ticket granting ticket that can later be used to obtain tickets for other services. |
|
reads and displays the current tickets in the credential cache. |
|
is a program for changing Kerberos 5 passwords. |
|
takes a principal database in a specified format and converts it into a stream of database records. |
|
receives a database sent by kprop and writes it as a local database. |
|
displays the contents of the KDC database update log to standard output. |
|
gives information on how to link programs against libraries. |
|
is the Kerberos 5 server. |
|
sends a problem report (PR) to a central support site. |
|
is the super user program using Kerberos protocol.
Requires a properly configured |
|
makes the specified credential cache the primary cache for the collection, if a cache collection is available. |
|
is a program for managing Kerberos keytabs. |
|
prints keyversion numbers of Kerberos principals. |
|
is used to contact a sample server and authenticate to it using Kerberos 5 tickets, then display the server's response. |
|
is a simple UDP-based sample client program, for demonstration. |
|
is a simple UDP-based server application, for demonstration. |
|
is the sample Kerberos 5 server. |
|
is another sample client. |
|
is another sample server. |
|
contains the Generic Security Service Application Programming Interface (GSSAPI) functions which provides security services to callers in a generic fashion, supportable with a range of underlying mechanisms and technologies and hence allowing source-level portability of applications to different environments. |
|
contains the administrative authentication and password checking functions required by Kerberos 5 client-side programs. |
|
contains the administrative authentication and password checking functions required by Kerberos 5 servers. |
|
is a Kerberos 5 authentication/authorization database access library. |
|
contains the internal support library for RADIUS functionality. |
|
is an all-purpose Kerberos 5 library. |
Last updated on 2019-02-16 01:24:48 -0800
The Nettle package contains a low-level cryptographic library that is designed to fit easily in many contexts.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://ftp.gnu.org/gnu/nettle/nettle-3.4.1.tar.gz
Download (FTP): ftp://ftp.gnu.org/gnu/nettle/nettle-3.4.1.tar.gz
Download MD5 sum: 9bdebb0e2f638d3b9d91f7fc264b70c1
Download size: 1.9 MB
Estimated disk space required: 71 MB (with tests)
Estimated build time: 0.4 SBU (with tests)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/nettle
Install Nettle by running the following commands:
./configure --prefix=/usr --disable-static && make
To test the results, issue: make check.
Now, as the root
user:
make install && chmod -v 755 /usr/lib/lib{hogweed,nettle}.so && install -v -m755 -d /usr/share/doc/nettle-3.4.1 && install -v -m644 nettle.html /usr/share/doc/nettle-3.4.1
--disable-static
:
This switch prevents installation of static versions of the
libraries.
calculates a hash value using a specified algorithm. |
|
outputs a sequence of pseudorandom (non-cryptographic) bytes, using Knuth's lagged fibonacci generator. The stream is useful for testing, but should not be used to generate cryptographic keys or anything else that needs real randomness. |
|
password-based key derivation function that take as input a password or passphrase and typically strengthen it and protect against certain pre-computation attacks by using salting and expensive computation. |
|
converts private and public RSA keys from PKCS #1 format to sexp format. |
|
converts an s-expression to a different encoding. |
Last updated on 2019-02-15 13:01:29 -0800
The Network Security Services (NSS) package is a set of libraries designed to support cross-platform development of security-enabled client and server applications. Applications built with NSS can support SSL v2 and v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates, and other security standards. This is useful for implementing SSL and S/MIME or other Internet security standards into an application.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://archive.mozilla.org/pub/security/nss/releases/NSS_3_42_1_RTM/src/nss-3.42.1.tar.gz
Download MD5 sum: 1f6cc6c702379478a3a72298caaef0a7
Download size: 22 MB
Estimated disk space required: 143 MB
Estimated build time: 2.2 SBU
SQLite-3.27.1 and p11-kit-0.23.15 (runtime)
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/nss
This package does not support parallel build.
Install NSS by running the following commands:
patch -Np1 -i ../nss-3.42.1-standalone-1.patch && cd nss && make -j1 BUILD_OPT=1 \ NSPR_INCLUDE_DIR=/usr/include/nspr \ USE_SYSTEM_ZLIB=1 \ ZLIB_LIBS=-lz \ NSS_ENABLE_WERROR=0 \ $([ $(uname -m) = x86_64 ] && echo USE_64=1) \ $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1)
The testsuite is designed for testing changes to nss or nspr and is not particularly useful for checking a released version (e.g. it needs to be run on a non-optimized build with both nss and nspr directories existing alongside each other). For further details, see the User Notes.
Now, as the root
user:
cd ../dist && install -v -m755 Linux*/lib/*.so /usr/lib && install -v -m644 Linux*/lib/{*.chk,libcrmf.a} /usr/lib && install -v -m755 -d /usr/include/nss && cp -v -RL {public,private}/nss/* /usr/include/nss && chmod -v 644 /usr/include/nss/* && install -v -m755 Linux*/bin/{certutil,nss-config,pk12util} /usr/bin && install -v -m644 Linux*/lib/pkgconfig/nss.pc /usr/lib/pkgconfig
BUILD_OPT=1
: This
option is passed to make so that the build is
performed with no debugging symbols built into the binaries
and the default compiler optimizations are used.
NSPR_INCLUDE_DIR=/usr/include/nspr
:
This option sets the location of the nspr headers.
USE_SYSTEM_ZLIB=1
:
This option is passed to make to ensure that the
libssl3.so
library is linked to
the system installed zlib
instead of the in-tree version.
ZLIB_LIBS=-lz
: This
option provides the linker flags needed to link to the system
zlib.
$([ $(uname -m) = x86_64 ]
&& echo USE_64=1): The USE_64=1
option is required on x86_64, otherwise
make will try
(and fail) to create 32-bit objects. The [ $(uname -m) =
x86_64 ] test ensures it has no effect on a 32 bit system.
([ -f /usr/include/sqlite3.h ]
&& echo NSS_USE_SYSTEM_SQLITE=1):
This tests if sqlite is
installed and if so it echos the option
NSS_USE_SYSTEM_SQLITE=1 to make so that libsoftokn3.so
will link against the system
version of sqlite.
If p11-kit-0.23.15 is installed, the
p11-kit trust module
(/usr/lib/pkcs11/p11-kit-trust.so
) can be
used as a drop-in replacement for /usr/lib/libnssckbi.so
to transparently
make the system CAs available to NSS aware applications, rather than the
static list provided by /usr/lib/libnssckbi.so
. As the root
user, execute the following
commands:
ln -sfv ./pkcs11/p11-kit-trust.so /usr/lib/libnssckbi.so
Additionally, for dependent applications that do not use the
internal database (/usr/lib/libnssckbi.so
), the /usr/sbin/make-ca
script, included on the
make-ca-1.2 page can generate a system wide
NSS DB with the -n
switch, or by modifying the /etc/make-ca.conf
file.
is the Mozilla Certificate Database Tool. It is a command-line utility that can create and modify the Netscape Communicator cert8.db and key3.db database files. It can also list, generate, modify, or delete certificates within the cert8.db file and create or change the password, generate new public and private key pairs, display the contents of the key database, or delete key pairs within the key3.db file. |
|
is used to determine the NSS library settings of the installed NSS libraries. |
|
is a tool for importing certificates and keys from pkcs #12 files into NSS or exporting them. It can also list certificates and keys in such files. |
Last updated on 2019-02-24 13:00:49 -0800
The OpenSSH package contains ssh clients and the sshd daemon. This is useful for encrypting authentication and subsequent traffic over a network. The ssh and scp commands are secure implementations of telnet and rcp respectively.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.9p1.tar.gz
Download MD5 sum: c6af50b7a474d04726a5aa747a5dce8f
Download size: 1.5 MB
Estimated disk space required: 39 MB (add 12 MB for tests)
Estimated build time: 0.4 SBU (running the tests takes 17+ minutes, irrespective of processor speed)
GDB-8.2.1 (for tests), Linux-PAM-1.3.0, X Window System, MIT Kerberos V5-1.17, libedit, LibreSSL Portable, OpenSC, and libsectok
OpenJDK-11.0.2, Net-tools-CVS_20101030, and Sysstat-12.1.2
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/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 issuing
the following commands as the root
user:
install -v -m700 -d /var/lib/sshd && chown -v root:sys /var/lib/sshd && groupadd -g 50 sshd && useradd -c 'sshd PrivSep' \ -d /var/lib/sshd \ -g sshd \ -s /bin/false \ -u 50 sshd
Install OpenSSH by running the following commands:
patch -Np1 -i ../openssh-7.9p1-security_fix-1.patch && ./configure --prefix=/usr \ --sysconfdir=/etc/ssh \ --with-md5-passwords \ --with-privsep-path=/var/lib/sshd && make
The testsuite requires an installed copy of scp to complete the
multiplexing tests. To run the test suite, first copy the
scp program to
/usr/bin
, making sure that you
backup any existing copy first.
To test the results, issue: make tests.
Now, as the root
user:
make install && install -v -m755 contrib/ssh-copy-id /usr/bin && install -v -m644 contrib/ssh-copy-id.1 \ /usr/share/man/man1 && install -v -m755 -d /usr/share/doc/openssh-7.9p1 && install -v -m644 INSTALL LICENCE OVERVIEW README* \ /usr/share/doc/openssh-7.9p1
--sysconfdir=/etc/ssh
: This
prevents the configuration files from being installed in
/usr/etc
.
--with-md5-passwords
:
This enables the use of MD5 passwords.
--with-pam
: This parameter
enables Linux-PAM support in
the build.
--with-xauth=/usr/bin/xauth
: Set
the default location for the xauth binary for X
authentication. Change the location if xauth will be installed to
a different path. This can also be controlled from
sshd_config
with the
XAuthLocation keyword. You can omit this switch if
Xorg is already installed.
--with-kerberos5=/usr
: This
option is used to include Kerberos 5 support in the build.
--with-libedit
: This option
enables line editing and history features for sftp.
~/.ssh/*
, /etc/ssh/ssh_config
, and /etc/ssh/sshd_config
There are no required changes to any of these files.
However, you may wish to view the /etc/ssh/
files and make any changes
appropriate for the security of your system. One
recommended change is that you disable root
login via ssh. Execute the
following command as the root
user to disable root
login via ssh:
echo "PermitRootLogin no" >> /etc/ssh/sshd_config
If you want to be able to log in without typing in your password, first create ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub with ssh-keygen and then copy ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys on the remote computer that you want to log into. You'll need to change REMOTE_USERNAME and REMOTE_HOSTNAME for the username and hostname of the remote computer and you'll also need to enter your password for the ssh-copy-id command to succeed:
ssh-keygen && ssh-copy-id -i ~/.ssh/id_rsa.pubREMOTE_USERNAME
@REMOTE_HOSTNAME
Once you've got passwordless logins working it's actually
more secure than logging in with a password (as the private
key is much longer than most people's passwords). If you
would like to now disable password logins, as the
root
user:
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
If you added Linux-PAM
support and you want ssh to use it then you will need to
add a configuration file for sshd and enable use of LinuxPAM. Note, ssh only uses PAM to
check passwords, if you've disabled password logins these
commands are not needed. If you want to use PAM, issue the
following commands as the root
user:
sed 's@d/login@d/sshd@g' /etc/pam.d/login > /etc/pam.d/sshd && chmod 644 /etc/pam.d/sshd && echo "UsePAM yes" >> /etc/ssh/sshd_config
Additional configuration information can be found in the man pages for sshd, ssh and ssh-agent.
To start the SSH server at system boot, install the
/etc/rc.d/init.d/sshd
init
script included in the blfs-bootscripts-20180105
package.
make install-sshd
is a file copy program that acts like rcp except it uses an encrypted protocol. |
|
is an FTP-like program that works over the SSH1 and SSH2 protocols. |
|
is a symlink to ssh. |
|
is an rlogin/rsh-like client program except it uses an encrypted protocol. |
|
is a daemon that listens for ssh login requests. |
|
is a tool which adds keys to the ssh-agent. |
|
is an authentication agent that can store private keys. |
|
is a script that enables logins on remote machine using local keys. |
|
is a key generation tool. |
|
is a utility for gathering public host keys from a number of hosts. |
Last updated on 2019-02-22 06:15:58 -0800
The p11-kit package provides a way to load and enumerate PKCS #11 (a Cryptographic Token Interface Standard) modules.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://github.com/p11-glue/p11-kit/releases/download/0.23.15/p11-kit-0.23.15.tar.gz
Download MD5 sum: c4c3eecfe6bd6e62e436f62b51980749
Download size: 1.2 MB
Estimated disk space required: 46 MB (add 166 MB for tests)
Estimated build time: 0.4 SBU (add 0.6 SBU for tests)
make-ca-1.2 (runtime), NSS-3.42.1 (runtime), GTK-Doc-1.29 and libxslt-1.1.33
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/p11-kit
Prepare the distribution specific anchor hook:
sed '20,$ d' -i trust/trust-extract-compat.in &&
cat >> trust/trust-extract-compat.in << "EOF"
# Copy existing anchor modifications to /etc/ssl/local
/usr/libexec/make-ca/copy-trust-modifications
# Generate a new trust store
/usr/sbin/make-ca -f -g
EOF
Install p11-kit by running the following commands:
./configure --prefix=/usr \ --sysconfdir=/etc \ --with-trust-paths=/etc/pki/anchors && make
To test the results, issue: make check.
Now, as the root
user:
make install && ln -s /usr/libexec/p11-kit/trust-extract-compat \ /usr/bin/update-ca-certificates
--with-trust-paths=/etc/pki/anchors
:
this switch sets the location of trusted certificates used by
libp11-kit.so.
--with-hash-impl=freebl
: Use this
switch if you want to use the Freebl library from
NSS for SHA1 and MD5
hashing.
--enable-doc
: Use this switch if
you have installed GTK-Doc-1.29 and libxslt-1.1.33 and wish
to rebuild the documentation and generate manual pages.
The p11-kit trust module
(/usr/lib/pkcs11/p11-kit-trust.so
) can be
used as a drop-in replacement for /usr/lib/libnssckbi.so
to transparently
make the system CAs available to NSS aware applications, rather than the
static list provided by /usr/lib/libnssckbi.so
. As the root
user, execute the following
commands:
ln -sfv ./pkcs11/p11-kit-trust.so /usr/lib/libnssckbi.so
is a command line tool that can be used to perform operations on PKCS#11 modules configured on the system. |
|
is a command line tool to examine and modify the shared trust policy store. |
|
is a command line tool to both extract local certificates from an upadated anchor store, and regenerate all anchors and certificate stores on the system. |
|
contains functions used to coordinate initialization and finalization of any PKCS#11 module. |
|
is the PKCS#11 proxy module. |
Last updated on 2019-02-24 13:00:49 -0800
Polkit is a toolkit for defining and handling authorizations. It is used for allowing unprivileged processes to communicate with privileged processes.
This package is known to build and work properly using an LFS-8.4 platform.
Download (HTTP): https://www.freedesktop.org/software/polkit/releases/polkit-0.115.tar.gz
Download MD5 sum: f03b055d6ae5fc8eac76838c7d83d082
Download size: 1.5 MB
Estimated disk space required: 148 MB (with tests)
Estimated build time: 0.4 SBU (with tests)