Live data from Hacker News

I Built Linux from Scratch

thesloth.me

1–10 of 105 posts

Re: I Built Linux from Scratch

#2
I highly recommend building an LFS. It was one of my first big personal endeavors with computers. In the article, the author says they didn't learn stuff that'll _necessarily help them in their day-to-day_, which I can echo, but I definitely learned a lot about different commands, the file structure of linux, `hier`, changing root, cross-compiling, toolchain building... it's really an awesome and fun process, and is especially satisfying when you manage to boot into it for the first time. I will say I'm much less fearful of the GRUB CLI than I used to be ;)

Re: I Built Linux from Scratch

#3

I highly recommend building an LFS. It was one of my first big personal endeavors with computers. In the article, the author says they didn't learn stuff that'll _necessarily help them in their day-to-day_, which I can echo, but I definitely learned a lot about different commands, the file structure of linux, `hier`, changing root, cross-compiling, toolchain building... it's really an awesome and fun process, and is…

Yeah i totally agree with your comment. Just to clarify for anyone reading this - it was not my intention to downgrade the value of building an LFS, but rather i wanted to set a realistic expectations on what you can expect to learn, so that you don't do it for the wrong reasons.

Re: I Built Linux from Scratch

#4
I wrote this a few years ago, when LFS made the front page:

I had a lot of fun doing this. You really get a feel for the evolution of build systems -- from older software that uses automake/make to newer programs that use meson/ninja/cmake etc. It was also cool to learn how to bootstrap a bespoke set of development tools tuned for your hardware.

It took me a solid weekend to get everything built. I was able to get a basic LFS system built on a Saturday, and on Sunday I did the "Beyond Linux From Scratch" edition. At one point I got stuck trying to debug a weird interaction between systemd and PAM that took me a while to unravel. That was humbling, I thought I knew just about everything about Linux, but turns out there are large areas where I just don't have a clue.

The docs are well written and maintained, so there wasn't a lot of frustration there. Even if you're not an old hand at Linux you can likely get pretty far by just diligently following the instructions.

I struggled a lot more trying to make a decent desktop environment than I did getting the OS setup. I spent so much time trying to get a nice-looking toolbar (polybar) and basic stuff (like how patched fonts work) took me an embarrasingly long time to sort out. I also didn't know what a compositor was, or why you might want one. I enjoyed figuring out the basics of compton, which allowed me to get cool transparent backgrounds on windows[0], although I never did quite figure out how to get rounded corners.

[0]: https://muppetlabs.com/~mikeh/spudlyo.png

Re: I Built Linux from Scratch

#5
For something that's more of a prepackaged build-your-own-Linux kit, there's also KISS Linux[0]. It's kind of a microdistro with minimal abstraction over the raw guts, and "packages" are just pre-downloaded source code repos that you compile yourself.

The "package manager" is just a shell script. The installation process[1] is entirely manual, so you control every step as you bootstrap up to building your own kernel and installing each subsystem, all the way up to compiling and running Firefox. It's pretty neat.

[0] https://kisslinux.org/

[1] https://kisslinux.org/install

Re: I Built Linux from Scratch

#6
If you need something more practical, but still challenging, try Slackware.

Use the advanced install feature and only select the packages you need. Build the other software yourself. You can choose your own difficulty this way. You can also follow the distro's way of packaging up software (build scripts), or build it the software developer's way. The main advantages of building software yourself are:

1. You are a developer who wants to customize the software.

2. You want to practice.

3. You want to contribute to a project.

4. You want to have a better understanding of what the code does.

Slackware 15 is a modern platform to build upon.

Re: I Built Linux from Scratch

#7
I built LFS like back in 2005 or something. I remember it took forever. I wonder if it's faster or slower now. My computer is definitely faster, but I also have a creeping suspicion the code has gotten a lot bigger. Then at some point I switched to gentoo. I remember I vacillated between gentoo and slackware. The important thing was that I had an onion on my belt, which was the style at the time.

Re: I Built Linux from Scratch

#8
I did this back in highschool (so 1ate 90s). It was a really fun experience but I don't think I learned as much as I had hoped. I learned a lot about bootstrapping a system but not how to maintain it. It turns out package managers are really important for that.

I ended up using the system for a few months until it collected enough cruft that I started over with some other distro.

Re: I Built Linux from Scratch

#9
Some 20 years ago I went and built "Linux From Scratch". I think this (among other similar exercises I did) enables me to find my way pretty quickly around any new or old tech thrown my way.

I highly recommend this to anyone interested in 'computers'.

Re: I Built Linux from Scratch

#10

If you need something more practical, but still challenging, try Slackware. Use the advanced install feature and only select the packages you need. Build the other software yourself. You can choose your own difficulty this way. You can also follow the distro's way of packaging up software (build scripts), or build it the software developer's way. The main advantages of building software yourself are: 1. You are a dev…

I haven't run Slackware for maybe 20 years, but I remember running 7.2 at uni and recall really _enjoying_ building everything and having that level of control. It taught me so much about how Linux works. Conversely, I remember finding my initial experiences with dpkg and rpm quite frustrating in comparison.
Post reply on HN