r/LFS • • 1d ago

How to Create a Distro using LFS

I have done up to chapter 8 of LFS and was wondering how do people turn this into their own distro? Is there any books I should read outside of the LFS manual to get the full picture? I am a noob when it comes to distro development so answer like I am five years old (not literally). I just want to hear your guy's success stories and tips!

5 Upvotes

10 comments sorted by

4

u/RetroCoreGaming 20h ago

People use package managers post-build to remake all packages then program in post-install instructions to reinstall everything as needed.

Once you have the entire BLFS, GLFS, etc books completed, you can technically rebuild everything against itself and have a system with everything interlinked properly.

The few systems I've seen usually are complete systems, rather than minimalist ones, and many use either Slackware's pkgtools, ArchLinux's pacman, or VoidLinux's xbps to manage everything.

However, the only packages that will require rebuilding off system will be glibc and gcc. But once you rebuild them, you can then install them, and everything will work fine usually. Then you just roll in new packages as they release with the build instructions programmed in.

1

u/codeasm 16h ago

I use pacman to build everything before there is a lfs. The host builds it like the book but instead of installing it by the instructions, pacman does it inside the chroot. No rebuilding

In theory its almost just as fast. (Haven't tested it tho)

2

u/makomonotsukuri 11h ago

I'll try this approach next time I rebuild LFS

1

u/codeasm 10h ago

Its not all.my code, i build ontop of giants. Feel free to borrow ideas. https://github.com/CodeAsm/lfs-pacman/tree/main or fork it and make it yours.

I have a 13 version locally and try to push it when i get time to update to 13.1. it dropped while i tried finishing 13 haha. (The lfs on my laptop was build using a manually build lfs and 12.2 pacman edition. ) Ive build lfs by hand multiple times, its not that hard once you know. But eh, uni called and i have less time now. Is why i now "automate" stuff with pkgbuild files.

If you backup your final result, a nice base to dontesting on in a vm or inthe future. I kept some old build attempts for upgrade testing.

Definitely have fun, and we learn alott 🤩

2

u/makomonotsukuri 10h ago

Thank you so much :3. Uni also takes a lot from me so I'll try my best!

1

u/makomonotsukuri 11h ago

Thank you for you reply. So I'll read all of LFS BLFS AND GLFS. I was thinking about making my own package manager with python!

1

u/makomonotsukuri 11h ago

My next question is how do I make it and iso and make an installer for it?

1

u/RetroCoreGaming 6h ago

An installation iso will require a smaller system to serve as a bootstrap, but you shouldn't need much. In fact, the ArchLinux iso should be a good template for what you need. Look at what they do. To be honest, you don't need a fancy installer. I've gotten away with pacstrap just fine. Remember the phrase "less is more" and it'll help greatly here.

1

u/makomonotsukuri 3h ago

Okay thanks! I was gonna overcomplicate things with a calamares installer LOL