Live data from Hacker News

Linux from Scratch

linuxfromscratch.org

71–80 of 85 posts

Re: Linux from Scratch

#71
post #40

Earlier quoted context omitted.

> And you add the bootloader dead last, even though it’s the first thing you see when you boot a Linux machine? That actually makes perfect sense. If you did the bootloader first, how are you going to build it? How do you know what to boot from which filesystem on what device? By the time you've got your root filesystem complete, it's easy to tell. If you do things step by step incrementally, you keep having to go fu…

Except that if you fail to install the bootloader - which happened to me many times - then you do not have a working system. So really the prior argument makes sense. IMO the guy is right - LFS could be way better. But it has this current structure and does not deviate from it. That's the bad part. > If you do things step by step incrementally, you keep having to go further back in the process. Starting over repeated…

If you're going to run the OS, you have to make sure it compiles and runs the bootloader and its installer. The toolchain could be different enough for that to fail. And you do boot into a reasonably small OS and continue from there. That's what BLFS is all about.

Re: Linux from Scratch

#72
post #57
post #38

Earlier quoted context omitted.

I'd like to counter your comment. LFS helped me a lot. It taught me how to compile packages manually, and how GNU/Linux components fit together. Armed with that knowledge, I could do things others could not do: - Make applications that bundle/automatically download their dependencies, compile them with custom flags (static linking) - Diagnose build errors buried in deep dependencies when using vcpkg - Compile program…

Learning how to compile packages manually it was a common skill long before Linux came to be, and how GNU/Linux fits together could also easily be learnt with Slackware or Yggdrasil.

I started with Slackware 1.0 on i386.

I certainly do not miss compiling X11!

Re: Linux from Scratch

#73
post #40

Earlier quoted context omitted.

> And you add the bootloader dead last, even though it’s the first thing you see when you boot a Linux machine? That actually makes perfect sense. If you did the bootloader first, how are you going to build it? How do you know what to boot from which filesystem on what device? By the time you've got your root filesystem complete, it's easy to tell. If you do things step by step incrementally, you keep having to go fu…

You build it on your non-lfs computer. What is the other option? And you dont need to boot anything, just a busy loop after a log "Hello World" is enough, if you feel fancy, maybe make a simple shell ?

You could do that, but if that were to happen to me I'd say the installer sucks and my boss should hire someone else ;)

Re: Linux from Scratch

#74
post #64
post #40

Earlier quoted context omitted.

> And you add the bootloader dead last, even though it’s the first thing you see when you boot a Linux machine? That actually makes perfect sense. If you did the bootloader first, how are you going to build it? How do you know what to boot from which filesystem on what device? By the time you've got your root filesystem complete, it's easy to tell. If you do things step by step incrementally, you keep having to go fu…

Agreed, it's near the end of the Gentoo installation as well. If you forget to install GRUB, just chroot back into it and continue. If I installed the bootloader first, I'd have to remember to run dracut after the system was installed. Or I install it last, create the init at the same time and make a habit of it.

Debian and Arch are the same, grub at the end.

Re: Linux from Scratch

#75

LFS takes the wrong approach in my opinion. I did it once manually over a couple of days. I suppose I hoped enduring the pain of waiting for the packages to compile would somehow make me smarter. It didn’t. I didn’t learn much. It was like following a baking recipe. I know I need to add eggs and sugar in the ratio it says but I’d be damned if I could tell you why that specific ratio works. It’s just too much to take…

The step by step is the right approach... but you'll discover that many 'components' are _INSANE_ and that includes their SDK.

Bare LFS is not enough (I run my own): you need a kind of userland (above glibc) multi-version system which some kind of "atomic-ish" switching (always have a stable SSH running in case something goes wrong, better than unplugging the system disk and fix it on another computer).

For linux, same thing, with a kind of flip-flop-ing for updates/fix/etc.

The insight that gives you will probably scare you: the current "open source" stack is an abomination (the worst is the SDKs I think).

That's why we need _LEAN_ open source, and that includes the SDKs.

Re: Linux from Scratch

#78
post #57
post #38

Earlier quoted context omitted.

I'd like to counter your comment. LFS helped me a lot. It taught me how to compile packages manually, and how GNU/Linux components fit together. Armed with that knowledge, I could do things others could not do: - Make applications that bundle/automatically download their dependencies, compile them with custom flags (static linking) - Diagnose build errors buried in deep dependencies when using vcpkg - Compile program…

Learning how to compile packages manually it was a common skill long before Linux came to be, and how GNU/Linux fits together could also easily be learnt with Slackware or Yggdrasil.

As someone who started using Linux in 1996 (Slackware, of course), I learnt the hard way about compiling packages. I remember trying to compile the kernel, and doing "make config" and following hundreds of options, and not knowing that I then needed to do "make" or "make zimage" or "make install" after any of the config stuff. Obvious, dumb, rookie errors, but still understandable for a teenager coming from Windows. Doing LFS really taught me a lot about dependencies and complexity, as well as understanding of the actual boot process. All of this helped me greatly in later years.

Re: Linux from Scratch

#79
post #75

LFS takes the wrong approach in my opinion. I did it once manually over a couple of days. I suppose I hoped enduring the pain of waiting for the packages to compile would somehow make me smarter. It didn’t. I didn’t learn much. It was like following a baking recipe. I know I need to add eggs and sugar in the ratio it says but I’d be damned if I could tell you why that specific ratio works. It’s just too much to take…

The step by step is the right approach... but you'll discover that many 'components' are _INSANE_ and that includes their SDK. Bare LFS is not enough (I run my own): you need a kind of userland (above glibc) multi-version system which some kind of "atomic-ish" switching (always have a stable SSH running in case something goes wrong, better than unplugging the system disk and fix it on another computer). For linux, sa…

If you think that's an abomination, try corporate billed-by-the-hour enterprise software where nothing ever changes unless it's approved by several layers of management.

I promised myself not to work for any of those anymore :)

Re: Linux from Scratch

#80
I kind of gained all the benefits of LFS by just maintaining a yocto embedded linux distribution at my first job for a couple of years. Yocto is basically automated LFS, it will compile a cross toolchain then use that cross toolchain to compile everything for your target system.
Post reply on HN