Live data from Hacker News

Linux from Scratch

linuxfromscratch.org

21–30 of 164 posts

Re: Linux from Scratch

#22
post #4
post #3

I really like the idea, really tried following the process several times. But each time it just turned into a copy-incomprehensible-commands-into-the-terminal exercise at some point, and I lost motivation. Did anyone experience the same?

Yep, basically. At some point you realise you could do it, but do you really want to go through it all... It's a slog. It is a fun experience though!

> It's a slog. It is a fun experience though!

Aren't those two opposites?

Re: Linux from Scratch

#23
post #20
post #9

Earlier quoted context omitted.

it's better if you try to work out what the commands and options are doing. I did this a long time ago, and 15 years later, I realise that it gave me a big advantage over my colleagues who haven't done something like that. "missing xxxxx.so" - they don't even know what that means, whereas I'm already trying to find the so and putting it in ld_library_path to see if it helps.

In my experience, whenever a .so was missing it was either due to a missing package on the os package manager level, or a completely broken gcc or llvm setup. I never needed to explicitly add single .so files to a path. (Besides the use case where I specifically wanted to override a malloc implementation.) In which cases did/do you need to add individual files?

in this case it's an in-house monstrosity that's got a lot of various languages and build systems involved, and the moment you update a compiler or build system, everything jumps into a new location for no good reasons. it was just an example though - same issue with .h not found during compilation, or using a different compiler from the system wide one.

Re: Linux from Scratch

#24

Related: https://buildroot.org/

This basically allows you to make an OS that’s effectively a single application, right?

No. It creates a root filesystem that follows your choices of what should be included and tries to be as minimal and small as possible by default. Very suitable for embedded devices and lightweight virtual machines. You can have it build a kernel as well. I use the ability to create a cpio archive for an initramfs on the Linux boxes.

Re: Linux from Scratch

#26
post #3

I really like the idea, really tried following the process several times. But each time it just turned into a copy-incomprehensible-commands-into-the-terminal exercise at some point, and I lost motivation. Did anyone experience the same?

I built my LFS around 20 years ago. While I followed instructions most of the time, I built some components myself. I remember that I wrote by own init scripts and I think I wrote my own initramfs (not completely sure about it, but I definitely remember tinkering with it and it probably was LFS).

I also wanted to implement an isolated build system and my own package manager (basically tar wrapper with file database to be able to uninstall, no fancy dependency stuff), but containers were not invented back then and my skills were not good enough to properly utilize fakeroot, so it never was implemented, although I spent some time experimenting. Today I would do it with docker, exciting time.

Re: Linux from Scratch

#27
post #6

What's the fun in this? I once looked into it briefly and it's what I guessed: mostly about building and installing the required software individually. That's boring, I guess the fun would be in building an actual usable distro "from scratch".

Building an actually usable distro means doing this, but every day for every package that updated, and scripting it for other people to use.

Re: Linux from Scratch

#28
post #3

I really like the idea, really tried following the process several times. But each time it just turned into a copy-incomprehensible-commands-into-the-terminal exercise at some point, and I lost motivation. Did anyone experience the same?

I haven't tried this but I have used https://github.com/MichielDerhaeg/build-linux during my trainings and all my students quite enjoyed the experience. It basically builds a Kernel, libc, busybox, init etc. and gets the whole thing running inside qemu.

I found it quite educational and worth the little time I spent on it.

Re: Linux from Scratch

#29
post #5

I did this, once, on a 386. Did I learn things? Definitely. Will I ever do it again? Definitely not ;)

I wonder, if you were to script all the commands you ran back in the day, and ran that same script on your old 386 and on a modern system with a top-of-the-line AMD Epyc or Intel Xeon, how much faster would it run?

There is a unit of compilation as part of the LSF book which lets you estimate the who build process. You only need to compile libc or some such.

Re: Linux from Scratch

#30

Earlier quoted context omitted.

I wonder, if you were to script all the commands you ran back in the day, and ran that same script on your old 386 and on a modern system with a top-of-the-line AMD Epyc or Intel Xeon, how much faster would it run?

Especially with the increase in storage performance - going from a hard disk that might have even still been using PIO modes to modern NVMe would be gigantic

The kernel is rather larger today: https://stopbyte.com/t/how-many-lines-of-code-linux-has/455/...

The same is true for all other pieces of software.

Build time will always increase until no one can be bothered to build it any more.

Post reply on HN