What makes a distro?

Forum Index » Forums » Linux Distributions
Author Message
Joined: Apr 08, 2008
Posts: 2
Other Topics
Posted Apr 08, 2008 at 6:47:23 PM
Subject: What makes a distro?
I've recently reached my breaking point with M$ windows and moved my personal/development PC to using Linux. I've played with distros in the past, SUSE, gentoo, ubuntu, FreeBSD, and I've settled on Debian for the time being. As much as I enjoy Debian, it's ideals on FLOSS cause me to goto outside their repository sources for certain software. I'm very comfortable compiling software and troubleshooting that process. So I come to you with the question, what programs outside a kernel would I need to make my own Linux distribution? I've gone through as much as I could with Linux from Scratch (LFS) but a lot of it is just following a recipe for building [b]their[/b] distro, without the academic explanation for what other programs a Linux kernel needs to create a productive home/development PC. Are there any books or online resources this community recommends for getting a better understanding on what is required to go from kernel source code to being able to compile/install applications (such as X, Mozilla) without depending on a 3rd-party's repository?
Back to top Profile Email Website
Paul de Vrieze
Joined Jan 01, 1970
Posts: 1

Other Topics
Posted: Apr 10, 2008 12:58:48 PM
What answer do you want? What does the linux kernel need? Well, that's simple, it needs an /sbin/init program that it can load and run. Load and run means that it must be in elf (let's forget about a.out) format, and that if it is dynamically loaded, that the libraries it uses are available. After that, to have a system that behaves like a linux/unix system, you need a lot more. One source of knowledge, besides LFS is the LSB (linux standards base). Building your own distro is not for the feint hearted though. But like the paragraph above tried to say, you can do almost everything you want. If however you want programs to run on the distro without source modifications you will want to have a standard system layout, use udev for device management. Have a reasonably standard init system, etc. If you want to know what (say firefox) needs to be productive (ie. compiled and ran), look at its dependencies. You need those installed to run firefox. To start the system you need a compilation environment. This is basically, when statically compiled: a shell (to run something), gcc (c compiler only), binutils (to link programs). This does not boot, so you'd have to chroot into the environment. Basically this is what a gentoo stage1 provides. From this humble beginning you need to build the actual distribution. The compilation environment is just for bootstrapping. That means first you install glibc, then rebuild gcc and binutils (and their dependencies, like internationalization libraries (gettext)). This whole humble beginning is reasonably documented for LFS and gentoo (at least used to, but nowadays it is hidden away because too many new users would miss a step in the process and fail to get their base system up and running). After the base system is up (and you can boot into a command line) you need to get the applications you want. In short it is "simple" and just involves installing the right dependencies. In effect, there is a reason that few distributions are one person shows (unless they take another distro as starting point). Unfortunately sources come with bugs and other things that have to be worked around. You might have to persuade a build script to look at a different place for headers, etc. I should say I am a gentoo developer, and am biased in favor of gentoo, but gentoo provides heaps of flexibility. It is also easy to base your own distro of (built you don't need to, as you can use an overlay for your own programs). Doing so would save heaps of work and pointless effort. Finally, I'd like to address your "dependency on a 3rd-party repository". Looking at gentoo, there are two things that it provides. First of all, it provides a small set of programs (such as the package manager). Second of all, it provides scripts that automate the compilation of specific packages (ebuilds, they are executed by the package manager). This is basically what every distribution is based out of. In gentoo, most of the flavour comes from the baselayout package. This gentoo-specific package contains some specific expected files (such as a password file) as well as the gentoo init system. It would be possible to replace this entirely to have your own flavour. Unfortunately, replacing the init system will require you to write init script by hand for those applications that can get started automatically at startup (the function of the init system)
Back to top Profile Email Website
kingdord
Joined Apr 08, 2008
Posts: 2

Other Topics
Posted: Apr 10, 2008 4:21:33 PM
Thank you for your reply. Shortly after posting I started reading the LSB website and it has been very helpful. And looking back at my question I see how broad it is, and just how confused I was. I suppose I'm looking to learn about Operating Systems but more specifically Linux through a very academic fashion with the "final exam" being to go from source to a functioning system. As the recent fury of bringing Linux to the average desktop user has biased my search results to give mostly recipe lists, which do not help my understanding of Linux, let alone OS's in general. So allow me to rephrase the question and if this thread has become off-topic for this board please feel free to move it. What resources would one recommend to gain an academic understanding of Linux? LSB so far has been very good, and the previous post helpful, I'm mostly interested in a print book if one exists. I understand that building one's own distro is a lot of "pointless work" from a productive perspective, however the experience is great from a learning perspective.
Back to top Profile Email Website
Rubberman
Joined Jul 30, 2007
Posts: 944
Location:40 miles west of Chicago

Other Topics
Posted: Jan 29, 2009 9:24:33 PM
Have you tried Gentoo? I think it is a good trade-off between brain-free distribution and uber-hacker build-your-own-kernel type system.

Sometimes real fast is almost as good as real time. Remember, Google is your friend!

Back to top Profile Email Website AOL Instant Messenger

Joined Jul 26, 2008
Posts: 703
Location:

Other Topics
Posted: Jan 29, 2009 10:39:10 PM
Just as a alternative, Building a Crux operating system can be challenging and educational also. http://crux.nu/ Here are some book links http://books.google.com/books?id=eiYodx3APfUC http://fullcirclemagazine.org/ http://www.tldp.org/guides.html#pocket http://freecomputerbooks.com/index.html [Modified by: rokytnji on January 29, 2009 05:48 PM]

Back to top Profile Email Website
Binary Snake
Joined Jan 11, 2009
Posts: 197

Other Topics
Posted: Jan 30, 2009 11:00:06 AM
For people who can't afford money to buy computer books, here is a link to a website where you can get the latest books and magazines: http://www.ebookshare.net/
Back to top Profile Email Website MSN
Forum Index » Forums » Linux Distributions