That's an interesting problem in computer science. Generally it's called "bootstrapping" when you build a process that is used to build another process. For instance, compilers like gcc are bootstrapped from a purpose built compiler compiler but then gcc compiles its own source to result in the final product. But that can be done on one machine. Bootstrapping a machine from bare metal pretty much requires another machine.
Linux
Welcome to c/linux!
Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!
Rules:
-
Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.
-
Be respectful: Treat fellow community members with respect and courtesy.
-
Quality over quantity: Share informative and thought-provoking content.
-
No spam or self-promotion: Avoid excessive self-promotion or spamming.
-
No NSFW adult content
-
Follow general lemmy guidelines.
This. It sounds like OP is trying to bootstrap the low-level system. On startup the CPU is instructed to read from the first 512 bytes from the designated hard drive if it's MBR and run it as native code. If OP has any mean (like a butterfly) to write his own invention of boot code and Grub equivalent then it totally goes off the ground there.
You can do it from a live cd/usb just fine, but you'll need to repeat some preparation steps (basically chapter 2 of the book) every time you boot the host.
The way I did was to install the host (I chose Debian) on a small partition on the disk, leaving most of the space for the LFS partition. Once the (B)LFS build was complete enough that I didn't need the host anymore, I just removed its partition and expanded the LFS partition into the now unallocated space.
Not allowed until after you write the bootloader Hercules. Tell the gods of Olympus hello. Perhaps I will visit them one day. Gentoo with Sakaki was enough to sate my thirst.
From a live boot system, I don't see why not. Compiling a system and writing it to disk should be relatively easy.
From a blank system and a blank thumb drive... No, unless your PC has some form of builtin command line. You'd either have to type in every line of code like you were using a PC from the 70s, or implement networking so that you could download it.
Oh, sorry I guess I was not detailed enough @frongt@lemmy.zip - I have a working desktop Linux system and an unused i7 laptop (whose battery does not charge, btw) 2 machines - I can use the desktop to prepare the thumb drive and the do the work on the laptop.
You can absolutely do that, but I would highly recommend setting up the laptop for SSH access. That way, you can work on your LFS from your main desktop, which will probably be much more comfortable, will allow you to easily copy and paste from the book and so forth.