Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
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.
Very tiny distros typically use different software. For example they use busybox instead of coreutils and something like uclibc instead of glibc.
LFS used to provide very much the sort of system you have in mind, but that's no longer possible. Keep in mind the fact that LFS doesn't just provide a barebones runnable system; it also necessarily has to provide the tools for building everything else that you need. Modern build methods are much more complex than the old ones; for example a lot of builds now use meson/ninja rather then autotools, which means that you need Python3. Modern graphical software has a lot more dependencies too.
That's why I don't use LFS nowadays. The fun's gone out of it.
You can compare the amount of packages on older LFS against newer versions.
Meson and ninja speed up the compilation of many packages you might need for a complete desktop.
You could build something like LFS-7.3 and upgrade gcc to 6.X and it still builds most stuff you might need and can be a base for a more recent LFS.
I have a lfs-6.8 aboriginal bootstrap I used to build lfs-7.3 with and upgraded it, my more recent builds are build on those or from their offsprings.
Once your system works, you only just began!
Just build a recent LFS and add what you need from BLFS, dependencies are listed in BLFS. If for some reason you find it to be bloated, do some research.
Just build a recent LFS and add what you need from BLFS, dependencies are listed in BLFS. If for some reason you find it to be bloated, do some research.
I saw two things: You want a system with only CLI and you want to avoid "bloat".
First. If you only want a cli system you can try out "busybox" which is a very small set of utilities for a functional system. Apart from that you will two other things: a linux kernel and a very small script file for booting the system. Those are three components that you need for your system. By creating a custom busybox, linux kernel and init script you should be very close to a few MB. I made one system like that and it weights less than 20MB.
Second. Even though the term "bloat" is objective, since it is considered to be "unnecessary software", what a user may consider so is not consistent across the users. You will need to find out what "bloat" is for you because if you would have already known what it is for you you would have already avoided it.
... And just as an extra: You can create such small system using LFS, but you need to know what software you need. In other words, read the LFS book and see what you need. At least a c library (glibc), a linux kernel, a compiler, and a set of utilities to control the system functions (util-linux, coreutils, etc).
If you want really small space, don't use glibc. It's quite large and there are some less well-known alternatives. I think Debian use uclibc on their initrd images.
@slac, you got that right. Since I am just starting out on LFS, I am presuming that I will be able to build a system which will be as trimmed down as it can be.
There are many ways you can create a system. Shared, static or hybrid. In the case of the default LFS system it has mostly built programs with shared libraries, that is the reason why you need a c library to compile the programs against. As another user already told you can, you can avoid glibc which is pretty big for other (uclibc).
By the way, it all comes down to how you plan to maintain your system. If you plan to maintain your system from within the system itself you will end up having the entire packages set from the LFS, that is the minimum for building most of the packages. It is not bloated, it is fairly well made for most of the cases. Just take a look at gcc if you plan to build software from such system, I think that is the biggest package from the LFS book.
If you create your system from another system (or toolchain) then I think you will do better.
The link that you shared is good, there are things there that I did not follow to create my system because they were not needed at all. But it is a good start, I can say that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.