28

Some of my friends and I are interested in starting a new Linux distro. How do we do that? What do we need to plan?

Backstory

I represent a community of Linux sysadmins/implementors whose special needs include, among others:

  • A specific 'lean' kernel config
  • Package management that fits our 'field needs'
  • Binary packages optimized for our 'use cases'
  • X-less system

To the point: We have need of a specially-configured production-quality Linux distribution to be run exclusively as Para-Virtualized Production Servers. Rather than jumping through all the hoops and loops every time we need a VM-ized Server, we would very much like a semi-prepared system, optimized for its environment.

Since these VMs would be Production Servers, stability is a must, and honestly the available package management systems we're currently aware of just do not provide assurance. Zypp and Conary are the closest ones to our needs, but again still miss on some points.

pepoluan
  • 1,323
  • 1
    Exactly, what do you want in a package manager? That is, for your needs, what's the weaknesses of APT, Zypp, Conary, Yum...? – tshepang Mar 25 '11 at 09:33
  • 3
    Rather than explaining one-by-one, this is what we're after: (1) multiple level of 'stabilities' instead of simplistic "testing-vs-stable" (2) smart dependency solver (3) multi-versioning (in a limited sense, kind of like Gentoo Portage's SLOTs) (4) rollback (optional, due to snapshot ability of VM hypervisors, but still nice to have) – pepoluan Mar 25 '11 at 10:47
  • 1
    Can you explain what multiple levels of stability means? – tshepang Mar 25 '11 at 10:58
  • 2
    Is aptitude's dependency solver advanced enough? – tshepang Mar 25 '11 at 10:59
  • 10
    Every requirement you have set, is fulfilled by simply choosing an existing distro and creating your own repository (with maybe an alternative package manager) with your own defined release cycle. But you have rejected that option and also rejected the LFS option. Also, you mistakenly take the package manager as the critical stability factor, which is just a helper tool that by itself has little to do with overall system stability. – forcefsck Mar 25 '11 at 11:09
  • @Tshepang let's say there's a package "A". the version that had been accepted as really stable is version 1.7.11. However, since 1.7.11, the maintainer has released versions 1.7.12 through 1.7.18. The last two are known to be buggy (.17 and .18). Others said that .16 is quite stable for them. Others recommend to stay with .11, or use any version between .12 to .15. So, with "SL0" as the least stable, .18 would be SL0, .17 maybe SL1, .16 is SL5, .15 SL10, .14 SL11, and so on. – pepoluan Mar 25 '11 at 11:36
  • 1
    @forcefsck well, we don't reject the option of basing on an existing distro outright. we just feel that existing distros do not quite fulfill our needs in a simple way. that's why I am asking the question. i'll add another comment re: LFS below. – pepoluan Mar 25 '11 at 11:38
  • @pepoluan That's why we have multiple repositories. It's the role of the packager to determine to which repository will he put the package. – Šimon Tóth Mar 25 '11 at 11:42
  • @pepoluan: But you can use apt pinning for that, or am missing anything? You can also put packages on hold. I do that with one specific package, where later versions had some regression. – tshepang Mar 25 '11 at 11:43
  • Forget apt, simply use a RPM distribution. If someone wants a stable system he will simply use a stable repo, if he wants more current he can use testing, unstable, factory, devel repos. Where's the problem? And I'm talking about single packages from a specific repo. – Šimon Tóth Mar 25 '11 at 11:44
  • 1
    @Let_Me_Be: Why forget APT? – tshepang Mar 25 '11 at 12:15
  • 1
    When you end up doing this, please take some time to document what you did and how you did it. Despite all the distros out there, and Linux From Scratch, D.I.Y. Linux, etc, there's precious little about starting your own entire distro from scratch. –  Mar 25 '11 at 12:46
  • @Bruse sure I will. since this is a major project, we will document each step of the way and share it. – pepoluan Mar 25 '11 at 14:12
  • 1
    It might be worth talking to distribution developers. After all, they actually do this stuff. – Faheem Mitha May 20 '11 at 16:46
  • Flagging to close as too broad. – Ciro Santilli OurBigBook.com Oct 27 '15 at 05:08
  • Just use one of the common distros (debian, centos, etc) and create your own extra repository for extra, updated, and custom-compiled packages. also create a dummy package that depends on all of the packages that your "distro" needs in its base (or in debian, create a "task" for tasksel). this dummy package can then script any required changes to config files (either directly with sed, perl etc or by installing rules for puppet or ansible etc). This will allow you to focus on your specific needs without wasting a lot of time re-inventing a wheel that's already been invented 1000 times – cas Oct 27 '15 at 07:51

5 Answers5

21

You might want to look at Linux From Scratch:

Linux From Scratch (LFS) is a project that provides you with step-by-step instructions for building your own customized Linux system entirely from source.

Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233
tommytom
  • 219
  • Almost, but not quite. That's more like making a custom Linux for one's own need. But my community would like a whole framework, e.g., custom kernels, custom init, custom package management, etc. How do we start? – pepoluan Mar 25 '11 at 09:02
  • 5
    Starting with LFS and building a whole framework on top of it, as described by you, is actually a definition of "Starting your own linux distro". – forcefsck Mar 25 '11 at 11:23
  • I may have misconstrued what I meant. My bad. What I meant was: LFS is a good guide to start a new distro, but that's it. No guide on building the rest of the distro framework on top... uh, am I clearer this time around? – pepoluan Mar 25 '11 at 11:41
  • 2
    @pepoluan: there is no guide on that. Once you have a running shell and core utils installed, you have an operating system. For the rest you either do copy from other distros or reinvent everything. Either way, creating a new distro requires a lot of work and there aren't any easy answers on how to do it. – forcefsck Mar 25 '11 at 12:12
  • 1
    @forcefsck thanks for the warning :) ... I agree, it will undoubtedly be a major undertaking. too bad there are no 'war stories' or somesuch, just to not repeat any mistakes. – pepoluan Mar 25 '11 at 14:11
  • 2
    @pepoluan I would bet there's war stories, just not so cleanly-packaged. For example, have a look at archives of mailing lists in the early days of various distros. – tshepang May 29 '12 at 19:30
9

You will need a minimal running system, likely from another distro, to "bootstrap" your own distro with enough to at least get gcc or another C compiler running. You then need to start by deciding what core libraries (including libc) and software comprises the base, "no-packages-installed" state of your system. Then, get the source to these libraries and software and compile them, make sure all the software can find the libraries it needs, and start creating your low-level base environment.

Basically your bootstrap environment will be nothing more than a running kernel and the absolute minimum you need to get a basic shell, a C compiler, and basic things like rm, cp, tar and stuff like that working. The next thing you should get up and running after that is Perl. Once you have your base system created, you need to persist it and create some boot scripts that takes the system from initial boot to a useable shell with a compiler.

Then you need to design/write a package system and format, and download the source code to the software you want to package, compile and package it, and design a robust distribution system for your packages. None of this is trivial. Good luck.

LawrenceC
  • 10,992
  • Ahh, very informative, thanks! Yeah, I have no illusion that this would be a simple endeavour. Lucky I'm not alone. I'll gather the community and we'll bicker on who will do what :) – pepoluan Mar 25 '11 at 18:09
0

If you just want some set of default applications, you can customize an existing distro like ubuntu using some simple tools. http://maketecheasier.com/reconstructor-creating-your-own-ubuntu-distribution/2008/07/05

balki
  • 4,407
  • Mmm... not really. You see, I'm part of a community of users whose needs are not really met by any existing distro, especially in regard to the kernel config and package management. We are all quite familiar with Linux, and have enough free time to try to make a distro of our own. – pepoluan Mar 25 '11 at 09:01
0

You didn't really specify what you want from the package manager.

But OpenSuse provides build service where you can easily customize any package (including the kernel) and even create a whole distribution.

http://en.opensuse.org/Portal:KIWI

https://build.opensuse.org

Šimon Tóth
  • 8,238
-1

There is site which you can see all distro and simple description and overview of them there. So it help you to choose the best one:

http://distrowatch.com/

But for starting i suggest you to use Ubuntu or Kubuntu. so easy and user friendly.

shgnInc
  • 728
  • 7
  • 13
  • ubunut and kubuntu when aking for optimize virtual machine environnement very stable is definitly not a good idea, though wathing at distro watch is. – Kiwy Dec 16 '13 at 09:46
  • I suggest it just for giving him a start point to get more familiar with them. – shgnInc Dec 16 '13 at 16:37