Page 1 of 1

How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 2:19 pm
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.

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 2:28 pm
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.

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 2:35 pm
by iansjack
+1

LFS is about as light as it gets. I think, perhaps, that you underestimate what is involved.

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 2:43 pm
by andrewthompson555
I just want to add bash to the linux kernel.

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 2:46 pm
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.

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 2:54 pm
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.

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 4:02 pm
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?

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 4:42 pm
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)

Re: How would I make a Linux distribution?

Posted: Sun Jan 08, 2017 4:47 pm
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).