Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334
Rep:
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.
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
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.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
Quote:
Originally Posted by Red Squirrel
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.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334
Original Poster
Rep:
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.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
Quote:
Originally Posted by Red Squirrel
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.
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.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334
Original Poster
Rep:
Quote:
Originally Posted by Pearlseattle
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.
....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).
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334
Original Poster
Rep:
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.
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.
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616
Rep:
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.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334
Original Poster
Rep:
Quote:
Originally Posted by Pearlseattle
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.
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.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,334
Original Poster
Rep:
Quote:
Originally Posted by Randicus Draco Albus
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.