LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-27-2015, 04:43 AM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334

Rep: Reputation: 54
Making a Linux distro


I'd like to learn how to make a Linux distro, either by taking an existing one and modifying it, or taking the very bare minimum stuff, the kernel and building it myself. I mostly want to do it as a learning experience, but depending how far I get with it, maybe even make it into something I could use. It would mostly be geared towards being a server oriented distro. Something turn key with a very simplified interface for managing it.

I read through the Linux from Scratch book a while back, so I imagine that is a good start. Wondering what else I can read as well. For example LFS does not really go into what it takes to make an actual Linux installer for your custom distro, so that's something that would be good to know too.

For example, how does the ifconfig tool get it's info, that's the kind of stuff I want to learn. The really deep back end stuff.
 
Old 09-27-2015, 06:13 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,
If you worked your way tru LFS you'd have a solid base to build on...
I did that once, I started from a host OS (Knoppix) an let that run a download script...
The script took some base parameters from the user (a bit the way the CLI installer for Manjaro works) and went to do the partitioning, the download, unpack, compile and make-install to the prepared hard drive...
More urgent stuff prevented me from venturing further, but...as far as I can see..it was viable...
Of course, you end up with a system that has been compiled from scratch for you...
Good luck...
Thor
 
Old 09-27-2015, 07:13 AM   #3
oldtechaa
Member
 
Registered: May 2015
Location: US
Distribution: Fedora
Posts: 364

Rep: Reputation: 83
You could try something like Slackware or Debian, already somewhat server-ready, and easily configurable, especially Slackware. I once tried recompiling everything native in Slackware, but I didn't have time for it.
 
Old 10-01-2015, 12:30 PM   #4
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by Red Squirrel View Post
I'd like to learn how to make a Linux distro, either by taking an existing one and modifying it, or taking the very bare minimum stuff, the kernel and building it myself. I mostly want to do it as a learning experience, but depending how far I get with it, maybe even make it into something I could use. It would mostly be geared towards being a server oriented distro. Something turn key with a very simplified interface for managing it.

I read through the Linux from Scratch book a while back, so I imagine that is a good start. Wondering what else I can read as well. For example LFS does not really go into what it takes to make an actual Linux installer for your custom distro, so that's something that would be good to know too.

For example, how does the ifconfig tool get it's info, that's the kind of stuff I want to learn. The really deep back end stuff.
LFS + pick a package management system + scripts + LiveCD how-to = custom distro installer.

Edit: Your "base" system would essentially be the base LFS you've built, minus a few packages. (compiler, etc.) Basically kernel, glibc+headers, binutils, coreutils, e2fsprogs, util-linux, bash, vim, etc. You can easily leave the build tools out if you're shipping binaries.

Last edited by Luridis; 10-01-2015 at 12:35 PM.
 
1 members found this post helpful.
Old 10-03-2015, 06:09 PM   #5
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334

Original Poster
Rep: Reputation: 54
Ahhh never thought of going the liveCD route, I imagine such how to would explain how to make an installer too. I'll start with actually doing LFS and go from there. I only read through it rather quick to get a general idea, so I'd want to go through it again as I proceed anyway.

Also how does it work for drivers, like idealy I'd want this distro to work with all hardware, like any other live CD. Guess that would probably be included in the instructions though.
 
Old 10-03-2015, 11:29 PM   #6
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by Red Squirrel View Post
Ahhh never thought of going the liveCD route, I imagine such how to would explain how to make an installer too. I'll start with actually doing LFS and go from there. I only read through it rather quick to get a general idea, so I'd want to go through it again as I proceed anyway.

Also how does it work for drivers, like idealy I'd want this distro to work with all hardware, like any other live CD. Guess that would probably be included in the instructions though.
What you're looking for to achieve maximum compatibility is a big-fatty kernel config. Most distributions have at least one and you can find the config file along side it in the boot directory. Just keep in mind it won't be the fastest thing around, especially if loading from isolinux.
 
Old 10-04-2015, 02:15 PM   #7
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
I don't think that the challenge resides in creating the distro itself (as starters, just copy any other existing distro and then start making changes to the package repository), but in creating the community that will then support the distro => if it's not just for yourself then the first step will be to define, publish and get the general acceptance for the unique commitments of your own distro.
 
1 members found this post helpful.
Old 10-04-2015, 02:25 PM   #8
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by Pearlseattle View Post
I don't think that the challenge resides in creating the distro itself (as starters, just copy any other existing distro and then start making changes to the package repository), but in creating the community that will then support the distro => if it's not just for yourself then the first step will be to define, publish and get the general acceptance for the unique commitments of your own distro.
Oh definitely, I think if I was to actually go through with it, it would more or less be for myself. I'd probably still make it available but would not expect it to get that popular. More or less I'd do this so I have a distro tailored to my exact needs, so I'm not doing repetitious stuff each time I setup a new server. But it's also mostly to learn, as for my own use I'm probably better off taking an existing distro and then making the changes and then repackaging it into an installer, which I have no clue how to do now but I'll want to learn in the process.
 
Old 10-04-2015, 02:49 PM   #9
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by Red Squirrel View Post
....More or less I'd do this so I have a distro tailored to my exact needs...
Mmmhh, for this you could just take the image of some base VM, and then duplicate & modify it whenever you want to try/use something.

Absolutely no problem with the learning-part, but on one side I'm not sure how much there is to learn about creating an own distro (will be the same as all other distros as long you don't start to write your own software) and on the other side I really really really think that this kind of project would need first of all an initial inspiration/concept/epiphany about what you want to change or be better.
Creating a new distribution should be your last extreme step after having tried everything else with existing ones (meaning from a point of view of getting involved in those distros).
Creating a distribution is probably not just about only creating it - it's as well about everything else, like supporting it, modifiying software to add your bugfixes and make it meet your needs, have a forum (and moderators) to listen to your users, etc... . A whole ecosystem (to use the word that was first pushed mainline by that pig of Stephan Flop of MS).
 
1 members found this post helpful.
Old 10-04-2015, 03:08 PM   #10
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334

Original Poster
Rep: Reputation: 54
I was thinking more along the lines of something very custom even the installer itself. Making a VM clone wont really work on different hardware, it will only be good for that particular VM environment. Basically I'd want something where I pop the CD/ISO/USB in either a VM or physical hardware, I'm prompted for a few basic things like IP address and hostname and maybe some other custom stuff, and it installs in a preset way including any custom programs. Each install would be 100 consistent. Though for this particular step I would probably take something like CentOS as it already has an established yum repository. But as a learning experience I might try it from scratch first just to see what's involved and get to know more of what goes into the installation and boot process of Linux, package managers etc.
 
Old 10-04-2015, 03:32 PM   #11
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Quote:
Making a VM clone wont really work on different hardware, it will only be good for that particular VM environment.
I don't think so.
The x64-packages that you're downloading today are compiled for most if not all x64 Intel processors and use a CPU feature only if it's available.
Therefore using a general VM for all Intel-x64-arch would work.
If you want to have executables you can use Gentoo and configure it to handle only a specific instruction set of a particular cpu, but usually the cons outnumber the pros so almost nobody does that (people like me still love it, but because of other reasons).

E.g. for PowerPC/Sparc and other archs you'll have to write for sure at least your own installers and create a separate software repository as their (architecture and) BIOS, GPUs, etc... are different (therefore making some SW incompatible on those architectures), therefore the installs cannot be 100% consistent.
 
Old 10-04-2015, 04:13 PM   #12
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
LFS users manage their own "distro" all of the time. In fact, this is how UNIX was traditionally done: compile, from scratch, bootstrapping a system.

My desktop is a Haswell, my laptop an Ivy Bridge. So, when I compile inside a VM on my desktop, I use the ivy bridge cpu flags "-march=core-avx-i" which is understood by both processors. I have two kernel configs, one for the laptop and one for vmware workstation. When I finish building I boot a live CD inside the VM, tar the system and copy it out to external drive. (sans /{home,root}) Take that to the laptop with a livecd, boot the cd, format and mount volumes, untar the system. Change some config files, swap out the vm kernel for the laptop one, grub-install and reboot.

As far as updates... Those are easy once the system is up. Check for updates from upstream on your packages. I keep a list, most updates aren't security so I skip them. If it is important, I simply download, make and install the package. Sometimes tweaks are necessary due to the rotting gnu userland, but you can usually find the relevant SED's from the current SVN on the BLFS website.

Remember heartbleed? I had that downloaded, built and patched 2 minutes after the fix was live.

Last edited by Luridis; 10-04-2015 at 04:14 PM.
 
Old 10-04-2015, 11:03 PM   #13
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by Pearlseattle View Post
I don't think so.
The x64-packages that you're downloading today are compiled for most if not all x64 Intel processors and use a CPU feature only if it's available.
Therefore using a general VM for all Intel-x64-arch would work.
If you want to have executables you can use Gentoo and configure it to handle only a specific instruction set of a particular cpu, but usually the cons outnumber the pros so almost nobody does that (people like me still love it, but because of other reasons).

E.g. for PowerPC/Sparc and other archs you'll have to write for sure at least your own installers and create a separate software repository as their (architecture and) BIOS, GPUs, etc... are different (therefore making some SW incompatible on those architectures), therefore the installs cannot be 100 consistent.
I don't think I've ever succeeded at transplanting an installation from one system to the other. Heck even going from physical to VM. Usually it wont boot. Probably because the proper drivers arn't loaded. So no, it's not plug and play like you think it is. There is probably some stuff that can be done to make it work but I've never figured out what... which is kinda the point of this exercise, I want to gain a better understanding of what goes on under the hood. Also it would be unrealistic to make an "installer" that is simply a VM image. It would be 10's of GB while an actual installer can probably be made to be under a gig depending on what packages I'd include. Source code takes less space than binaries. (well it compresses better, anyway)

Last edited by Red Squirrel; 10-04-2015 at 11:07 PM.
 
Old 10-04-2015, 11:25 PM   #14
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
Originally Posted by Red Squirrel View Post
Oh definitely, I think if I was to actually go through with it, it would more or less be for myself. I'd probably still make it available but would not expect it to get that popular. More or less I'd do this so I have a distro tailored to my exact needs, so I'm not doing repetitious stuff each time I setup a new server.
From what I see in your posts, what you actually want to do is customise a system to your preferences, not create a new distribution. I have never set up a server, but I do not see why there would be a need for customisation and concern for package management, since a server is a server, not a person computer or work station. I would want to install a base system, add the few things that may or may not be included, do the necessary configuration, then leave the server to do its job. Of course, the shallow depth of my knowledge concerning servers means the process may be more intricate than I imagine.
 
Old 10-04-2015, 11:50 PM   #15
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by Randicus Draco Albus View Post
From what I see in your posts, what you actually want to do is customise a system to your preferences, not create a new distribution. I have never set up a server, but I do not see why there would be a need for customisation and concern for package management, since a server is a server, not a person computer or work station. I would want to install a base system, add the few things that may or may not be included, do the necessary configuration, then leave the server to do its job. Of course, the shallow depth of my knowledge concerning servers means the process may be more intricate than I imagine.
Yeah I'd probably end up using an existing distro and just repackaging it (not sure how to do this yet) but I still want to do it from scratch just as a learning experience.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New to Linux *again* - I have some questions about making better distro installs micropup Linux - Newbie 6 05-20-2015 01:35 PM
What Is the Best Distro for making your own... knoppixguy Linux - General 6 04-15-2006 09:50 PM
making own distro ankscorek VectorLinux 2 09-06-2005 07:25 AM
Making your own Linux distro Cron Linux - Distributions 2 12-03-2004 08:22 AM
a thanks, and about making my own distro mr0w1 Linux - Software 4 01-21-2004 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration