This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Community Based Linux From Scratch


Going above and beyond

So over the last few chapters I've been promising you a lot that I'd talk about Community Based Linux From Scratch, not to be confused with another project called Beyond Linux From Scratch, another project which was fodder for a terrible Dr Who joke earlier in the git section.

Originally, back when the Linux from Scratch project was new, the bare bones system that was produced wasn't very useful to most people. An effort to provide instructions for commonly used open source software for Linux was made, and the Beyond Linux from Scratch project was born. CBLFS aims to be to CLFS what BLFS is to LFS. However, CBLFS accomplishes this task with a wiki that is open to the general public. I've made some edits myself; a fun easter egg might be to find them some time. Thanks to the wiki interface, CBLFS provides even faster the resource that LFS and BLFS provided to the open source community in general: a quick and easy way to look up information that "just works" for almost any open source software package out there, no matter what OS you use.

Beyond that, they can explain who they are much better in their own words,

http://cblfs.cross-lfs.org/index.php/Main_Page#What_is_Community_Driven_BLFS

And for this task, you'll want to go to that page anyway. A little below the section I linked to, there are post installation configuration instructions, much like those in the beginning of the BLFS book. At a minimum, you'll want to read through the "Bash Startup Files" and "System Users and Groups" pages.

Sections

A typical CBLFS page will have the following sections:

  • Download Source: A direct link to the source tarball, along with any manpages and patches that are required
  • Table of Contents
  • Introduction: Flavor text (I like copying and pasting this directly into the descriptions in my spec files, if you hadn't noticed), usually with a link to the developer's website
  • Dependencies: Separated into optional and required dependencies. If an optional dependency would create a circular chain, the best way to break it (called "bootstrapping") is to install the options-free version once, then reinstall it when the supporting packages are in place.
  • Build instructions: These usually come in non-multilib and multilib sections. If you're like me, you'll only need the non-multilib instructions.
  • Contents: Something else I'm fond of copying and pasting into my spec files

When CBLFS Is Not Enough

Sometimes, you'll come across a package you'd like to build, there are no CBLFS instructions available, and you simply don't have the time or drive to roll your own.

When you are in this situation, one option is to take a peek at packages written for a source-based distribution. Two excellent ones are Gentoo and SourceMage. The SourceMage wiki is located here:

http://wiki.sourcemage.org/

And the Gentoo wiki here,

http://wiki.gentoo.org/wiki/Main_Page

Both those wikis have a lot of excellent information regarding linux in general, by the way. I was once able to buy a new laptop and find a page full of kernel configurations just for my hardware on the Gentoo wiki.

But probably most immediately useful to you is a repository of build scripts. While you can find these in spec form like what we've been using by searching for srpms online, it's usually better to see how a shell script would accomplish what you're trying to accomplish, and then use it. So with that in mind, I highly recommend:

http://slackbuilds.org

The reason why I say so, is because slackbuilds makes very few assumptions about your system. You can sometimes remove the installpkg command (and several document packaging commands) from the end of a SlackBuild script and run it to install a package on a non-SlackWare system.

There's nothing stopping you from installing Slackware's package management tools and running the build script out of the box. If you do that, my preferred method is:

~ cd ~/clfs/build
~ tar zxvf ~/Downloads/package.tar.gz
~ cd package
~ . package.info
~ wget $DOWNLOAD
# cd /home/you/clfs/build/package
# ./package.SlackBuild

 

You could even install a binary package management solution from another distribution. There's nothing stopping you from installing apt-get, installing some core packages, and suddenly being able to use debian packages. You're limited only by your imagination and willingness to research.

Lastly, the tried-and-true (autoreconf -i if necessary, ) ./configure, make, and make-install method works on many packages, and most people writing configure scripts are good at telling you if you don't have the right software to build a package nowadays. Trial and error may sound tedious, but sometimes it's faster.

Anyhow, that's it for this challenge. Congratulations, and thanks for reading this. Please leave me any feedback in the comments section below. Good luck and enjoy your OS!

Task Discussion