Live data from Hacker News

I Built Linux from Scratch

thesloth.me

31–40 of 105 posts

Re: I Built Linux from Scratch

#31
Recently I was making an embedded linux image for enclaves where a shell and shell utilities did not make sense and high security and auditability was needed.

I learned a bit of rust and wrote a minimal init system perfect for my use case: https://github.com/distrust-foundation/EnclaveOS/blob/master...

The init system is statically compiled into the kernel as a CPIO.

This is about as bare bones as you can get with linux, and may help others understand the essentials.

I was only able to do this because of years of running gentoo and building linux for various embedded projects. It pays off!

You could swap out my init binary for busybox init and have built a full interactive linux distro from scratch in under an hour.

Re: I Built Linux from Scratch

#32
post #17

If you have children, a much better investment is to have them install LFS and forbid them from using Windows/Mac, compared to going to college. I did not learn a damn thing in college because I'd been using Linux since age 12.

Perhaps you missed the point of college if all you did were things within your comfort zone

I would guess GP meant "about Linux."

I had the same experience with college. I'd been using Linux for years and learned nothing new about Linux in college. It was nice because the class moved fast and a lot of people who had never Linuxed or CLIed in their lives really struggled to get through it and keep up.

Re: I Built Linux from Scratch

#33
I remember this being a phase I went through when I was in school.

Back then I ran into the same issue as everyone else, it basically felt like Slackware, or FreeBSD with the ports but sans all the handy patches.

I'd love it if their docs[1] actually mentioned how to install an existing package manager software on your LFS, that would basically make it a distro.

1. https://www.linuxfromscratch.org/lfs/view/stable/chapter08/p...

Re: I Built Linux from Scratch

#34

I did LFS back when I was a pre-teen/teen. So late 90s, early 00s. And while I agree to an extent that it doesn't give you much day-to-day stuff, it really makes you more comfortable with operating systems and linux especially. Nowadays, I am a devops/infrastructure engineer, and I can say LFS is a core foundational experience that has let me be better at my job. I know deeper inner workings of a Linux distro and tha…

IMO a secure server is an immutable appliance. I still build Linux from scratch most weeks as a core part of my job.

Bare bones hardened kernel + shim init + target application are all you need, and will be your highest security/reliability systems.

And yeah, threadrippers are a must.

Re: I Built Linux from Scratch

#35

I did LFS back when I was a pre-teen/teen. So late 90s, early 00s. And while I agree to an extent that it doesn't give you much day-to-day stuff, it really makes you more comfortable with operating systems and linux especially. Nowadays, I am a devops/infrastructure engineer, and I can say LFS is a core foundational experience that has let me be better at my job. I know deeper inner workings of a Linux distro and tha…

I had the same experience around the same time (though I'm a bit older). LFS really helped me understand the relationship between the bootloader, kernel, init system, and all of the various daemons and tools that make up a complete system. From there I moved to Gentoo, and then eventually to Ubuntu and other batteries-included distros. But the knowledge I gained from LFS is still a foundational part of my skillset, e…

Until I moved to FreeBSD in the mid 2000s I ran Gentoo primarily. Even though it had a bit more hand holding than LFS, it still taught me a lot and getting to choose implementations allowed consideration of design choices (cron, mail, syslog, etc.).

I’ve tried to return a few times but it’s a bit different now and I’m happy enough with FreeBSD that I don’t have much place for it. I do wish more embedded distros would have started with Gentoo (specifically ARM SBCs).

Re: I Built Linux from Scratch

#36

I did LFS back when I was a pre-teen/teen. So late 90s, early 00s. And while I agree to an extent that it doesn't give you much day-to-day stuff, it really makes you more comfortable with operating systems and linux especially. Nowadays, I am a devops/infrastructure engineer, and I can say LFS is a core foundational experience that has let me be better at my job. I know deeper inner workings of a Linux distro and tha…

Sounds like a valuable formative experience.

Sort of like launching a spaceship in factorio.

Re: I Built Linux from Scratch

#37
I did it multiple times in past in a few companies where I worked on various Linux based network security appliances. Using standard Linux distros on them is problematic for various reasons.

So I developed my own build system, which probably looked somewhat like Nix for building the distribution and managing updates.

LFS was great place to start with

Re: I Built Linux from Scratch

#38
post #15

After I finish the whole process, can I slap pacman on top my freshly build LTS and effectively transform it into Arch and daily drive it? Or is it only meant "for the journey" of building it, but can't realistically be used as a daily?

Why do that when there is pacstrap?

Re: I Built Linux from Scratch

#39
post #15

After I finish the whole process, can I slap pacman on top my freshly build LTS and effectively transform it into Arch and daily drive it? Or is it only meant "for the journey" of building it, but can't realistically be used as a daily?

Why do that when there is pacstrap?

Because I want to experience LSF?

Re: I Built Linux from Scratch

#40
post #34

I did LFS back when I was a pre-teen/teen. So late 90s, early 00s. And while I agree to an extent that it doesn't give you much day-to-day stuff, it really makes you more comfortable with operating systems and linux especially. Nowadays, I am a devops/infrastructure engineer, and I can say LFS is a core foundational experience that has let me be better at my job. I know deeper inner workings of a Linux distro and tha…

IMO a secure server is an immutable appliance. I still build Linux from scratch most weeks as a core part of my job. Bare bones hardened kernel + shim init + target application are all you need, and will be your highest security/reliability systems. And yeah, threadrippers are a must.

I assume you compile the source code because you want to be sure you don't use any compromised binaries? But how can you be sure the source code wasn't compromised with some obfuscated C code? (Honest question, I'm just a humble application developer.)
Post reply on HN