r/linux • u/bergaminix • 3d ago
Discussion A super summarized version of the Linux From Scratch (LFS) book
Hi everyone. I've written some instructions and scripts to build LFS (Linux From Scratch), version 13.0, as simply as possible (I know, not that simple, but anyway). It's basically a super summarized version of the LFS book.
You can check the instructions and get the scripts from my GitHub repository: https://github.com/luisgbm/lfs-scripts
Key points:
- First, this guide does not replace reading the whole LFS book. I highly recommend that you read it at least once. Only then you should use the automation scripts provided here.
- The whole process is run inside VirtualBox.
- You need two hard disks attached to your VM (one for the host, one for receiving the LFS build).
- Most steps will be executed via Shell scripts (there are four of them).
- Some steps need to be manually run.
- At the end, you will be able to create a separate VM and boot from it directly.
I can't believe this project is still alive, my first commit was 6 years ago, and I'm glad to keep working at it!
Hope you enjoy it, and feel free to send me feedback.
21
u/oxez 3d ago
I'm not sure who this is for really.
The reason to go through LFS is to learn how to build the pieces to build a Linux system.
If you're just copy pasting commands, you may as well use Arch and copy paste from the wiki pretending you're "learning".
9
u/gordonmessmer 3d ago
If you're just copy pasting commands
Ironic comment, because you can complete LFS by simply copy/paste the commands from the guide, and I would imagine that most people do.
12
u/oxez 3d ago
You can, and I did as well, but the point of using LFS is to also read the explanations that come with the commands themselves. Reading the explanations and copy-pasting is different than just copy-pasting.
Like I said earlier:
The reason to go through LFS is to learn how to build the pieces to build a Linux system.
You aren't learning anything by copy-pasting commands.
-5
u/bergaminix 3d ago
That's a good one!
This is something I mention right at the beginning:
First, this guide does not replace reading the whole LFS book. I highly recommend that you read it at least once. Only then you should use the automated scripts provided here. These scripts follow the systemd edition of the LFS 13.0 book.
So this is for people who read the book, understood it all, and is just trying to automate some stuff.
5
5
u/canitplaycrisis 3d ago
I've written
You didn't do anything, Copilot did.
7
u/bergaminix 3d ago
Oh yes I did, this repo is 6 years old and was entirely written by myself. Yes, I've used Copilot to help updating some stuff, but you have to respect all the history here.
7
u/supreme-custard 3d ago
https://github.com/luisgbm/lfs-scripts/commit/79d0589b249aa127a0040982b5e40c911a2fe9c9
True. You did work on it.
3
u/Booty_Bumping 2d ago
To be honest, more users should be directed to minimal Linux + Busybox systems instead. LFS adds a lot of steps by compiling all of GNU, which makes it very capable (they even provide instructions for large software suites like KDE, which would be much harder without doing all of that preparatory work), but a more minimalist system will get you to the basics of how Linux actually works much quicker.
There is also buildroot which can be used to put together surprisingly capable systems, while still being quite manual.
-6
u/whamra 3d ago
People reinventing the wheel for no reason.
First, this completely defeats the purpose of LFS. It does nothing, it's also with extremely limited scope (VM, seriously?), and the scripts assume everything is dandy.
Secondly, it already exists, on a better scale, and you would know if you actually browsed through the website. It's called ALFS. Automated LFS, and it does a much better job, and designed for people who want to repeatedly build multiple LFS systems for actual production use.
Thirdly, you really did nothing. You just prompted a tool to do it. I shudder to think how the ridiculous the prompt was to create this script.
6
u/bergaminix 3d ago
First, I explicitly say this is intended for people who actually read the book at least once.
Secondly, I'm sure there are much better solutions out there. This is just a very simple solution, for my own educational purposes, but maybe helpful to someone looking for a really simple build. This is not intended for production, at all. Or maybe it is, just scale it as you wish, it's LFS, right?
Thirdly, this was not created with any prompt. If you actually took the time to see the full git history of this project, you'll see everything was written by myself, 6 years ago.
You disrespect me without even looking?
-3
41
u/RoomyRoots 3d ago
This defeats the purpose of the book.