How would I make a Linux distribution?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
andrewthompson555
Member
Member
Posts: 27
Joined: Thu Oct 13, 2016 2:07 pm

How would I make a Linux distribution?

Post by andrewthompson555 »

Hello.

I really want to make my own Linux distribution. I only want to build the Linux kernel and make it run a shell. I might want to even add packages like Gnome or KDE.

I am not just looking for something to do (I'm not someone who play games and just wants to make something in 5 minutes). I am really serious about creating a distribution. I have looked into LFS (Linux From Scratch) but that seems a little too heavy.

I don't want SuseStudio or Ubuntu kits. I want to build things from source. There is no point of using online tools when you can just tap on a button. You might as well just install Ubuntu, customise it and say you made it.

I am experienced with some C and Java (If you think I'm saying I want to make it all in Java, I am not because it requires a JVM and it is impossible). I would prefer it if I could find something that could help me learn how to actually use Assembly and C to make an OS.

Please help.

Thank you
Andrew.
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: How would I make a Linux distribution?

Post by heat »

Hi,

LFS is your best bet. Your other alternative would be to code all the user-space from scratch, but if you think that LFS is too heavy, then you certainly can't handle writing all the user-space.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How would I make a Linux distribution?

Post by iansjack »

+1

LFS is about as light as it gets. I think, perhaps, that you underestimate what is involved.
andrewthompson555
Member
Member
Posts: 27
Joined: Thu Oct 13, 2016 2:07 pm

Re: How would I make a Linux distribution?

Post by andrewthompson555 »

I just want to add bash to the linux kernel.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: How would I make a Linux distribution?

Post by BrightLight »

andrewthompson555 wrote:I just want to add bash to the linux kernel.
Then learn how the Linux kernel boots. Less than a week ago, you posted the exact same question about making an OpenBSD distribution. :roll:
In general, the boot loader loads the Linux kernel, an initrd and passes parameters to the kernel. You should specify in these parameters to use the initrd as the root file system, and Linux will execute /sbin/init or similar. You put your initialization code there.
Linux From Scratch, as already mentioned, is your best resource for this.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How would I make a Linux distribution?

Post by iansjack »

andrewthompson555 wrote:I just want to add bash to the linux kernel.
You need more than just the kernel and the bash executable to make bash run. That's what LFS teaches you.

You need to fully understand how the kernel works, what supporting software it needs, and how it interacts with the kernel. This is what you find "too heavy" in LFS.
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: How would I make a Linux distribution?

Post by matt11235 »

andrewthompson555 wrote:I just want to add bash to the linux kernel.
Maybe the Linux kernel and a busybox initrd would be better then?
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: How would I make a Linux distribution?

Post by dozniak »

andrewthompson555 wrote:I just want to add bash to the linux kernel.
Just pass "init=/bin/bash" to linux kernel. Done. (It won't work though, because init scripts initialize a LOT of userspace stuff)
Learn to read.
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: How would I make a Linux distribution?

Post by heat »

dozniak wrote:
andrewthompson555 wrote:I just want to add bash to the linux kernel.
Just pass "init=/bin/bash" to linux kernel. Done. (It won't work though, because init scripts initialize a LOT of userspace stuff)
It will work, but probably without job control(Linux uses it as a fallback if it can't find an init script).
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
Post Reply