Do you know how customizable Linux really is? Well you should if you’ve even heard of Linux or dabbled in it a bit. If not, try taking a look at a list of over 1,000 different Linux distributions currently available. All of them try to cater to your exact needs and tastes, so a reasonable mind would think that there’d have to be a distribution out there with which you’ll find the perfect companion.
However, maybe you don’t want to take the time to look through and test every single distribution, especially if there are well over 1,000 of them out there. Maybe you don’t want to take your chances on whether a distribution is a match made in heaven, but instead you want a guarantee. What better way to know you have the perfect match in your hands than to make the operating system yourself?
Why Should I?
Why and how can you make your own Linux operating system? It’s quite simple (well, relatively speaking anyway) as a project exists to help people get started with something like this. The Linux From Scratch project was created specifically to get people going on making their own Linux operating system to meet their own needs, whether it’s for special hardware accommodations, maximizing performance, staying on the bleeding edge, or learning the internals of Linux.
Don’t think that Linux From Scratch is another distribution which simply starts with bare-bones. LFS is actually just a collection of documentation, so everything you do literally comes from each project’s source code. In other words, with the help of LFS documentation, you can download the Linux kernel’s source code directly from their site and work your way from there until you’ve eventually built a complete operating system — or at least as much of an operating system as you need.
Use Linux to Make Linux
When creating your own Linux operating system, you’ll need to understand that you’ll have to use a Linux distribution to create another one. This is because, as you’re creating everything directly from source code, you’ll need common tools provided with most Linux distributions in order to compile and install your LFS system. You don’t have to have the temporary distribution installed; you can just run one off a LiveCD like Ubuntu if you wish.
Getting Started / Partitioning
Before you even start, it’s mandatory that you go over to this page and open up the latest LFS documentation on getting an LFS system started. The documentation will contain links and detailed information on how to accomplish the required steps, which is something this article won’t cover in full.
The first real step after opening up the documentation is to create a new partition where you’ll install your new LFS operating system. You shouldn’t have to do anything different from what you ordinarily do, whether it be a single ext4 partition to hold everything, separate root and home partitions, or whatever else you might do. You’re welcome to create these partitions using your favorite partitioning tool, such as GParted GParted - The Ultimate In Partitioning Software GParted - The Ultimate In Partitioning Software Read More .
Downloading Initial Source Code
Once you have your partitions ready, you’ll need to head over to Chapter 3 to download the source code for all necessary packages and patches. As far as I’m aware of, all of these packages are absolutely required, so your system won’t run without these. Then again, the front page of LFS brags that a system can be tweaked down to a mere 5MB, but you really have to know what you’re doing in order to accomplish that.
Compiling & Installing Your Base System
After making a few more changes as final preparations as defined in Chapter 4 of the documentation, you will begin to build the bare-bones of your LFS system. By following the guide, you’ll be compiling the tools which will make up the toolchain which you will then use to build the rest of the basics. Once you’ve completed that, you’ll “chroot” into your new system (which is the equivalent of restarting into your new operating system, except you are not literally restarting and the change only applies to your terminal window) and begin compiling everything else that will make up your new operating system.
Once you have a simple configuration going, you can begin to install other software that will make your system truly yours. What other software you should install is completely up to you, your wants, and your needs. Just remember, there is no package manager 5 Great Tips for the Ubuntu Software Center [Linux] 5 Great Tips for the Ubuntu Software Center [Linux] Read More as the software’s source code is downloaded and compiled.
Conclusion
Creating an LFS operating system will definitely take some time as compiling software is not always a fast process, and people who haven’t tried Linux or aren’t comfortable with the terminal or other nitty-gritty aspects of an operating system shouldn’t try this unless you’re doing this to learn. If you belong in those groups but want to try anyway, I recommend you try it in a safe, isolated location so that you don’t destroy something you want to keep by accident. If you have any questions, don’t hesitate to leave a comment! Have fun with your project and good luck!
What would you make your own LFS system for? What kind of software would it include, and what would be its purpose? Would you even create your own LFS system? Let us know in the comments!
Image Credits: lacinda
It would be great if they'd actually tell us how to get everything started... It only describes what each "book" tell you, but they don't tell you how to actually make use of them (pun intended). They have a whole lot of xml "books" with no user-friendly descriptions and no user-friendly way to actually read them.
Go t o pegasusos. jimdo. com
Go to pegasusos. jimdo. com
I have a question: I had one issue when I installed linux, and it was because I couldn't play my games on it. Is it possible to create one so that my games will run on it? (right now my house is dominated by Windows, which most of our games use, and I was wanting something that would work just as well if not better for gaming and coding)
Actually it's not possible directly, but u can play windows game on Linux by using a additional software. But i can not remember one right now. You may do some search. you will get one.
WINE https://www.winehq.org/
Wine is not a good alternative to running high performance binary programs like videogames in today's age. You are better off sticking to games that 'work' with linux. These games do exist, but take it from someone who has wanted this for years. It is taking forever for linux support to come to major titles.
Wine has a lot of problems with Visual C dependencies and other dependencies which makes it hard to run anything written in C++ or C#. Even if and when you get it running it under performs because you are basically recompiling on the fly.
Can I make one Operating system in 6 months? I am willing to take this as my project in college.
Nice tutorial. It motivated me to create my own Linux. Thanks for the detailed instructions and links!
hi to all,
I am studying diploma in it. I recently build LFS/BLFS 7.6 os and tell this about to my lectures they asked to me is it possible to use this LFS system on any computer? I don't answer because I don't know.LFS is only learning perpose is it correct?
No. A main reason the avg. user wants to create LFS is learning, yes, but there are actual uses for LFS, e.g. for having top perfomance for that 1 algorithm that you want to run or to specify the os for doing only one thing without loading useless resources. LFS isn't ONE system, it's a guide that tells you how you can build an OS for your needs. Hope i helped after 2 years :D
Looks pretty cool. I want to learn Linux now. What is the checklist of concepts I should learn?
Can I use LFS to learn how to code? And if I can, how long will it take?
I really want to do this, but I just can't seem to find time for it. With my current level of skill (absolutely minimal, as in, barely able to code the most basic programs with lots of help from the internet), it would probably take me years. Too bad, I found a slew of speed tricks and system tweaks on the internet that I wish I could include in my OS by default. I also wish to eliminate a lot of the OS features that I never use.
*SIGH* Maybe I'll just go browse the distros list...
Starting my build today from scratch. I will have a blog post on it and will post the link with updates. Seems like a daunting task, but why not. I've always wanted to learn a bit more about the inner workings of linux anyways. Good thing my boss lets me experiment as long as my work is done :)
I have created a small distro (it got minimal packages and i followed LFS approach), it is terminal based i.e. no desktop environment like gnome or kde etc.
I want to distribute it as an ISO image I need some help on how to create this tiny distro ISO image? I got couple of questions kindly guide
1) Is there some command line tool which i can use to create ISO image. I would have to install that software in my tiny distro?
2) How to create partition layout for user, before even starting the kernel, do i need to write script? How can i invoke that from ISO image? etc I want minimal user interaction at this step. I would have to install boot loader also, at this stage?
Might be basic question, but i am new to this, so kindly guide.
cant find source
very interesting.
I plan to do this in my free time. i got a raspi and will try to make the os for it
Thanks a lot for introducing me to this project! I'm planning to make my own operating system to help society to overcome its main problems.
hi i have a few question 1st is after completing general steps for making os should i configure ubuntu software center so that i can install all my need with apt-get command?
2nd is after building os how to make a iso image so that i can install it ?
hi great article.i want to know one thing can we use existing partition which have some data for making os??
How much time does one need to dedicate for LFS? when I heard of LFS on quora, the person took 1 week to make it. I want to go deeper into linux, i suppose LFS gives me a shot at that.
Another, less traumatic, way to build a system is to install antiX Core and then, using apt-get, install only the packages that are wanted/needed.
what do you do on this!!!!!!!!!!!!!!!!!!!!!!!!!!!
Quick question:
How would a create a O.S. (mobile), from Android (as I'd like the play store)?
It's possible, but like I said to ashu, I'm unable to help you there because it's a whole other world when it comes to mobile.
sir! i am trying to make my own mobile operating system and i am using linux kernel 2.6.10 but i am not able to understand how do i test my operating system.
it will be very kind of you if you can help me out..
Sorry, I'm afraid I can't help you out! Mobile operating systems are a completely different subject, and it's extremely hard to get them to work correctly as most mobile devices need specific (often proprietary) drivers.
What all things do we need to create our own operating system? And does this article provides them all?
The article and the suggested tutorial has all the information you need. I'd suggest going back to the tutorial and reading (or at least skimming) through it.
I am in the process of building my own Linux OS right now and I followed your advice to use a live USB of Ubuntu to build this. And using the live USB so far has worked great but this is the first problem I am encountering I am in chapter 3 and downloading the software and patches. I have just so far a hard drive with partitions and no software on the hard drive. The LFS pdf suggests to download the patches and software using wget I do not know how on a blank hard drive to use or download wget. So I am downloading the software and patches with archive manager. So I am sure I can find the files which are going into the archive manager so are these files on the hard drive where I am going to be able to get to them since I am using the live USB? Thanks for the help.
wget is a command-line program which downloads files from the internet. When the tutorial asks you to use wget, it should have been Ubuntu's wget to download from the internet and save onto the hard drive. In any case, if you've downloaded the necessary files, just extract them onto the hard drive, as the instructions tell you.
I have never used linux before but i have a great interest in developing a linux distribution. Do you think i need to do any preparations before i start with the project with the help of your article??
It would be very advantageous to play around with an existing Linux distribution so you'll understand how it works. I'd only suggest creating your own distribution after you have a fair amount of knowledge in general about Linux.
linux is good but need a big company to support
Not always the case. Linux Mint doesn't have a big company supporting it, and it's quite popular. Then again, using Linux Mint as an example is cheating a bit because it relies on Ubuntu, which has Canonical.
There also is Fedora which is backstopped by Red Hat
if you are using the Ubuntu distro it would be easier to start with the Ubuntu Customization Kit http://uck.sourceforge.net/
Thank you, I've been looking for this!
Dear all,
I would like to point you to
http://kaarpux.kaarposoft.dk/
This is a Linux distro based on LFS,
but where everything is build by scripts.
/Henrik
That's a nice way to speed things up a bit. Thanks!
Much thanks for an excellent article! I was hoping to install Linux over a weekend, but this project looks a lot more intense and time consuming. Still, inspirational.
I'll definitely try the linux from scratch operating system. Found also inspiration on this website: http://www.operating-system.org
Nice link!
I'll definitely try linux from scratch. I found also this website useful in general topic about operating systems: http://www.operating-system.org
Linux is the Bomb!! Love all your articles and this one is just "doing it" for me!!
Yes linux is the best and powerful operating system XD
This would be awesome to try when I find enough free time.
as ben stated - Definitely not for the faint hearted. - I'm on my third build 7.1 I'm attempting the XORG now I'v susessfully built 6.3, 6.7, and the custom live CD.
good luk to all that try it is a learning experience
This is something on my to do list.
With Puppy Linux working well for me as a rescue boat.
XBMCbuntu working as a media station.
I am getting over with terminal coding for an entire OS.
But some casual console work is necessary when things go bad...
Maybe this project can help students and aspiring computer scientists to create new stuffs...
Used Linux for about years now. A lot has changed in that time but mainly use Mandriva after falling off Redhat as it became more commercial oriented. Lot safer than Windows and half the crash problems. There are many great distros out there that would probably fit most anyones needs in a Linux distro without building one or you can start with a stripped down version of a major distro and add programs as you need. The command line function of Linux makes it much easier to do things that you can't get access to in Windows and it's fun and easy to learn and work with. Since getting into opensource I haven't bought an operating system in 10 years now but have occasionally supported some of the open source projects out there.
Danny's ideas are sound and a good way to tweak and learn a very reliable and secure operating system. Give it a try.
I agree, I've always found the Linux terminal to be way more understandable than the Windows command line. Then again, maybe it's because I was never turned on by Windows' command line in the first place! :P
I agree about the stock command line but JPSoft's 4dos (command.com replacement) was an amazing experience back in the pure DOS days. I think you would have loved it.
too many to chose from
This would be a great project to do.
I dont want to waste my time
Definitely a good article.
I'd just go with
Suse Studio
http://susestudio.com/
You can build what you want- easy as pie. It might be a better way to ease into Linux? If that floats your boat, then you could have a whack at source-code building.
Imho... ;)
SUSE Studio is also a good choice. I actually wrote about it a long time ago (well, for me it's a long time ago).
//www.makeuseof.com/tag/create-custom-linux-installation-disc-suse-studio/
I agree. It's sort of like having a bit of a go without having to get right into the guts of it. However, everyone has to start somewhere, and for a lot of people, starting with a success gives them the confidence to push further next time (LFS?).
One nice thing about SuseStudio is how you can hover the add-ons to read exactly what it is before adding. That gives new folks a good intro into what's available, what it's called, & what dependencies are, etc...
Great article, as are all I've seen @ makeuseof. :)
It is a fun ride and a great learning curve. There's lots of information out there on the net. Recently I stumbled upon this site which toolkit handles lots of repetitive actions;
Build GNU/Linux System Architect Toolkit - http://www.happy-monkey.net/architect/
It's cool check it out :)
Thanks Frank! I'll take a closer look.
That project has been discontinued.
I'd love to do this one day, but just figuring out how to install to my mac without destroying my computer was challenging. Maybe one day... :)
Quite honestly, I have still unsuccessfully been able to help a friend of mine (who loves his iMac) get Linux on it. As a geek, I have failed.
I've done it twice successfully. The trick is that Macs limit the number of partitions, so instead of setting up a swap partition, you set up a swap file instead. This is especially true of Santa Rosa era Macbooks. I'd also recommend that if you do install Linux on a Mac, you install rEFIt as a boot loader (http://refit.sourceforge.net/)
Yeah, we've tried rEFIt, and installing isn't an issue, but actually booting it up was where problems started to occur. Oh well, maybe I'll have another try at it someday. Thanks for the tips!
Do you really need to install Linux on Macs. It is already based on BSD.
Just install what you need from BSD resources using mac console commands. I installed mc and it was very nice to have it,
I tried this with Minix decades ago. It's not something I would bother with again. Off the shelf Ubuntu or Zorin works for me.
While this could be interesting in terms of learning, I wouldn't personally use this method to build an OS for daily use after having to put up with "dependency hell" when installing software within Linux distros I used 10+ years ago. It would seem to me that remastering an existing distro makes more sense.
I agree with that. This really has its learning and special-case uses. I don't remember much about dependency hell from way back in the day, but some of the stories I find could be told during Halloween! :P
I've always wanted to make my own Linux OS this seems to explain it very well, i'll give it a shot when I have some free time, thanks for the tips !
please let us know how it goes! You'll have to tell us all about it from start to end!
Good luck! Please do share with us how it went if you can. :)
Definitely not for the faint hearted.
Most definitely. People will actually need to prefer the terminal to do this with enough courage. :P