5 ms·
I attempted this a few months ago. I'm comfortable around the Linux CLI and can happily edit files in Nano (or Vim if need be). I wanted to do this to improvide
by Jaruzel 10y ago
I attempted this a few months ago. I'm comfortable around the Linux CLI and can happily edit files in Nano (or Vim if need be). I wanted to do this to improvide my knowledge of the inner workings of Linux.
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.
- deleted 10y ago[deleted]
- i336_ 10y agoWhat would be nice is if the LFS server cached copies of all of the packages it references.
- dTal 10y agoThat would be very nice and reliable! For extra reliability we could wrap the installation instructions into scripts (to save people from making typing mistakes) and provide them as part of the package download. Ideally the scripts would be able to handle deinstallation too, in case people want to experiment with newer components. And it would be good to provide some convenient central user interface for atomically managing which packages are installed - a "package manager", if you will...
- i336_ 10y agoHmm. That sounds sort of like https://buildroot.org/ 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
- voltagex_ 10y agoBuildroot is fantastic - I've used it to build single-purpose VMs before. I suppose it could also be used to build really small Docker rootfs tarballs, too.
- hyperpape 10y agoI think there is a difference in kind between "do these steps manually to understand them" and "hunt down these versions of packages on various websites around the net". It's true that you might learn something from doing the latter, but it's different from what you'd learn doing the former. 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.
- digi_owl 10y agoApparently they do. http://www.linuxfromscratch.org/lfs/download.html#ftp http://www.linuxfromscratch.org/lfs/download.html#ftp
- i336_ 10y agoOh, that's awesome. I had absolutely no idea. This project certainly has been well thought through. Looking forward to figuring it out :D
- barrkel 10y agoThat's unfortunate; but on the other hand, I'd guess that 99% of LFS installations are abandoned sooner or later. 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.
- bogomipz 10y agoBut the stated intention of LFS is that it is a step by step guide to building a distro and as such is should be accurate: "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."
- digi_owl 10y agoIt is the intention, but the number of moving parts vs manpower available likely makes it hard to deliver on.
- wolfgke 10y agoWhy not simply tell which specific versions are tested to work and/or build a testsuite that tests new source code versions automatically (while executing exactly the instructions in the LFS tutorial).
- digi_owl 10y agoWell there is ALFS, but i'm not sure if that is exactly what you are talking about. http://www.linuxfromscratch.org/alfs/ http://www.linuxfromscratch.org/alfs/
- pthreads 10y agoI was about to attempt this as well but I am glad I read your post first. Which version of LFS did you follow. There seem to be 3 -- current, stable and systemd? Thanks.
- Lapsa 10y agosame here. such a shame might read through though setting up arch really did learn me few tricks - i find LFS similarly beneficial
- exDM69 10y ago> 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. 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.
- digi_owl 10y agoYeah. Consider that recent version of LFS use eudev for their non-systemd variant, because it became too much of a hassle to extract udev from systemd on each release.
- open-source-ux 10y agoLinux Voice magazine have a lengthy feature on creating your own distro; it's dated April 2015: https://www.linuxvoice.com/build-your-own-linux-distro/ https://www.linuxvoice.com/build-your-own-linux-distro/
- kr7 10y agoI did it a few years ago. I got a working system but it wasn't easy. 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.
- jguegant 10y agoAt a higher level, one could use Gentoo to learn a lot about Linux internals with at least up-to-date packages and a "usable" distribution. One can experiment alot with Arch Linux too, if compiling is a burden.
- GauntletWizard 10y agoThere's only so far Gentoo goes. I ran Gentoo for years, and learned a lot, but eventually stopped learning more about Linux and was only leaning about Gentoo's weird structure. That said, it's a great intro, and will teach you a lot of the prerequisites to getting LFS working.
- digi_owl 10y agoHave had a similar experience using Gobolinux for a few years now.
- jguegant 10y agoAt a higher level, one could use Gentoo to learn a lot about Linux internals with at least up-to-date packages and a "usable" distribution. One can experiment alot with Arch Linux also, if compiling is a burden.
- voltagex_ 10y agoDo they make it easy to submit bug reports?
- digi_owl 10y agoWell there is a "report a bug" link right on the front page. But that just takes you to the trac front page.
- unethical_ban 10y ago>but if you are going to present a tutorial on anything that depends on external resources, 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.
- Thoreandan 10y agoNot sure when you tried it - but my attempt ~4mo ago starting from debian stable worked as per the instructions - and there are at least 3 mirror sites that keep all the required packages listed ... See the bottom section of the page http://www.linuxfromscratch.org/lfs/download.html#ftp http://www.linuxfromscratch.org/lfs/download.html#ftp
- nomoch 10y agoThere's a tarball with all the source files you need for each distribution. Trying to download them individually is ... difficult to say the least.