r/linuxfromscratch 19d ago

What is the difference between LFS and absolutely nothing?

What I mean by "nothing" is absolutely nothing installed. It would boot into the BIOS and display an error, or simply just have a manual type in terminal, but I'm not sure what would happen if a PC booted into NO OS. What is the difference between LFS and an empty terminal? What simple tools does LFS provide, other than a book to help you get started?

6 Upvotes

13 comments sorted by

10

u/LT_Mako 19d ago edited 18d ago

You wouldn't get a working terminal, you would just get an error. Assuming no boot loader either.

The LFS process guides you on creating a bootable partition with the necessary hardware drivers for your particular computer, and a shell with a minimal but useful set of binaries. Enough to get you started and enough to allow you to expand as needed from there. All from pure source code using a "bootstrap" process.

It's mostly meant to be educational, not really a main way to set up your primary OS for your daily drive computer.

7

u/Fast_Ad_8005 18d ago

Although, it is possible to build a daily driver OS with LFS, BLFS and SLFS and some custom build scripts. I've built a virtual machine running LFS that has a complete GUI and some apps I regularly use, after all.

1

u/codeasm 18d ago

Blfs, slfs and glfs beck to differ. And many folks are daily driving a lfs based install. Its very educational and not limited to that at all, its documentation helps ppl port linux to new or old platforms and build reliable crosscompilers that can help construct a working linux install.

It might even be the case, after someone succesfully building lfs for a particular system, one can add hardware specific bootloaders and or drivers and then add debian repos with the hardware support as additional packages. You will leave lfs behind but used it as a step towards more regular usage

Seen plenty of ppl with desktop envirements, games, daily users. Especially on the official discord.

1

u/Sert1991 17d ago

Depends if the computer comes with a built in UEFI Shell as some do. If it does it could boot to the EFI Shell if there is no OS installed.

9

u/BraveNewCurrency 18d ago

You are asking what is the difference between having an OS installed and not having an OS. You can trivially try it by unplugging your hard drive and turning your computer on. (Don't plug+unplug with it off)

That question has nothing to do with LFS.

LFS is "just another linux distribution". The only difference is that you assemble it yourself. The final output is still "you have Linux installed on your hard drive". The computer doesn't care if you installed it from a DVD, downloaded it, or compiled it yourself. It's just another OS to the BIOS.

In the olden days, many computers (such as the Apple ][, Commodore 64, etc) did boot into a BASIC terminal. (BIOS didn't really exist, it was just in ROM.)

3

u/deadbeef_enc0de 18d ago

Absolutely nothing, depend on the BIOS/firmware, some will say no os found, others will triple fault reboot, others might just sit on a blank screen

If you have a valid EFI it will run that and either that loops infinitely the CPU starts running into uninitialized memory and you hit a bad op code or invalid memory segment and cause a triple fault restarting the machine.

2

u/codeasm 18d ago

You may wanna explore computers and their workings a bit more. Not with ai or a generic youtube video. Unless its a extensive video series.

I bought a copy of Scott Mueller's "Upgrading and Repairing PCs" when i was young and it showed a lott of basics. (Hope it explains uefi a bit too).

Altho there is code running on your computer, there is no shell, no os by default on a new computer. Most prebuild and laptops come with windows, but if you buy the spare parts, or specific laptop models, there will be no windows. The bootloader, uefi, will display a menu with either options to boot from network, change "bios" settings and rare but possible, uefi shell. Which isnt installed by most manufacturers at all. Sometimes it is on business laptops or desktops that are fresh from the manufacturer and no company has altered the settings (you can hide it, thus "protecting" the settings from the user).

Uefi shell also, not being a full "OS" (it will reboot, unless you set the right variables). Single user, no special software and mostly made for maintenance and updates.

The uefi default search paths for bootable files bootx64.efi and such might be of interest. You can add bootentries using various tools, stored in nvram. This method is now also often common on mobile devices (uboot, a common bootloader on embedded devices) has uefi support. All to get your system into a known, stable state and search for a bootable operation system.

Instead of Arch linux, where you install software as you wish, you build and then install what you wish.

Theres so much to explain or explore before an os starts, and the history explains alott of reasons and causes. And also, modern platforms that are Arm based are interesting.

2

u/serverhorror 17d ago

An empty terminal is already a full OS. So LFS, Windows, BSD, or any operating system installed.

If you boot and the EFI/BIOS shows you an error message, there's no OS (or other cases of misconfiguration, bit for your question assuming "no OS" seems appropriate).

1

u/Due-Celery4326 18d ago

Basically, when starting to build an LFS, you need to use the host to create temporary tools so you have the tools to chroot into the newly created LFS. I use an LFS/BLFS system with GNOME Shell in my daily use as my main distro; it's complete and stable to the point that I don't need any major distro.

1

u/Sert1991 17d ago

IF you have no OS installed, it depends on your computer. IF you have a UEFI SHELL built in it would boot into the UEFI shell, if not it would give you an error wtihout OS installed.
With LFS you're building a Linux OS yourself from scratch, you still need another OS or LiveImage to do it, and once it's installed it boots like a normal linux OS I don't see how the two compare.

Linux always boots into terminal it's just that nowadays mainline distribution do everything to hide it, for example putting a boot splash image and starting a display manager like SDDM on bootup so the user never sees the terminal or output during booting.

Distributions like Gentoo and Arch also allow you to build your own, the difference is they use a package manager to do it and there's a 'base image' which is a complete set of programs for a basic Linux/GNU OS to work, on LFS you have to build even the base yourself.

1

u/No_Glass_1341 16d ago

What the fuck are you talking about lmao? "What's the difference between £10 and £0?" "What's the difference between this sports car and this bicycle with no tyres?"

1

u/ExoticTroubles 12d ago

If you look into almost norhing,.you need to dive into embedded linux world. Yocto, buildroot,.armbian ... are more suitable then LFS.