News for hackers. Stuff that matters.
Re:Linux from Scratch by sieste on Friday August 21, 2020 @03:55PM (#24238305)
I tried to go through this a few years ago. The time commitment is huge, especially if you really want to understand all steps in detail. In the end I lost interest because it turned into a mindless command-copying exercise for me. My only real take away was a much greater appreciation of the complexity of an operating system.

Has anyone followed this from start to finish and can now comfortably compile their own linux kernel from scratch?

Re:Linux from Scratch by barrkel on Friday August 21, 2020 @06:20PM (#24239475)
The point of doing it is to understand how Linux hangs together, to remove the mystery in the wiring.

I don't think it's worth pursuing to a GUI, unless you have a burning desire to customize or fix brokenness in that experience you've had on other Linuxes.

The point is definitely not to continuously manage your own distro you built from scratch, unless that's your job or hobby.

I use the knowledge I gained from the experience to debug many random instances of brokenness on Linux, both personally and professionally. It also made compiling from source a fairly comfy option when necessary (e.g. you need to fork, or backport a piece of software).

Re:Linux from Scratch by troutwine on Friday August 21, 2020 @04:11PM (#24238429)
I did as a teenager, probably close to 16 years ago. The process was glacial because I lived in a rural area with rudimentary internet access. Figure from start to finish it took me a year? Gave me a lot of time to consider the different pieces of software being compiled, which I probably would not have done with a fast internet connection. Really helped jump start my interest in systems programming and is surely one of the experiences that pushed me toward the career I have now.

I still feel pretty comfortable in compiling a linux from source. Userland specialization is also a neat topic.

Re:Linux from Scratch by bcrl on Friday August 21, 2020 @07:09PM (#24239865)
Me too, although it was maybe 26 years ago. Learning autoconf/automake served me well, as I ended up working on embedded firmware on ISDN cards using the MC68302 and i960 for a couple of years, and the experience meant that building and setting up a cross compiler and build roots from scratch were a relatively easy step forward.
Re:Linux from Scratch by jamiedamien on Friday August 21, 2020 @04:28PM (#24238556)
I followed this during winter break my first year of college and loved it! Helped me learned Linux and co. pretty quickly and I used the machine as my main computer for the next 3.5 years of college.

Once you get X and google chrome it becomes pretty self sustainable. Updating the kernel is easy but upgrading the compiler / C library is a nightmare.

A lot of programs you might want to use provide binaries that makes things a bit easier, but there were some annoying days of dependency chasing if you have to install from source. I ended up writing some custom scripts to ./configure, make, and make install into a deb from .tar.gz.

About the initial LFS process, I had messed up a few steps pretty bad, and had to restart / go back one or two times. The worst mistake was embarking on the journey first by installing everything into a USB flash drive. Eventually data corruption / loss ruined the yacc binary (or similar? hard to remember) and I spent days trying to figure out what went wrong. After moving to an SSD it worked better :)

Definitely one of my favorite and most rewarding projects I've done.

Re:Linux from Scratch by Skunkleton on Friday August 21, 2020 @04:30PM (#24238574)
I haven’t done LFS, but I have built minimal Linux systems from scratch as part of my day job. FWIW, building a _basic_ usable system is fairly trivial, and requires no where near the amount of work described in LFS.

I could see value in building a basic Linux from scratch. Beyond that you are just copy pasting commands from READMEs for hundreds of projects.

Re:Linux from Scratch by blablabla123 on Friday August 21, 2020 @04:27PM (#24238551)
Yes I also did this years ago. During that time I was actually also fascinated by the idea of building my own OS - which I never did though. But if you do this, you really understand how "GNU Linux" works end-to-end and stumble over a lot of interesting things with the upside of having a system tailored to your setup.

I started using Linux when it was still necessary to compile your own Kernel to support literally anything going beyond the absolute base setup.

The most difficult parts were bootstrapping the system and getting the glibc stuff right. The rest is indeed rather robotic, although I think there is some kind of package manager now included.

Re:Linux from Scratch by maxrmk on Friday August 21, 2020 @04:10PM (#24238426)
I followed through the whole process as an assignment for my operating systems class in college. Overall I had the same experience as you -- it was an exercise in copy and paste.
Re:Linux from Scratch by netsharc on Friday August 21, 2020 @04:15PM (#24238461)
I was wondering if it's automatable, and the site already does that...

I also did the whole book (manually!) as a slacker student. I guess if you do it/let it run automatically as you read the book, you'll know your installed OS inside and out...

Re:Linux from Scratch by hoistbypetard on Friday August 21, 2020 @05:33PM (#24239098)
Automating LFS is where Gentoo came from.
Re:Linux from Scratch by djxfade on Friday August 21, 2020 @06:37PM (#24239601)
What came first, ~~the chicken~~ Gentoo or ~~the egg~~ LFS?
Re:Linux from Scratch by BeetleB on Friday August 21, 2020 @07:08PM (#24239857)
Technically, Gentoo is a penguin.

https://en.wikipedia.org/wiki/Gentoo_penguin

Re:Linux from Scratch by LargoLasskhyfv on Saturday August 22, 2020 @02:03AM (#24242018)
Re:Linux from Scratch by cel1ne on Friday August 21, 2020 @04:11PM (#24238433)
I did this 15 years ago, before I gave gentoo a spin. I compiled my kernel for many years (make menuconfig).

Bottom line: It's not worth it.

I use debian now.

Re:Linux from Scratch by ingenieroariel on Friday August 21, 2020 @08:46PM (#24240566)
I put off doing LFS for several years: Ubuntu, then Debian, then OSX. I discovered NixOS a couple of years ago and never looked back.
Re:Linux from Scratch by Bnshsysjab on Friday August 21, 2020 @04:20PM (#24238506)
I moved to Ubuntu for political reasons outside the fault of gentoo. I really miss the ability to easily patch core libs with custom patches, and portage (when it worked) was a lot easier to deal with than apt.
Re:Linux from Scratch by fuzzer37 on Friday August 21, 2020 @05:05PM (#24238882)
Care to elaborate on the "political reasons"? I've never heard of someone moving _to_ Ubuntu for political reasons.
Re:Linux from Scratch by Bnshsysjab on Friday August 21, 2020 @06:41PM (#24239646)
If I get breached as a result of using gentoo, it looks bad. If I get breached using Ubuntu it’s at least along the lines of ‘well everyone else is using it anyway’. Semi safety in numbers, semi ‘nobody got fired for buying an IBM’.

It wasn’t my call, and it’s a defense move rather than an opinion on the state of Gentoos security. I know they take things very seriously, but my assertions aren’t enough to make my employer feel comfortable.

Re:Linux from Scratch by _emacsomancer_ on Friday August 21, 2020 @08:24PM (#24240419)
Amusing, in this context, that Google decided to base ChromeOS on Gentoo.
Re:Linux from Scratch by Bnshsysjab on Saturday August 22, 2020 @12:15AM (#24241501)
Sure, but I’m sure they leverage portage due to its sheer power and additional scrutiny over any ebuilds they source from upstream. Which, to be clear, the threat model assessed internally is intentionally malicious packages which are unintentionally merged into the portage tree by legitimate and well meaning developers. There’s no immediate issue with the portage or gentoo developers and package maintainers themselves.
Re:Linux from Scratch by swiley on Friday August 21, 2020 @05:42PM (#24239169)
Wait, compiling the kernel and coreutils is the easy part. It’s when you get to X11/gtk/Firefox that it starts to get bad.
Re:Linux from Scratch by LargoLasskhyfv on Saturday August 22, 2020 @01:38AM (#24241871)
Between 2000 and 2005. "Comfortably" compiling ones "own" kernel got more difficult though, because of the sheer growth of options. But for that https://kernelnewbies.org/ exists. Especially for tracking https://kernelnewbies.org/LinuxChanges if you don't only want to blindly apply your proven config to newer kernels, ignoring new features.