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

Prerequisites [June 15, 2012, 3:16 a.m.]





Skills


First and foremost, building Linux is going to take you being familiar with all of these:

  • Using the bash shell
  • Text editing plain text files
  • Building programs from source with the configure, make, make install build tools

If you need to brush up on any of those, check out these links:

http://www.tldp.org/HOWTO/Software-Building-HOWTO.html

http://www.linuxhq.com/guides/LUG/guide.html

http://hints.cross-lfs.org/index.php/Essential_Prereading


Safety


Most of the things we'll do are completely safe. Any time there is a risk to the host operating system, you'll see this icon:

Careful!

When you see that, it means you're about to do something that might harm your host OS. You'll probably be ok, but just in case, I'd recommend backing up important files and having a recovery disk ready.

These will be rare, and I'll give you instructions to avoid problems. But whenever you see that icon, don't proceed until you're sure you understand the instructions.


Environment


Here's a script called version-check.sh that will let you know if you are ready to build CLFS. If there are any problems, you will get output that looks like this:

version-check.sh: line 5: bison: command not found.

If the only output is a bunch of command names and version numbers, like this:

gcc.exe (GCC) 4.6.2

(the bzip2 line will lead off with some unprintble characters, that's okay), then the test was successful and you can build CLFS. I have some sample output at the end of the third video in the "Windows Environment Set-Up" task if you aren't sure.


Installing


Whatever you're installing LFS to, it would help a lot if it were bootable. I picked an 8 GB USB stick. It doesn't have to be formatted, and in fact it would help a lot if you didn't care what was on it.

I will not be teaching you how to create LiveCDs, although there are tutorials that exist online, including here:

http://www.linux-live.org/

You can of course ignore all tasks past program installation. This will give you a "chroot" distribution, or a distribution you can use as an embedded distro from another linux distro with a compatible kernel via the "chroot" command. It's up to you if you want a bootable OS.


Unzip and 7-zip


If you don't have the unzip utility, you can install 7-zip, and then download and use a shell script I wrote which you can grab from here:

http://greenback.gremlin.net/unzip

Just copy that right into your /bin directory. Change the command at the top if you're not using MinGW to point at your 7-zip executable.

Windows:

You can grab 7-zip from here:

http://www.7-zip.org/

Unix-like:

The package is called p7-zip. I couldn't find a C(ommunity) B(ased) L(inux) F(rom) S(cratch) page for 7-zip. However, there is a slackbuild script which can be easily modified for any build environment, which you can find here:

http://slackbuilds.org/slackbuilds/13.1/system/p7zip/p7zip.SlackBuild

The only thing you'll probably have to change in the slackbuild is the install portion, since you probably won't have the installpkg tool. You can find out more about slackbuilds and slackware here (they have their own book),

http://slackbuilds.org

http://www.slackware.com/book/