by Jaruzel · 10y ago · 0 comments
What I found out was, the LFS instructions are out of date, or in places simply wrong. A lot of the linked-to packages simply no longer exist in the locations referenced, resulting in the user having to google the package names, and hope that the archives they find are complete and correct. As such, there are many false starts getting even the basics compiled, and that's before you even get to the chroot stage. After several hours of scouting around, and compiling the dependencies, I hit a fatal compiler problem with one of the correct packages which, not being a Linux guru, I couldn't solve. This left me with the only option of starting over, which I didn't do. If I had infinate free-time I would have kept working on it, but I don't, so the VM just sits on my server, abandoned.
I like the idea of LFS, but if you are going to present a tutorial on anything that depends on external resources, then that tutorial should be maintained so that as long as the end user follows the instructions, it will always work, all the time.
I might come back to it at some point, but not anytime soon.
LFS is pretty good at teaching you what a working Linux system is made out of. It's not a productive way of actually creating a useful Linux system; it's simply not practical to select and compile all your dependencies from source without automation. But the lack of automation is exactly what makes it pedagogical.
As such, it's not wholly clear to me that you need to go through the steps. But performing them certainly makes the experience more visceral, and fixing minor issues along the way (if you can) improves your confidence installing software from tarballs when they're not available or are out of date in your distro's repository.
"Welcome to Linux From Scratch!
Linux From Scratch (LFS) is a project that provides you with step-by-step instructions for building your own custom Linux system, entirely from source code."
Some packages were missing but that's not really LFS's fault if upstream doesn't keep old source tarballs around. I was able to find everything by searching for the MD5 sum though.
The hardest part was the kernel configuration. LFS doesn't really give any instructions for it - you need to figure it out on your own. It took lots of trial and error to get all hardware working. If I remember correctly my network card's driver was out-of-kernel and I had to compile it separately.
It also takes a really long time to compile everything. Unix is supposed to be simple but GNU's Not Unix.
This is a pretty tall order for a niche project like LFS, which is most likely maintained by a bunch of guys on their free time. You really can't expect them to be able to keep it up to date all the time.
Fwiw. it's not too difficult to build a small bootable linux distro, but it might be easier to use e.g. Musl+BusyBox rather than GNU userspace. I've put together a small bootable Linux from Git repos, it takes about a day or two to build binutils and GCC for cross compiling, then building kernel, libc, busybox and making an initrd image that boots.
See the bottom section of the page http://www.linuxfromscratch.org/lfs/download.html#ftp
Edit: a generic point that I'd make is that just because something is hard, and there's a reason it's hard, doesn't mean that it has to be hard in every possible way. This is another version of the distinction between accidental and intrinsic complexity.
That sounds sort of like https://buildroot.org/. It's a bit full-on, and definitely provides a superset of what you're describing, but sort of wanders in that general direction.
I think that LFS is intended for people who want to really understand how Linux works, so there's no automation, and the user is required to have a hand in every step of the process. I mean to follow up on LFS at some point, but to deal with the intricacy and fiddliness I'd go very slowly, and the process would probably take 3 or 4 months. But the finished system would be better configured than anything else I've ever set up... lol
It's useful to know about issues like this though, now I can prepare to expect that.
About versioning, that's difficult - since this is entirely manual, the instructions have to match up perfectly with what the software actually requires, or confusion will result.
As someone who used Slackware for a couple years, I definitely appreciate the ability to easily install new software. :D:D:D
might read through though
setting up arch really did learn me few tricks - i find LFS similarly beneficial
One can experiment alot with Arch Linux too, if compiling is a burden.
Pause. Perhaps that's the solution: LFS should host internal copies of all the required source for a target version, so the instructions can always be the same. Provide references for who and where the upstream maintainer is, so the intrepid hacker can find it themselves.