I have a quick question about Linux from Scratch - Can one go through the process on a machine with no OS and a prepared thumb drive? I have a spare laptop right here… (or even an image on Ventoy)

  • wetbeardhairs@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    14
    ·
    5 days ago

    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.

    • CarrotsHaveEars@lemmy.ml
      link
      fedilink
      English
      arrow-up
      5
      ·
      5 days ago

      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.

  • JRaccoon@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    8
    ·
    5 days ago

    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.

  • frongt@lemmy.zip
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    5 days ago

    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.

    • waspentalive@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 days ago

      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.

      • JRaccoon@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 days ago

        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.

  • 𞋴𝛂𝛋𝛆@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    5 days ago

    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.