• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Fully automated UEFI-based O/S installation (Debian 10)

Scheduled Pinned Locked Moved
General
2
22
6.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    RobPomeroy
    last edited by RobPomeroy Jan 20, 2021, 10:49 AM Jan 20, 2021, 4:48 PM

    Hi all,

    First newbie post.

    I’ve managed to automate the installation of Debian 10 using FOG and the netboot installer on a UEFI system. I haven’t found complete documentation on this, so here are some notes on how I achieved this. I would love it if this process could be improved on. Is there a “FOGgier” way to do some of the hackier things?

    Disclaimer: I have only been using FOG for a few days!

    1. Unpack netboot.tar.gz into the TFTP server root (/tftpboot).

    2. Create a symbolic (must be relative, not absolute) to the UEFI kernel:

    cd /tftpboot
    ln -s debian-installer/amd64/grubx64.efi .
    
    1. Edit /tftpboot/debian-installer/amd64/grub/grub.cfg, adding the following before the first menuentry block:
    set default="autoinstall"
    set timeout=5
    menuentry "Fully automated installation" --id autoinstall {
         set background_color=black
         linux    /debian-installer/amd64/linux auto=true url=http://${pxe_default_server}/os/autoinstall/debian-10/preseed.cfg hostname=debian-10 domain=local interface=auto vga=788 noprompt --- quiet
         initrd   /debian-installer/amd64/initrd.gz
    }
    
    1. Create a preseed file and place it on the FOG webserver at /var/www/html/os/autoinstall/debian-10/preseed.cfg. (Double-check that path - I relocated my os/ directory and forget where it was originally! Think that’s right though.)

    2. Create a new iPXE Menu Entry:

    Menu item: os.Debian.10.7.UEFI
    Description: Install Debian 10.7 (UEFI)
    Parameters:
    kernel tftp://${fog-ip}/grubx64.efi
    boot || goto MENU
    Menu Show with: All hosts

    That’s all, I think. This is PXE booting for me perfectly. When I choose the FOG menu entry “Install Debian 10.7 (UEFI)” it loads the kernel/grub menu, waits 5 seconds and then performs a completely unattended installation (and finally reboots).

    What could be improved
    I’d rather not place the files exactly where there are in the /tftpboot folder. That approach is asking for trouble - one day I overwrite them with some other distro’s files… But grubx64.efi seems to have some hard-coded files it looks for, so I’m not sure where else to place them. Possibly there are some parameters i can use on the kernel line? Not sure.

    Also, how might this approach be generalised for other operating systems?

    Suggestions welcome!

    R G 3 Replies Last reply Jan 20, 2021, 4:53 PM Reply Quote 0
    • R
      RobPomeroy @RobPomeroy
      last edited by Jan 20, 2021, 4:53 PM

      PS This is obviously a network install, depending on some files being placed on the FOG server. The installer downloads packages from the internet, so this is no use for air-gapped machines.

      1 Reply Last reply Reply Quote 0
      • G
        george1421 Moderator @RobPomeroy
        last edited by george1421 Jan 20, 2021, 11:06 AM Jan 20, 2021, 4:57 PM

        @robpomeroy Well I’m not sure how much direction I can provide but I have instructions on pxe booting into Debian 10.7 live here: https://forums.fogproject.org/post/140524

        I do need to create one for the dbi command line installer, but it should be fairly similar to your setup except you don’t need to use grub at all can be done with iPXE. The key for the dbi installer is to pass the URL parameter to point to the preseed file.

        If I were to rewrite your grub.cfg file over into ipxe format then (caveat is that I have not tested this, so its just a best guess as a proof of concept)

        kernel tftp://${fog-ip}/os/debian/Server10.7/linux
        initrd tftp://${fog-ip}/os/debian/Server10.7/initrd.gz
        imgargs linux auto=true url=http://${fog-ip}/os/autoinstall/debian-10/preseed.cfg hostname=debian-10 domain=local interface=auto vga=788 noprompt --- quiet
        boot || goto MENU
        

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        R 1 Reply Last reply Jan 25, 2021, 11:10 AM Reply Quote 0
        • G
          george1421 Moderator @RobPomeroy
          last edited by Jan 20, 2021, 5:03 PM

          @robpomeroy said in Fully automated UEFI-based O/S installation (Debian 10):

          But grubx64.efi seems to have some hard-coded files it looks for, so I’m not sure where else to place them.

          Also be aware there are different flavors of grub. There is grubx64.efi and grubnetx64.efi depending on the distro where you get them from some distros don’t add networking support to grubx64.efi so it can only reference local storage.

          You can pxe boot with grub in the case of grub (grubnetx64.efi) from ubuntu’s repo on your tftp server create a grub directory mkdir -p /tftpboot/grub and place your grub.cfg file in there. That is hard coded into the grub binary as you noted.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          R 1 Reply Last reply Jan 25, 2021, 11:04 AM Reply Quote 0
          • R
            RobPomeroy @george1421
            last edited by Jan 25, 2021, 11:04 AM

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • R
              RobPomeroy @george1421
              last edited by Jan 25, 2021, 11:10 AM

              @george1421 - I took a lot of inspiration from that whole post of yours; you’ve clearly done a lot of work in this area, so thank you for that. In my approach, I wanted to achieve this using the lightweight network installer for Debian, rather than a Live CD/filesystem.squashfs approach.

              So this:

              kernel tftp://${fog-ip}/os/debian/Server10.7/linux
              initrd tftp://${fog-ip}/os/debian/Server10.7/initrd.gz
              imgargs linux auto=true url=http://${fog-ip}/os/autoinstall/debian-10/preseed.cfg hostname=debian-10 domain=local interface=auto vga=788 noprompt --- quiet
              boot || goto MENU
              

              …is closer to what I’d hope to achieve. I did try an approach along these lines, but without any success, hence resorting to the grub method. I’ll give it another try - thanks!

              G 2 Replies Last reply Jan 25, 2021, 11:35 AM Reply Quote 0
              • G
                george1421 Moderator @RobPomeroy
                last edited by Jan 25, 2021, 11:35 AM

                @robpomeroy said in Fully automated UEFI-based O/S installation (Debian 10):

                I did try an approach along these lines, but without any success,

                What were your results? Did you confirm that you can download the preseed file with a standard browser?

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                1 Reply Last reply Reply Quote 0
                • G
                  george1421 Moderator @RobPomeroy
                  last edited by Jan 25, 2021, 2:33 PM

                  @robpomeroy With the exception of testing the preceed file these instructions work as advertized: https://forums.fogproject.org/post/140720

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                  R 1 Reply Last reply Jan 26, 2021, 11:47 AM Reply Quote 0
                  • R
                    RobPomeroy @george1421
                    last edited by Jan 26, 2021, 11:47 AM

                    @george1421 said in Fully automated UEFI-based O/S installation (Debian 10):

                    @robpomeroy With the exception of testing the preceed file these instructions work as advertized: https://forums.fogproject.org/post/140720

                    On UEFI? I’ll try that now! Thanks.

                    R 1 Reply Last reply Jan 26, 2021, 11:55 AM Reply Quote 0
                    • R
                      RobPomeroy @RobPomeroy
                      last edited by Jan 26, 2021, 11:55 AM

                      kernel tftp://${fog-ip}/os/debian/Server10.7/linux
                      initrd tftp://${fog-ip}/os/debian/Server10.7/initrd.gz
                      

                      Have you tried leaning on IPXE’s HTTP support here rather than TFTP? I’m just wondering if that would make it cleaner (keeping all installer files in one location under the web root).

                      G 1 Reply Last reply Jan 26, 2021, 1:37 PM Reply Quote 0
                      • G
                        george1421 Moderator @RobPomeroy
                        last edited by Jan 26, 2021, 1:37 PM

                        @robpomeroy Yes I have use tftp, http/https, nfs. The use of tftp was a conscious decision to keep the instructions consistent throughout the article. One of the issues is the http document root varies depending on the linux distribution.

                        From a performance standpoint for the kernel and the initrd tftp transfer is fast enough, for the live boot OS’ its better to use http transfer because the squashfs files are usually several hundred MB in size.

                        Actually looking at the tutorial for debian 10 server, the files are shared with the pxe booting computer over NFS, so the only thing transferred via tftp is just the kernel and init.

                        imgargs linux root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:/images/os/debian/Server10.7/ locale=en_US.UTF-8 keyboard-configuration/layoutcode=us quiet splash ip=dhcp rw
                        

                        I guess the point here is there is no bad way to go about it. Whatever works for your environment is the right choice. FOG just give you the options to use whatever you need to get the job done.

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                        R 1 Reply Last reply Jan 26, 2021, 2:00 PM Reply Quote 0
                        • R
                          RobPomeroy @george1421
                          last edited by Jan 26, 2021, 2:00 PM

                          @george1421 - Thanks George. My problem is understanding all the options!

                          Following your latest instructions unfortunately results in a kernel panic (presumably initram related?). The kernel and init disk both transferred correctly via TFTP. Incompatibility with UEFI perhaps?

                          0e14b72c-a686-44ff-b804-16d972fa12eb-image.png

                          G 1 Reply Last reply Jan 26, 2021, 2:43 PM Reply Quote 0
                          • G
                            george1421 Moderator @RobPomeroy
                            last edited by george1421 Jan 26, 2021, 8:44 AM Jan 26, 2021, 2:43 PM

                            @robpomeroy Switch the VM to bios and try it (just to test). I was having that issue with efi on proxmox. I thought it was just being proxmox being silly. Maybe not.

                            The error is basically the kernel doesn’t understand the format of the virtual disk drive (initrd).

                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                            R 1 Reply Last reply Jan 26, 2021, 3:40 PM Reply Quote 0
                            • R
                              RobPomeroy @george1421
                              last edited by Jan 26, 2021, 3:40 PM

                              @george1421 It’s a physical server (Dell T40) that literally cannot boot BIOS-based OSes, I’m afraid. It has no internal legacy boot capability. I was amazed, but then I haven’t worked with physical hardware in a while.

                              G 1 Reply Last reply Jan 26, 2021, 3:54 PM Reply Quote 0
                              • G
                                george1421 Moderator @RobPomeroy
                                last edited by Jan 26, 2021, 3:54 PM

                                @robpomeroy Ok so next plan I was going to try is to grab FOG’s bzImage from /var/www/html/fog/service/ipxe That is EFI capable I was thinking about sliding that in and replacing the “linux” kernel just to see if it would init the disk. Let me see what I can do on vmware I should be able to duplicate the error I was seeing in my home lab.

                                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                R 1 Reply Last reply Jan 26, 2021, 4:05 PM Reply Quote 0
                                • R
                                  RobPomeroy @george1421
                                  last edited by Jan 26, 2021, 4:05 PM

                                  @george1421 - okay, thanks George.

                                  This boots beautifully though:

                                  kernel tftp://${fog-ip}/grubx64.efi
                                  boot || goto MENU
                                  

                                  Is there no way to squirt additional parameters into that Grub EFI loader?

                                  Sorry - I figured that this might be simple. I should know better by now! 😂

                                  G 1 Reply Last reply Jan 26, 2021, 6:05 PM Reply Quote 0
                                  • G
                                    george1421 Moderator @RobPomeroy
                                    last edited by george1421 Jan 26, 2021, 12:06 PM Jan 26, 2021, 6:05 PM

                                    @robpomeroy Well I have a workable solution.

                                    kernel tftp://${fog-ip}/os/debian/Server10.7/linux loglevel=7 initrd=initrd.gz root=/dev/nfs boot=casper netboot=nfs nfsroot=${fog-ip}:/images/os/debian/Server10.7/ locale=en_US.UTF-8 keyboard-configuration/layoutcode=us quiet splash ip=dhcp rw
                                    imgfetch tftp://${fog-ip}/os/debian/Server10.7/initrd.gz
                                    boot || goto MENU
                                    

                                    After several itterations of try this, crash that… I found that the image args was missing this initrd=initrd.gz. Understand I did not push the installer past configuring the keyboard. But the kernel now boots. You will probably need to add in the link to the preseed file auto=true url=http://${fog-ip}/os/autoinstall/debian-10/preseed.cfg and anything else you want configured via image args.

                                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                    R 1 Reply Last reply Jan 28, 2021, 10:13 AM Reply Quote 0
                                    • R
                                      RobPomeroy @george1421
                                      last edited by Jan 28, 2021, 10:13 AM

                                      @george1421 George, firstly thanks again for the all the work you’ve put into this!

                                      This steered me in exactly the right direction. The following are the parameters I used for a completely automated netboot install (no Live ISO required). This is the point I was hoping to get to. Brilliant.

                                      kernel tftp://${fog-ip}/debian-installer/amd64/linux auto=true url=http://${fog-ip}/os/autoinstall/debian-10/preseed.cfg interface=auto hostname=debian-10 domain=local initrd=initrd.gz vga=788 noprompt quiet
                                      imgfetch tftp://${fog-ip}/debian-installer/amd64/initrd.gz
                                      boot || goto MENU
                                      

                                      So this removes the need to mess around with grub.cfg or boot to an intermediate (grub) menu. All you need are the netboot.tar.gz files and a preseed.cfg. Next I’ll try doing this all via HTTP (rather than TFTP), to avoid polluting /tftpboot. I’m mindful that I would like to make the backup and restoration of FOG itself as straightforward as possible.

                                      I know I’ve said this a few times in this thread (!) but once more: thank you. If I can help by writing up a wiki page for this process, do point me in the right direction.

                                      R 1 Reply Last reply Jan 28, 2021, 10:37 AM Reply Quote 1
                                      • R
                                        RobPomeroy @RobPomeroy
                                        last edited by Jan 28, 2021, 10:37 AM

                                        Yep, HTTP worked perfectly too, which means I could put the three required files in a single location under the web root. FOG menu parameters:

                                        kernel http://${fog-ip}/os/autoinstall/debian-10/debian-installer/amd64/linux auto=true url=http://${fog-ip}/os/autoinstall/debian-10/preseed.cfg interface=auto hostname=debian-10 domain=local initrd=initrd.gz vga=788 noprompt quiet
                                        imgfetch http://${fog-ip}/os/autoinstall/debian-10/debian-installer/amd64/initrd.gz
                                        boot || goto MENU
                                        

                                        This is clean & efficient. I like it. Probably not as quick as using a Live image, but I’m doing this over a fast internet connection and it’s a minimal install. So the whole thing is done in ten minutes or so.

                                        Again, I’m more than willing to write this up somewhere if useful for others.

                                        R G 2 Replies Last reply Jan 28, 2021, 11:56 AM Reply Quote 1
                                        • R
                                          RobPomeroy @RobPomeroy
                                          last edited by Jan 28, 2021, 11:56 AM

                                          @robpomeroy said in Fully automated UEFI-based O/S installation (Debian 10):

                                          three required

                                          *the required

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          1 / 2
                                          • First post
                                            6/22
                                            Last post

                                          156

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project