Slashdot Mirror


How to Build Your Own Linux Distribution

Shelly writes "Go to the source to learn Linux basics and build the right Linux for you. Linux From Scratch (LFS) and its descendants represent a new way to teach users how the Linux operating systems work. LFS is based on the assumption that compiling a complete operating system piece by piece not only teaches how the operating system works but also allows an independent operator to build systems for speed, footprint, or security."

40 of 192 comments (clear)

  1. Sanrionix by scapermoya · · Score: 5, Funny

    I want mine with hello kitty all over it

    --
    Beware the Jubjub bird, and shun the frumious Bandersnatch.
    1. Re:Sanrionix by klmth · · Score: 4, Funny

      Which of course goes percektly with the Hello Kitty Laptop:
      http://www.exonome.com/fj/phkl/

  2. So? by Anonymous Coward · · Score: 4, Insightful

    With LFS reaching 6.0 a while ago, how is this news exactly?

  3. :D:D by p!ngu · · Score: 2, Funny

    Step 1: Build your own linux distribution. Step 2: Distribute. Step 3: ??? Step 4: Profit!

  4. Huh?! by SinaSa · · Score: 4, Interesting

    Queue gentoo fanboys...

    But seriously, LFS is new? I based my distribution on LFS, and it taught me a lot about how linux works, but this was several years ago. How is LFS new?

    --
    --
    The last digit of pi is four.
    1. Re:Huh?! by athakur999 · · Score: 4, Insightful

      I love Gentoo myself but I don't know how much it really teaches you about how Linux works. Most of the nitty gritty parts about installing packages is hidden by the Portage system. The only difference between typing in "emerge kde" vs. "apt-get install kde" is that it takes alot longer and you see a ton of compilation messages. The directory layout is chosen for you, the dependencies are installed automatically for you, etc. How much do you really learn watching hundreds of pages of GCC messages whizzing by?

      --
      "People that quote themselves in their signatures bother me" - athakur999
  5. These youngsters... by Goth+Biker+Babe · · Score: 3, Interesting

    I remember when rolling your own was the only way to have a distribution on some of the processors.

  6. LFS.. by Sir+Pallas · · Score: 5, Interesting

    First, Linux From Scratch has been around a long time. Back when I first started using GNU/Linux, I had RedHat installed because I recognized the name. I soon decided that I wanted something that I knew worked because the programs were compiled together, the way they were meant to be. Enter LFS. But if you've ever set up a system (especially a slow system) from scratch, it is kind of painful. My laptop was an LFS system because nothing else worked right with the hardware. But Gentoo is really not a bad solution: you get the flexibility, but all the hard, painful work is done. No more looking for hundreds of package updates, no more hand checking dependencies. LFS is a good deal for systems that are tied to very specific applications, and I learned quite a bit about the layout of the system, so I encourage everyone to take a look at LFS. But for oft used systems, it's more of a hassle than it's worth.

  7. nice overview by professorhojo · · Score: 5, Informative
  8. Build Your Own Linux! by VxJasonxV · · Score: 4, Interesting

    It can also provide you with the most frustrating experience ever!

    Not entirely, but some broken packages (or installing one that breaks another) is probably the bane of most administrators existence...

    This is why a source hybrid (ala. gentoo) system works so well. You compile from source (reaping all the benefits) but something else manages dependancies, conflicts, ./configure options, and installation in general.

    (For the record, I used Linux From Scratch 5.0, I built my base system, then stopped before I had an x server or anything [also known as, Beyond LFS]. )

    1. Re:Build Your Own Linux! by Dancin_Santa · · Score: 4, Insightful

      Re-visiting the LFS scenario every year or two, for you distro-monkeys, should be a requirement of the "Order of The Penguin" membership ...

      I don't understand this "Cult of the Difficult" that seems to be very pervasive in the Open Source community. Software has always been about making the difficult easier. We design and write software to make tasks faster or more easily performed or, in some cases like the spreadsheet, possible.

      So I don't see what the fascination is with trifling with the minutia of a system just for kicks. I guess if it's for your own kicks, that's fine, but comments like yours above are very common in the computer technology industry. "If you don't understand the root of this, you will never understand this."

      Understanding every little bit of something is not a requirement for using it. For most things, it shouldn't be. And for the best-written software, it isn't. Why, then, do people think that getting your hands dirty in Linux source code is such a good thing for everyone? It seems like a colossal waste of time for most people who would rather get their work done.

      I had the same reaction when some Mac fanatic tried to tell me how much more user-friendly MacOS was in one breath and then turn around and tell someone that they need to manually increase the amount of RAM allotted to some random program in the next breath. That isn't user-friendliness. That's OS-retardation.

      A good piece of software should anticipate what you want to do and make it easy to do it. It should handle things that you don't want to handle, and it should optimize things that you do often. It should, to steal a phrase from Apple, Just Work.

      I don't want to fiddle with Linux's innards any more than I want to fiddle with my own. I am happy with GIGO and am willing to accept it as a black box, but if something goes wrong, I'd rather call a doctor who spent 8 years of their life studying the black box than trying to do that studying on my own.

    2. Re:Build Your Own Linux! by torpor · · Score: 3, Insightful

      I don't understand this "Cult of the Difficult" that seems to be very pervasive in the Open Source community.

      anything which increases the level of a persons understanding of a scenario, makes them more competent. competence in this industry is an honored and valuable condition.

      Understanding every little bit of something is not a requirement for using it

      true, the only 'requirement' is that it be working and usable in the first place. but if you're a linux person, and you like these things, you should not be afraid to explore and learn by tweaking/crashing/building. the reason for this is, that the more competent you are, the more stable your system will be .. and this is true of all endeavours, not just computers, not just linux, not just windows.

      hey, it works for sailing too. it works for raising kids. it works for driving cars. thus: it works for linux.

      get under the hood, change your own oil, build your own binutils. it will help you achieve a better state of operation, and its really not that hard to do, if you do it often enough...

      (the reason you might feel like things get 'culty' about this issue is that, in fact, there is a corollary: the "Cult of Ease" has resulted in countless generations of incompetent slobs unable to even wipe their own /tmp dir, let alone figure out how to reboot...)

      --
      ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
    3. Re:Build Your Own Linux! by NineNine · · Score: 2, Interesting

      the "Cult of Ease" has resulted in countless generations of incompetent slobs unable to even wipe their own /tmp dir, let alone figure out how to reboot

      Well, why stop there? Generations of having "farmers" has made it so people can't grow their own food any more. Everybody should learn how to grow their own food, and raise their own meat. And hell, when was the last time you met somebody who could make their own clothes? I mean, everybody I know just buys their clothes. If they need a special shirt, wouldn't it be better if they grew their own cotton, made their own fabric, and leared to sew themselves?

      It's called "speciaization". It's the basis of advanced human civilization. Without it, we'd still be living like the Amish.

    4. Re:Build Your Own Linux! by MrByte420 · · Score: 2, Insightful

      I think your missing the point.

      LFS is not for a user like yourself that does not care about the minutia, its for users who want to have a good grasp of the underlying system. You'll be amazed on how much you'll learn about Linux by piecing it together yourself. The knowledge that you gain is incredibly helpful later on as a professional when your fixing some problem with very deep causes. I strongly reccomend that any professiaonal using Linux on a regular basis install LFS. You don't need to use it for a real system - i don't and wouldn't.

      I'm not looking for complication, i'm looking for understanding.

      --
      If religous zealots don't believe in Evolution, then why are they so worried about bird flu?
  9. Not really that new by Dancin_Santa · · Score: 5, Informative

    People have been doing LFS for years. It's nothing really too new or significant.

    It's not even a really good way to learn about how "Linux the OS" works. It's just another way of spending an inordinate amount of time tinkering with your computer (not that there's anything wrong with that).

    If you want the benefits of LFS without the pain, just stick with Gentoo or Sorcerer Linux and let someone else worry about the sources. You still get the custom compilation benefits but don't have to waste time trying to track down stupid dependency problems (at least not as much as you would with LFS, but more than with a mainstream distro).

    1. Re:Not really that new by irw · · Score: 4, Interesting

      I did the installation-from-sourcecode back in in 1994 using the slackware (2.0) source set, but building manually instead of using the scripts.

      At the time I was also a modest C programmmer (2nd year at uni), and took the time to look at the internals of many of the daemons and other major components. It taught me a damn lot.

      Eleven years on... I've been a professsional unix sysadmin/engineer for around 8 years, with better understanding of unix - ANY unix, the skills are very transferable - than most others in my organisation with twice my experience, because I have an "internal" view of unix in addition to the "external" view your average admin has.

      So the exercise most definitely IS worth the effort.

      LFS is NOT about "custom compilation benefits", and is ALL about tracking down those "stupid dependency problems" in order to learn how the whole show hangs together.

    2. Re:Not really that new by quarkscat · · Score: 2, Insightful

      Then again, some people don't want LFS on a different platform but "their favorite ($insert favorite distro here$) linux distro" on a different platform. Some distros are only packaged for a few architectures.

      Slightly OT, but I can remember when MS WinNT was available for the Alpha, Intel, MIPS and PPC platform.

      The real strength of linux (alright, GNU/linux) is that since source code is available for virtually everything, your favorite distribution can be built on your favorite platform. The real sticking point, in my book, are nasty OEM manufactureres that insist upon providing binary-only drivers for only one or two architectures. Theo (of OpenBSD fame) is correct in chiding these OEMs about their drivers -- it just isn't right.

  10. Go to the source by Dancin_Santa · · Score: 3, Informative
  11. Some info by zaydana · · Score: 2, Informative

    Since it wasn't linked in the main thingamjig, you might want to check this out: http://www.linuxfromscratch.org/ Notice, when you look at that, LFS is now at version 6.0. Solid proof that this isn't actually "new" at all. =) I can remember building LFS 3.0 actually on an old pentium 150... just made some scripts for it and left the PC on overnight.

  12. And all four newbies by hubbah · · Score: 3, Insightful

    who succeed in getting their own build running will learn a lot from this experience. The others will switch to Windows. - Hubbah

  13. Microsofts Response by Elitist_Phoenix · · Score: 2, Funny

    I can't wait for Microsoft's response and rebuttal entitled "How to steal an core concepts, and pass them off as your own operating system"

    --
    "I'm going to f***ing bury that guy, I have done it before, and I will do it again. I'm going to f***ing kill Google"
  14. Nice to learn by miyako · · Score: 5, Insightful

    LFS is a nice way to learn more about Linux, I built LFS on a box a few years ago, and probably learned more about Linux doing so than I ever could have just from using it, or just from reading books targed at a specific distribution.
    That said though, I don't think it's very practicle for a system that you actually want to use for day to day use. Building a Linux system from scratch takes a lot of time, and then you have to keep track of all of the security patches for all of the packages you used, and if you want to upgrade one of the core libraries for some reason you end up having to rebuild most of the system.
    Building a distro for scratch is a fun way to learn, and I encourage hobbiests who are interested in learning how a linux system works to do so, but unless you have a critical mass of people contributing patches, helping with stuff, etc, then you end up spending all your time keeping the distro up to date, and no time actually using the system.
    Which, if your just in it for the hobbiest aspect isn't necessarily a bad thing, but I still think it's generally impracticle if you want to have an actually usuable distribution.

    --
    Famous Last Words: "hmm...wikipedia says it's edible"
  15. Not that uselss - why not try it yourself? by victorhooi · · Score: 2, Interesting
    heya,

    Hmm, in reply to all those who claim that you don't learn anything, and that you're just following instructions, and who recommend Gentoo, how about putting your money where your mouth is and building it yourself? (and pasting the proof here, which will usually take the form of "oh fsck this......how do i fix this?")

    Take it from me, when you've stayed up to 2am trying to figure out why this fsck-ing package won't install, and why you keep getting "Error 1:...blah blah", then when you finally figure out why, it tends to stick in your head.

    Sure, if you copy and paste everything from the single-html file, you won't learn much - the learning comes from actually *reading* the document instead of mindlessly pasting/copying, and skimming through the mailing lists, to see why they chose to do things a certain way, and hanging on the IRC channel.

    The BLFS which follows afterwards is also definitely recommended - in fact, I often use it as a hints guide to installing stuff on top of my normal distro (Slack)...(not for my WinXP box..lol)

    Also, using something like checkinstall or paco is recommended - and there's also cpucaps is also useful (link at end).

    cya,

    Victor

    (http://members.jcom.home.ne.jp/jacobi/linux/softw ares.html

    1. Re:Not that uselss - why not try it yourself? by Shadowlore · · Score: 2, Interesting

      Hmm, in reply to all those who claim that you don't learn anything, and that you're just following instructions, and who recommend Gentoo, how about putting your money where your mouth is and building it yourself? (and pasting the proof here, which will usually take the form of "oh fsck this......how do i fix this?")

      Take it from me, when you've stayed up to 2am trying to figure out why this fsck-ing package won't install, and why you keep getting "Error 1:...blah blah", then when you finally figure out why, it tends to stick in your head.


      No, not necessarily. It is not necessarily true that banging your head over something for a while and finally fixing it will teach you how to fix things. You have to understand why it failed and why the fix worked. You can effect a specific fix without either of those. Up till 2am? Please. I'm just getting to lunch at 2am. ;) Most admins trying to figure out why something is broke during compilation do the smart thing: they turn to google, to usenet, and email.

      They do the smart thing and ask others who may have already solved the problem. They don't beat their head against the wall trying to figure it out to the wee hours of their next morning. I've been at this "Linux thing" for ten years laddie. I've also worked a good amount of time as a Q&A and qualification test engineer. Learning how to compile something is not the same as learning how to fix something. Often the things that go wrong on a system, have nothing to do with compiling them. It is interaction among processes and limited resources in strange ways that tend to cause problems. Or removing something that something else needed.

      Sure, if you copy and paste everything from the single-html file, you won't learn much - the learning comes from actually *reading* the document instead of mindlessly pasting/copying, and skimming through the mailing lists, to see why they chose to do things a certain way, and hanging on the IRC channel.

      Seeing how something is done does not get you any understanding on *why* it was done.

      I've bult Linux installs since before "LFS" was born. One of which was on one of the early Alpha 4/233 stations to hit ebay _many_ years ago. That machine is still running from that install base. LFS is not some rite of passage, nor is it particularly useful in "learning Linux" any more so than any other distribution. It doesn't make you a better admin or any better at understanding "Linux". You can "learn Linux" using the same method of trial/error/ask/learn that you can with LFS. If you can't "learn Linux" using a canned distribution, you will have issues with LFS or Gentoo if you seek to use them as your learning tool. *Every* technique you think makes LFS help you learn is available on *any* Linux install/distribution.

      --
      My Suburban burns less gasoline than your Prius.
  16. Next on Slashdot: How to Invent the Wheel! by surfcow · · Score: 4, Funny

    Next week: Fire - A How-To Guide

    (A disturbance in the force, as though an entire audience with Asperger's was thinking: "was that supposed to be funny?")

    This is humor. Laugh damnit, laugh!

    1. Re:Next on Slashdot: How to Invent the Wheel! by klang · · Score: 2, Informative

      Learn how to make fire from a Coke can and a chocolate bar or simply from ice or water if you must..

  17. Re:EVEN MORE!?!?! by treff89 · · Score: 2, Insightful

    You're right - this is a mixed blessing. Sure, making your own distro is great and all, but it can only make things more confusing for new Linux users (and believe me, the more the better). It's a great idea, to be able to build your own distribution - don't get me wrong - but as I said, some users could be fazed, and yet others put off from Linux by malicious distributions - better, methinks, to stick with 'safe' ones such as SUSE, Mandrake, Fedora Core, etc., and to a lesser extent Gentoo.

  18. Not exactly teaching how it works by Shadowlore · · Score: 4, Interesting

    If you can follow directions you can get LFS up and running. That is all you need to know how to do. Complete newbies get Gentoo or LFS working simply by following directions.

    LFS is cool and has a place for those willing and able to make decisions on how base libraries and apps are compiled. Speed? Sometimes, but only of import in limited applications. None of which newbies should be involved with.

    I teach Linux use and administration, as well as security. LFS doesn't exactly provide you the opportunity to learn how to secure your system any more than SuSE, Redhat, or Gentoo for example, or even Slackware.

    Further, there are many choices you have to make right from the get go. This merely teaches you a way (assuming you are doing more than following the directions), not the way. There are few "the way it works" out there. And that is how it works on nearly all distributions. LFS provides no advantage there.

    Indeed, security-wise unless you already know what you are doing, LFS provides you a prime opportunity to leave your system open. Most modern distributions come fairly well locked down out of the box. LFS, by definition doesn't. While you are downloading the packages you are potentially exposed. So you have to follow the step by step directions. Which puts us back to merely following directions.

    When I want/need to teach people the nitty gritty, I turn to gentoo, not LFS. I gave LFS a long trial and it failed in comparison to gentoo for this purpose. I've been "doing Linux" for about ten years, so the idea behind LFS isn't new to me. Gentoo provides a solid base on which to build a custom "distribution" (it isn't a distribution if it is for your own purposes/company/use - you have to distribute it to be a distribution).

    LFS has it's place, but not as a teaching you how Linux works and how to make it fast and secure standpoint. It is mainly aimed at/useful for the hardcore or people who have very specific unmet software set needs.

    --
    My Suburban burns less gasoline than your Prius.
  19. Re:This is great... by Jane_Dozey · · Score: 2, Insightful

    LFS has always been aimed at people who wish to build their own linux system from the ground up. It's never been (and I shouldn't have thought it ever will be) aimed at people who just want a working system.

    Don't worry, I don't think the guys who write the LFS book will ever get the idea into their heads that promoting this to general users would be a good idea.

    --
    Silly rabbit
  20. bug fixes, outdated packages, etc. by tannhaus · · Score: 3, Insightful

    I really don't see how anyone could use LFS as anything but "build it, learn how it works, delete it". There are so many security bugs fixed from package release to package release, it would be a full time job to keep track of all of them. Then, the ONE package you overlooked gets compromised and you're owned.

  21. Security? by Xel'Naga · · Score: 3, Insightful
    allows an independent operator to build systems for speed, footprint, or security.

    It's probably one of the most common security problems - making a system secure is very hard. Even security experts fail at this. Doing it yourself is only going to make you repeat the errors which have been corrected in other distros.

    The only security you could get is security through obscurity, which is not security.

  22. Re:EVEN MORE!?!?! by richy+freeway · · Score: 2, Insightful

    Since when did it become law for everyone to release every distro they make? I don't think this is going to be as much of a problem as you make out. The newbie linux user is more likely to end up with one of the 'safe' distros anyway.

  23. Re:EVEN MORE!?!?! by fendragon · · Score: 4, Insightful

    We probably don't need any more general purpose distributions, but the value in a kit for making a new distribution is for specialised applications. There are various router/firewall projects and a couple of DAW (Digital Audio Workstation) packages that come in to this category, for example. There's lots of potential for whole applications that boot from a CDROM like Knoppix and can be temporarily used on an PC without touching what was installed on the HD.

  24. The "home excercise equipment" of Linux distros by oneandoneis2 · · Score: 3, Insightful

    I built an LFS system a while back. It was great fun, and if nothing else, it taught me how to compile from source - something I'd always been a bit afraid of doing before. After all, if I messed up, how did I delete the files? The package manager wouldn't do it for me. . .

    Some people are saying it teaches you a lot, and others are saying it's no better than any other distro.

    I think installing LFS is like buying home gym equipment. Buying an excercise bike isn't going to make you fit, installing LFS isn't going to teach you a great deal.

    All either does is provide you with an opportunity to get what you want. You CAN use excercise equipment to get fit; You CAN use LFS to learn a lot about Linux.

    If you just follow the LFS instructions and leave it at that, you'll probably be wasting your time. If you take the time to read around what you're doing, so you understand exactly WHY you're doing what you're doing, you'll learn a great deal.

    And if you go on to Beyond LFS, you'll come to truly appreciate package managers. When you've done the "To install A, I need B, which requires C, which relies on D. . . " thing a few times, you'll REALLY understand why package management is such a big topic. The amount of running around I had to do to get FVWM running. . .

    I liked my LFS install, but once I had overcome the challenge of getting it working, it just became a chore to KEEP it working. So I switched to Gentoo, which is no effort at all to keep up-to-date.

    But I'm glad I did LFS first.

    --
    So.. it has come to this
  25. Best way to learn Linux by Mika_Lindman · · Score: 4, Interesting

    Best way to learn how Linux works is by breaking it. And then spending 3 days trying to fix it. And then breaking it again. And again. And again.

    And it's easy, all you need to do is try to get that weird piece of equipment working, or that x version of software y which isn't in your distributions repository. And Linux will break. And you'll learn it! It's great!

  26. An Analogy by Ann+Elk · · Score: 4, Informative

    Building your own Linux distribution is like building your own airplane.

    People build their own airplanes not because they want Airplane X or Feature Y, they do it because they want to build an airplane. They want to take control of the construction process and be intimately familiar with the final product. They want to learn how the various airplane systems function. They will not necessarily learn the detailed workings of an internal combustion engine, but they will learn how it interacts with other systems.

    The same is true with LFS. If you want a generic Linux distribution, then install Fedora, Gentoo, Debian, or whatever suits you. However, if you want to build your own Linux distribution, if want to take control and be intimately familiar with the final product, then LFS is the way to go. You will learn how the various components function. You will not necessarily learn the detailed workings of the Linux kernel, but you will learn how it interacts with other system components.

  27. This isn't logic by LinuxRulz · · Score: 3, Informative
    I find all this a bit funny. I've been asked a thousand times "which distro is the best to learn how linux works". Now, I read that LFS helps learning how the OS works. Let me disagree:
    When we look to Windows admins, do they need to install it from scratch to understand the internals and how to repair things? No!
    And that's exactly the same here. We don't need to know how to compile things to know how they interact and how to repair what's broken. Yes, you can learn to assemble an OS but WHO CARES? All the enterprises or people you'll met will ALL used canned distributions of Linux. They all have their own problems installing but also have their way to solve it.
    If you want to learn the system internal do it with a distro you like. Install packages one by one and see how they work, what they do, etc. but don't give you the trouble to compile all from scratch.

    If you are still searching problems to solve to learn something after that, check out your distro's bug tracker. I'm sure they'll appreciate you helping them solve the thousand problem there are!

  28. The answer is at Distrowatch.com by EdlinUser · · Score: 2, Informative

    "How to Build Your Own Linux Distribution"

    Klaus Knopper's Knoppix has encouraged many people build their own distro. Most of these have instructions for remastering the disk and creating a personal Linux disro on a bootable CD.

    I'm fond of:

    GeeXbox - multimedia player, plays my DVDs on a old machine.

    SLAX - based on Slackware, detailed instructions for remastering. Has quite a community around it.

    Austrumi - Loads into memory and then ejects the CD. Browser, word processor, Email, multimedia, games, more. It's only a 48 M download, I love it.

    Puppy - Good reviews but doesn't work on my hardware.

    DamnSmallLinux - Fits on a miniCD. A community is growing around this one also.

  29. How I did it. by Mad+Ogre · · Score: 2, Funny

    Pretty much I just got a Linspire disk, took a sharpy to it and wrote "MY LINUX" on it.
    Worked great. Installed everything just fine, found all my device drivers, rebooted and runs great.

    --
    MadOgre.com
  30. SourceMage GNU/Linux by Anonymous Coward · · Score: 2, Informative

    Somebody here said that LFS is better when you have a script to run its installation steps overnight in unattended mode. SourceMage is this kind of script, only more. If you're keen on LFS, want to learn Linux, but don't have patience to go through mundate things (like typing ./configure approximately 1,000,000 times, including false starts), please check out SourceMage. We won't disappoint.