Skip to content
Advertisement

How can I build a Linux distro? [closed]

Disclaimer: This is my first time delving into the embedded Linux world (Ubuntu and Debian), despite being a Linux user for some time and having used distros such as Raspbian, Armstrong(beaglebone) and embedded debian. The title may also seem generic, but I really couldn’t think of a better one, I’ve gone to and from work, I’ve been reading a lot for the past few hours and it’s waaaaay past my bed time to get my full beauty sleep, which I will not get a chance again until tuesday, so … I apologize for grammar/syntaxe/formatting errors.

Background

How are packages like Debian, Armstrong, Ubuntu, OpenWRT, etc, built? I mean, I know that when you download the image to a board like a BeagleBone Black you need to build u-boot, the kernel as well as the packages and what differentiates these distros from one another are the packages (I could be wrong here, please correct me).

I have been reading on how to build these distros (Armstrong and OpenWRT to be precise) and all of them just tell me to download their repository and run their configuration scripts in order to get the distro running. And so, this lead me to think: ” (1) What would happen if I had a custom board that does not fall under the configuration of BeagleBone, Raspberry Pi or any other well known board? (2) What did the creators of said boards do the first time they created a unique board? (3) How did they make their own distro? (4) Is it possible to make my own distro by installing any packages I want and make them different from the others?”

As you see there are 4 different questions, so I’ll use the next paragraphs to explain myself, if necessary.

(1) What would happen if I had a custom board that does not fall under the configuration of BeagleBone, Raspberry Pi or any other well known board?

Ok. I tried reading the scripts they run in order to build the distro, but they are too long, it’s very late and it has gotten me nowhere, I’m completely lost. By what I’ve been reading, I imagine that these scripts download u-boot, the kernel and the packages, build them and put them inside the same image (I have read how to “do it manually” with just the bootoader and kernel). I imagine that there are some configuration files, some where the board is described and all that but I can’t be sure. Am I in the correct path?

(2)What did the creators of said boards do the first time they created a unique board?

Up until you may be thinking, “ok, just find a board that looks like your board, modify the files and get on with it”. In the real world that’s what I would do, but now I want to learn and I’ll only learn if I carve all this knowledge into my head. The thing is, that there are several configuration files (by what I’ve studied from u-boot and the kernel) and everything in my body tells to read Embedded Linux Primer, 2nd edition, before asking this. If the answer to this is just too in depth, the please, tell me to read a book, but if not, could anybody help me?

(3)How did they make their own distro?

(4)Is it possible to make my own distro by installing any packages I want and make them different from the others?

I know that there is a lot of development behind distros, and by no means it is my intention to denigrate (is this the right word? English’s not my native language, according to the definition it seems ok, but somehow feels “blargh” when used here) the development made by all these teams. It’s just a question, could I build the bootloader, kernel, a few other random programs and packages and call it my own distro? If so, how do I build the package image into my distro?

If I’m developing a well-known distro from scratch, without using their scripts, would I build the bootloader, the kernel and everything that the well-known distro uses and then bind it in an image? Would I just build u-boot and the kernel and then install all the other sources and build my new linux image from that?

EDIT: I pefer leaving the text above so that new readers can get an idea of my line of thought. I find it difficult to express myself with few words and make it a “relatable question”. So I put a header below that are the most objective questions I can think at the moment. I also edited a bit of the text and gave it a title. I just strike through the previous questions because they seem valid, albeit with a wide variety of good answers, because it may help others with my same questions. If needed I can just delete them.

Jump to the questions

There are a few questions I’d like to get an answer and Im trying to be as objective as possible with them

  1. Can I build a distro like OpenWRT from source code by downloading u-boot, the kernel and specific OpenWRT sources? I mean if I can do it without using their provided scripts. If I use their scripts I know I can modify some configurations and port it to my own “unique” dev board. Could yocto be my starting point?

  2. How can I configure my own unique dev board? Is it ok if I just compile u-boot and the kernel and install some programs on it later? Is it production ready?

  3. Many said something about Linux from scratch. The main argument against it I found was that it was horrible for production. Instead of telling me why it’s horrible for production, could you please tell me how can I make my setup “good” for production?

Advertisement

Answer

Nowadays, one of the first first “stops” would be the Yocto toolkit which helps you building your distribution content. But of course, that is just one example of such a tool, and there many more out there.

In 2016, nobody would be doing a distro “manually from scratch” any more.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement