LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-11-2010, 03:20 PM   #1
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Rep: Reputation: 119Reputation: 119
What a slacker learned from building Linux from Scratch...


Once again I'm writing about another "distribution" purely from a Slackware user's perspective. But this is a little different. I put distribution in quotes because Linux from Scratch (LFS) is a distribution in the same way that corn meal, flour, sugar, baking powder, salt, and an egg is corn bread -- you have to make it yourself following a recipe. Everything is built from source.

I successfully built an LFS system, and surprisingly learned a lot about Slackware at the same time.

The LFS web site provides the recipe and the ingredients (the maintainers make available both links to the software sources and a nice tarball with all of the sources and patches in one place). But more than that, it provides a lot of explanatory material to go with the build instructions. If one pays attention, one can learn a lot about how GNU/Linux works.

That last should sound familiar to slackers. The oft-repeated mantra, “If you learn Redhat (or Ubuntu or Debian), you learn Redhat, but if you learn Slackware, you learn Linux,” is a rallying cry for Slackware users. I’m not sure it’s precisely true -- not a lot of Linux distributions use the BSD-style initiation/boot scripts -- but it is pretty close to the truth. There aren’t a lot of patches to upstream sources and slackers have to do a bunch of configuration by editing text files. LFS is like Slackware in that regard, just more so.

Quick and Dirty Take Home Message

1) Is LFS worth the time and effort to build?

Absolutely!

2) Will I learn a lot about Slackware by building LFS?

Yes.

3) Is it hard to build?

No; especially not for Slackware users, many of whom are used to compiling software and configuring things by hand.

4) Does it take a long time?

How much time do you have? It took me two months worth of evenings and some time on weekends. I’d spend an hour or two on it after my kids went to bed on most evenings. I hit a few snags and had to backtrack a couple of times. I estimate 80 hours or so worth of work, but that includes the time to compile all of the packages, during which I could do other work. I’ve got a pretty fast computer, but not the fasted available. Your compile time could be much shorter or longer than mine. I also did more than strictly follow the LFS book; I used a package management scheme where I built and installed each package as a non-privileged user. That took more time, but not having package management, which is the default for LFS, was anathema to me. Finally, I added time to the build by documenting it as I went. One could probably build the whole thing in a weekend if one is simply following the book, running a pretty fast computer, and not doing much else.

5) Okay, but is the finished LFS system useful?

No, or yes, depending on what you do. The resulting system is really fast, tight, optimized for one’s own hardware, and really, really basic. If you want to actually do any work, you’ve got to build and install a lot more software, which is detailed in the “Beyond Linux from Scratch” (BLFS) project.

The Details

I built LFS version 6.6 (version 6.7 was release when I was halfway through my build) using 32-bit Slackware 13.1 running in a QEMU-KVM virtual machine. Slackware64_13.1 was the virtual machine’s host, and my regular computer, but that’s not relevant to the LFS build. Slackware 13.1 was the perfect host for LFS. Nothing needed to be added to it or recompiled to properly build the temporary LFS toolchain, which one then uses to build the LFS system. In other words, Slackware’s native development environment is fantastic for projects like this.

I did a few things differently than the instructions. As mentioned above, I used a package users scheme for package management. Additionally, the LFS book has one installing Vim, but I installed Emacs and Nano instead. Frankly, the joke about Emacs being a very good operating system with a mediocre text editor is uncomfortably close to the truth. With Emacs installed, the final LFS system is actually very useful for a lot of what I do with a computer. Finally, the LFS book calls for building and installing Grub2 and then overwriting one’s boot sector after configuring it to boot the new LFS and existing OSs on the system. I skipped that step and simply added LFS to LILO after I was done. I didn’t feel like learning all about a new boot loader at this point.

Why is LFS valuable to Slackware Users?

The bottom line, if you are like me, is that you can read about something and research it, but until you do it, you won’t really understand it. The key is understanding not just what goes into a Linux system, but how everything interacts.

After 80 hours of admittedly fun work (I’m a geek), I’ve got an extremely basic GNU/Linux system that runs Emacs as its flagship application. In contrast, I could spend about an hour installing and an hour configuring Slackware and have pretty much everything I need. But what I don’t get from simply installing slackware is a systems-level understanding of where each package came from. I now know where each basic program and utility comes from, how it is built, and to a certain extent, how the programs depend on one another.

For example, ‘less’ is probably in my top 10 command list, but it’s not installed until late in the process. Similarly, I installed the man pages very early in the process, but couldn’t actually read them until Man-DB rather late in the process. Now that I know how the basic Linux utilities interact, I’m more comfortable troubleshooting problems with Slackware. For ,while Slackware does not have dependency tracking, it most certainly has dependencies. Building a system teaches me about those a lot better than simply installing pre-compiled binary packages from the Slackware DVD.

More to the point, I gained a real appreciation for what it takes to actually build and maintain a GNU/Linux distribution. Gals and guys, we have it really easy when we use Slackware. Not only do Pat and his small team manage to build a complete distribution (with X and everything!), they also manage to incorporate bug-fixes, security updates, and new features and do it in such a way that it works on an exceptionally large variety of hardware and has great performance.

Frankly, looking ahead to BLFS and thinking about building X, much less KDE, Thunderbird, Firefox, and Open Office, I’m a little wary of the effort it is going to take -- especially when compared to simply installing Slackware. It is possible to build and maintain a full-featured LFS system, but it takes a ton of work.

So my recommendation is to build LFS, tinker with it, and learn from it. The LFS developers put a lot of effort into the project and it shows. There is, probably, no better way to learn about GNU/Linux. In the process, you’ll gain a real appreciation for what it takes to build and maintain Slackware.

Last edited by Lufbery; 10-12-2010 at 08:59 AM.
 
Old 10-11-2010, 04:15 PM   #2
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 389

Rep: Reputation: 60
Your experience is pretty similar to mine and i'd give the answers you gave to your questions.

Rather than go on to blfs, I thought I might try variations on lfs as it is a pretty tightly defined path and a little bit of me was disappointed that I didn't run in to any tough problems to solve, or in fact any unexpected issues. Going off piste isn't recommended by lfs, but I need to get lost a bit and then find my own way to really learn.

Thanks for another great write-up lufbery!

Last edited by mcnalu; 10-12-2010 at 02:10 AM.
 
Old 10-11-2010, 04:21 PM   #3
hitest
Senior Member
 
Registered: Mar 2004
Location: Prince Rupert, B.C., Canada
Distribution: Slackware, OpenBSD
Posts: 4,140

Rep: Reputation: 523Reputation: 523Reputation: 523Reputation: 523Reputation: 523Reputation: 523
Cool

Quote:
Originally Posted by Lufbery View Post
More to the point, I gained a real appreciation for what it takes to actually build and maintain a GNU/Linux distribution. Gals and guys, we have it really easy when we use Slackware. Not only do Pat and his small team manage to build a complete distribution (with X and everything!), they also manage to incorporate bug-fixes, security updates, and new features and do it in such a way that it works on an exceptionally large variety of hardware and has great performance.
Thanks for the review, Lufbery. LFS is a distribution I have not attempted.
On the topic of other distros, over the weekend I finished setting-up one Arch box. I have four Slackware boxes. I've been running Slackware for a bit; I think Arch is another good distribution for Slackers to try out. My Slackware and FreeBSD skills enabled me to get Arch up and running with some effort. The Arch documentation is excellent. Most of Arch configuration is done by editing /etc/rc.conf.
Arch is worth trying in my opinion.
 
Old 10-11-2010, 06:02 PM   #4
55020
Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 314
Blog Entries: 4

Rep: Reputation: 299Reputation: 299Reputation: 299
One interesting off-piste LFS adventure is to use LFS as a recipe for bootstrapping Slackware.

To do that, you can work through LFS Chapter 5, substituting the Slackware 13.1 version of each package for the LFS version. There are a couple of small tweaks needed

At the beginning of Chapter 6 you can install pkgtools into the chrooted environment, and then work through the rest of Chapter 6, building each package using the official SlackBuild instead of the LFS commands, and installing it with installpkg. Again there are a few adjustments required, but the methodology works very well.

I started doing this last week (it's relevant to a number of recent threads here at LQ) and I'll write it up properly as a blog post when I've got the last few problems ironed out. Yes, sysvinit, I'm looking at you
 
1 members found this post helpful.
Old 10-12-2010, 02:17 AM   #5
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware 13.37 and 13.1
Posts: 389

Rep: Reputation: 60
Quote:
Originally Posted by 55020 View Post
One interesting off-piste LFS adventure is to use LFS as a recipe for bootstrapping Slackware.
Good idea. I might give that a go if I can find the time. That'd give a great insight to the foundations of slackware. I imagine that you need to listen to the Grateful Dead to really get in the mood

The other idea I was toying with is going with busybox rather the usual gnu tools.
 
Old 10-12-2010, 04:02 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 6,897
Blog Entries: 51

Rep: Reputation: Disabled
Interesting post, Lufbery. LFS is on my to-do list.
 
Old 10-12-2010, 08:37 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,189

Rep: Reputation: Disabled
Quote:
Originally Posted by mcnalu View Post
Good idea. I might give that a go if I can find the time. That'd give a great insight to the foundations of slackware. I imagine that you need to listen to the Grateful Dead to really get in the mood

The other idea I was toying with is going with busybox rather the usual gnu tools.
I used information from the Cross Linux From Scratch book when I had to bootstrap Slackware64 on the 32-bit Slackware. It gives great insight.

Eric
 
Old 10-12-2010, 09:21 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,043
Blog Entries: 1

Rep: Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369
Hi,
Quote:
Originally Posted by Alien Bob View Post
I used information from the Cross Linux From Scratch book when I had to bootstrap Slackware64 on the 32-bit Slackware. It gives great insight.

Eric
Eric, do you have a blog entry or information about this experience? I'm curious about the methodologies & stumbling blocks while doing this work.
 
Old 10-12-2010, 09:30 AM   #9
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Original Poster
Rep: Reputation: 119Reputation: 119
Thanks guys.

I can't see LFS displacing Slackware on my computers at home as the main operating system that I run for all the stuff I do with a computer.

But there's something about LFS that's very attractive. For one thing, the LFS developers do a fantastic job of putting everything together and explaining it well. I particularly like the process of building a system up from the bottom and adding what I want/need rather than trying to figure out from a whole, complete system how everything relates.

Secondly, I really like the package users package management scheme. It is surprisingly simple but effective, and I like that it only uses utilities built into Linux.

So, my next step is to repartition my IBM Thinkpad's hard drive and build LFS for it instead of in a virtual machine. The Thinkpad is my 2nd computer. It also runs Slackware, but I really only use it when my wife is on the desktop computer. Half the time I use the laptop to simply SSH into the faster computer and work on it at the same time my wife does.

So it's a good test bed for making a more fully functioning LFS system. It's an older Pentium III, so compiling software may take a while, but I think I'll get very good performance out of LFS, and eventually BLFS, on it when I'm done.

We'll see how it goes.
 
Old 10-12-2010, 09:31 AM   #10
Lufbery
Senior Member
 
Registered: Aug 2006
Location: Harrisburg, PA
Distribution: Slackware 64 14.0
Posts: 1,142
Blog Entries: 29

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by onebuck View Post
Hi,


Eric, do you have a blog entry or information about this experience? I'm curious about the methodologies & stumbling blocks while doing this work.
Eric, I'd like to read more about it too.

By the way, I went multi-lib with Slackware64_13.1. Thanks for all your work providing the compat32 packages.

Regards,
 
Old 10-12-2010, 12:29 PM   #11
corbis_demon
Member
 
Registered: Jun 2004
Location: India
Distribution: Slack 13
Posts: 494

Rep: Reputation: 35
Have done 3 LFS installations in the past year, and I must say, it's pretty good. Have used pkgtools for package management, and the linux-libre kernel (with the pf-patchset), instead of mainline. All packages built with modified slackbuilds, with ability to upgrade packages, even glibc and the kernel, without any discomfort. So, all in all, pretty satisfying
 
Old 10-12-2010, 03:21 PM   #12
55020
Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 314
Blog Entries: 4

Rep: Reputation: 299Reputation: 299Reputation: 299
I don't want to pre-empt Eric's reply, but what I'm doing at the moment is a weak subset of what he did to bootstrap Slackware64.

The problems, so far, are

(1) Older upstream packages that won't build with recent toolchain, libraries or whatever - patch (13.1 shipped a really old version), gpm, sysvinit, sysklogd, netkit-{ftp,rsh}. These can be dealt with by patching and/or upversioning. Google is your friend.

(2) Dependencies that LFS doesn't know or care about. Slackware is a coherent unified whole, and to reconstruct it accurately a lot of optional dependencies have to be baked in by building packages in the right order. The ldd command is your friend. Some of these are circular dependencies that require two passes. A few SlackBuilds sneakily use stuff you haven't built yet (wget inside usbutils and pciutils). Worst of all, there's gcc-gnat...

Additionally, LFS isn't perfect. There are a few signs of recent neglect (lack of volunteers?) and as the authors point out it hasn't been optimised for practicality. The order of building packages in Chapter 6 is perverse and leads to some of the fragility people experience when they "go off-piste". But that's apparently an intentional part of the LFS learning experience.

The best part of this exercise is reading Pat's comments in his SlackBuilds, some of which are quite droll
 
Old 10-12-2010, 04:00 PM   #13
Scott271
Member
 
Registered: Nov 2006
Location: New York
Distribution: Slackware-13/Vector Linux/Zenwalk
Posts: 100

Rep: Reputation: 21
Thanks Lufbery for the review and everyone else for the input. I've always looked at LFS as something daunting, that I wanted to have a good amount of time set aside to put towards it. I may have to take another look at it.

Thanks,
Scott
 
Old 10-12-2010, 07:25 PM   #14
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
One of the reasons I switched to Slack was to prepare myself for LFS. I'd tried once before about a month into my linux (mandriva) career and failed horribly. A month or so with Slackware made LFS fly by! I think it was 6.3 that I built using 13.0. My experiences were much like yours except that I worked virtually straight through and got the whole thing built in about a day and a half. I admittedly didn't absorb as much of the book going that fast as a I could have, but I was determined to get it built and just couldn't wait! I actually used a kernel config from 12.? to build a 2.6.27 kernel, so even my LFS was Slack at the core.

I too came away with an ENORMOUS appreciation for the work that Pat and crew do after building just a basic system. The amount of effort required to build and MAINTAIN a top notch, full featured distro is really quite impressive.
 
Old 10-12-2010, 08:01 PM   #15
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,043
Blog Entries: 1

Rep: Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369Reputation: 1369
Hi,

LFS is available at Linux From Scratch Book 6.7.

Hopefully this thread will lead to more Slackware forum member involvement & experiences with Slackware LFS.

You could also look at Beyond Linux from Scratch (BLFS) project which continues where the Linux From Scratch book finishes. The BLFS book introduces and guides the reader through additions to the system including networking, graphical interfaces, sound support, along with printer and scanner support.

Cross Linux From Scratch is another link that will be of interest.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advise needed on partition layout for building Linux from Scratch johncsl82 Linux From Scratch 3 05-21-2010 06:22 AM
Steps for Building Linux from Scratch bladez99 Linux From Scratch 4 08-09-2009 11:29 PM
building linux from scratch on the asus eee jason87x Linux - Software 1 07-05-2009 06:19 AM
Building a Linux Box from scratch. fenice1976 Linux - General 4 05-16-2004 04:10 AM
Building Linux from scratch linuxcam Linux - Software 9 12-19-2001 08:25 PM


All times are GMT -5. The time now is 05:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration