Hacker News new | ask | show | jobs
by sanirank 1709 days ago
I don’t know why but I find this so interesting. I totally don’t have time right now (with a young kid and trying to make some/any progress in my career as a dev now that I’ve successfully made the career change to working as a developer), but I really just like understanding how things work from the ground up - I can’t wait to have the time to build my own Linux distribution. It feels like it’ll be such a waste of time - like installing 5 or 6 different distros on an old PC I had just out of curiosity to see what they looked snd felt like. And I broke and fixed the boot loader so many times that it became kind of an enjoyable challenge getting the machine to work again - “ok, now how did I get grub2 to recognise where my partitions are…?” It seemed like spinning my wheels but I just really enjoyed it. I don’t know why. Kind of reminds me of a comment someone made here on HN about Linux a while ago - something to the effect of “I want an OS I do t want a hobby.” Except I enjoy messing around with it and spending time making it work. Not very productive though I admit.
6 comments

I tried LFS a long time ago, and frankly I don't consider it much of an educational experience --- downloading, compiling, and installing a bunch of stuff repeatedly with small variations of the same commands just doesn't make you learn much.

On the other hand, I recommend trying to make a minimal system with only a kernel and shell and then add to it as desired. That way you'll really get an idea of what's needed to do what (and realise how bloated common distros are).

A long time ago, I went through "DOS from scratch" and "Windows from scratch" in a similar fashion.

If you follow the guide step-by-step, like an interpreter evaluating an LFS build script, you’ll probably not get much out of LFS.

LFS, KISS and, most recently FreeBSD were extremely educational for me. They showed me what each piece of my system was for, where to look when things went wrong, where to look when I wanted to tweak something, etc.

For a modern Linux installer, liked Debian or Ubuntu, I feel like I’m looking off a cliff face into an abyss. They say it’s “free as in freedom” - and I know it’s technically true - but I don’t feel like I’m equipped to understand the system the installer produced without a decade investment of time. The way I’d interact with those systems was a lot like “free as in free beer” - I knew I _could_ fix it if something didn’t work quite right, but frankly I didn’t know _how_ to fix it or where to start. So I just consumed it like I would proprietary software; it was a big black box I never looked inside.

On KISS, I ported the base system to a raspberry PI as my first task - the system was simple enough that I could just tackle that out the gate.

For LFS I had a lightbulb moment - understanding what all those packages that scrolled by in an “apt” install were about, how they fit together, and why a distro needed “patches.” It taught me what a distribution _was_ and the work that went into building and maintaining one. It taught me what the “base system” ecosystem consisted of.

With FreeBSD ports, by day 3, I was floating my own patch on top of my window manager because the config file didn’t have a setting I wanted.

As a sibling said, you get out what you put in.

For a modern Linux installer, liked Debian or Ubuntu, I feel like I’m looking off a cliff face into an abyss. They say it’s “free as in freedom” - and I know it’s technically true - but I don’t feel like I’m equipped to understand the system the installer produced without a decade investment of time. The way I’d interact with those systems was a lot like “free as in free beer” - I knew I _could_ fix it if something didn’t work quite right, but frankly I didn’t know _how_ to fix it or where to start. So I just consumed it like I would proprietary software; it was a big black box I never looked inside.

I often feel that way about FOSS in general. The freedom is more 'theoretical' than practical, although FOSS means that such software are much less hostile to users.

I appreciate repairable laptops and electronics more than I appreciate software freedom. The freedom felt more real.

You can approach software repair in a similar way to electronics repair, except you don't need to replace components, just fix them. Investigate which component is causing the issue, investigate which part of the component is causing the issue, modify/rebuild/reinstall the component, verify that the fix worked, done.
I had the same experience with LFS, seeing under the hood and putting it into practice gave me a deeper appreciation and understanding of what's going on. Plus I got to put it into practical use when I had to chroot into a borked Ubuntu install to install the proprietary nvidia driver that for whatever reason didn't get installed in the normal process (but the live environment automatically loaded it no problem).
Strangely my last moment of shock is not trying bare metal linux, beneater 6502, z80 Pcm not to mention Hercules ibm …etc as there are still too many components. As said of it does not work not sure I know how to try. Even fixing grub2 does not help.

But recently I found I am using boot camp and that blow hot air around you forced me to find a solution. On macOS side I pay for a patch … totally expect to pay but then it is just one setting (no 100% cpu max 99%, but not help much) and then a setting patch on not using turbo. That is it. It is a shock. Can you just manipulate all these without programming? And without payment? Just tinker a bit and take the risk to do a windows registry setting …

As open source has indicated, you can learn from both and try to mix them. And as free as liberty, non free beer can still carry some message.

You get out of it what you put into it. Don't just follow the instructions, find out what everything is and what it does, why the instructions are what they are and why they are in the order they are. Maybe learn make and autotools. And for the person with way too much time on their hands, read the manual for each. For the retired or student on break, read some of the source code.
If you're a programmer, getting a simple C++ or Rust "init system" working is a great exercise to understand how a Linux system works. Just a kernel image, your C++/Rust init program, and maybe busybox so you have a shell.
Every time I've think about doing LFS, I come to the same conclusion that Arch is probably good enough to get the same hands-on understanding but without having to do the menial work.
For a great low-commitment experiment with minimalistic Linix, I'd recommend setting up PRoot with Termux on Android and then adding Arch repositories. You can treat it like a replacement for a mobile game and slowly build up your perfect mobile desktop environment.

https://wiki.termux.com/wiki/PRoot

For me it was Slackware.
Slackware was my first love, but the reason I say Arch is because there's no package management

... though these days, Nix on top of Slackware may be interesting

I find Slackware easier to install.

There is slackpkg for package management, and sbopkg for “ports.” (What is “missing” is dependency management, which often turns out to be a blessing.)

(pkgsrc also supports Slackware.)

I remember some ~20 years ago, only going thru their HOWTO was very revealing about the system innards and I remember having a blast. I never went trough a real LFS install because I lacked an extra box at the time, but it is something the lingered on the back of my head since.
> I don’t know why but I find this so interesting

> Not very productive though I admit.

It's called "scratching an itch". You've no idea why you've got that itch, but it sure is satisfying giving it a good scratch.

But what seems like, for the present, idle fiddling about, sticks in your memory and one day in the future some problem (or interview question) will rear it's head and you'll thank yourself for just messing around. Treat it as a positive trait.

I have alway preferred syslinux over grub/grub2.

I am not really into chainloading or booting from different partitions. Keep it as simple as possible. KIASAP.

I want an OS I control. If that requires time, a one-time sunk cost to learn how to do something, like sports/hobbies require, it is worth it.

> I totally don’t have time right now

It takes too much time for compiling. Some packages compiled overnight on my machine. Now I thank my distribution, that they precompile these packages for me :)

I’ve done LFS, and I recommend it, but another approach is to read the script for the basic Alpine installer and then work through it to build a system.