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

Custom boot config per host/group

Scheduled Pinned Locked Moved Solved
FOG Problems
3
7
501
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.
  • T
    TheBitFighter
    last edited by Feb 17, 2020, 4:54 PM

    I am currently setting up a network consisting of different types of hosts to image. One of those different types are HP Z2 workstations which suffer from a bug in rEFInd described here. While I was able to work around this by setting a manual boot entry in refind.conf, this effectively creates even more problems with other systems then HP which do not necessarily label their EFI partition SYSTEM.

    Is it possible to set different refind.conf files for different hosts? Would there be a different solution to only effect the HP hosts with this solution? And if both answers are no, would it be possible to implement such a feature in FOG?

    Kind regards and thanks for the help.

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by Feb 17, 2020, 7:35 PM

      The short answer is fog doesn’t support more than one uefi exit mode config file.

      With that said you may be able to hack (read update) the FOG code to support this. What version of FOG are you using?

      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
      • S
        Sebastian Roth Moderator
        last edited by Sebastian Roth Feb 17, 2020, 1:41 PM Feb 17, 2020, 7:40 PM

        @TheBitFighter said in Custom boot config per host/group:

        Is it possible to set different refind.conf files for different hosts?
        Would there be a different solution to only effect the HP hosts with this solution?

        No for both as far as I know. Though I have to admit that I am not part of the project since the beginning and there might be something I am not aware of yet.

        And if both answers are no, would it be possible to implement such a feature in FOG?

        Absolutely. FOG is open source and you can implement anything you want. Just start by looking at bootmenu.class.php (line 160). Here you see an array of the entries which will be available for selection in the web UI. So you can just add your custom entry here:

        ...
                $refind_hp = sprintf(
                    'imgfetch ${boot-url}/service/ipxe/refind_hp.conf%s'
                    . 'chain -ar ${boot-url}/service/ipxe/refind_x64.efi',
                    "\n"
                );
        ...
                self::$_exitTypes = array(
                    'sanboot' => $sanboot,
                    'grub' => $grub['basic'],
                    'grub_first_hdd' => $grub['basic'],
                    'grub_first_cdrom' => $grub['1cd'],
                    'grub_first_found_windows' => $grub['1fw'],
                    'refind_efi' => $refind,
                    'refind_efi_hp' => $refind_hp,
                    'exit' => 'exit',
                );
        ...
        

        As well you need to add your custom exit type to another file called service.class.php for it to be select-able in the host/group settings:

        ...
                $types = array(
                    'sanboot',
                    'grub',
                    'grub_first_hdd',
                    'grub_first_cdrom',
                    'grub_first_found_windows',
                    'refind_efi',
                    'refind_efi_hp',
                    'exit',
                );
        ...
        

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        G 1 Reply Last reply Feb 17, 2020, 7:42 PM Reply Quote 1
        • G
          george1421 Moderator @Sebastian Roth
          last edited by george1421 Feb 17, 2020, 1:45 PM Feb 17, 2020, 7:42 PM

          @Sebastian-Roth Thanks… I JUST finished reverse engineering the answer… 😉
          I happened to come up with the same answer too…

          vi lib/fog/service.class.php

                  $types = array(
                      'sanboot',
                      'grub',
                      'grub_first_hdd',
                      'grub_first_cdrom',
                      'grub_first_found_windows',
                      'refind_efi',
                      'refind2_efi',
                      'exit',
                  );
          

          and vi lib/fog/bootmenu.class.php

                  $refind2 = sprintf(
                      'imgfetch ${boot-url}/service/ipxe/refind2.conf%s'
                      . 'chain -ar ${boot-url}/service/ipxe/refind_x64.efi',
                      "\n"
                  );
          
                  self::$_exitTypes = array(
                      'sanboot' => $sanboot,
                      'grub' => $grub['basic'],
                      'grub_first_hdd' => $grub['basic'],
                      'grub_first_cdrom' => $grub['1cd'],
                      'grub_first_found_windows' => $grub['1fw'],
                      'refind_efi' => $refind,
                      'refind2_efi' => $refind2,
                      'exit' => 'exit',
                  );
          
          systemctl restart httpd
          

          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 1
          • T
            TheBitFighter
            last edited by Feb 18, 2020, 1:16 PM

            Here you see an array of the entries which will be available for selection in the web UI. So you can just add your custom entry here:

            I will try using this workaround. It should do exactly what I’m trying to accomplish.

            What version of FOG are you using?

            1.5.7

            Thank you for your help everybody!

            G 1 Reply Last reply Feb 18, 2020, 1:28 PM Reply Quote 0
            • G
              george1421 Moderator @TheBitFighter
              last edited by Feb 18, 2020, 1:28 PM

              @TheBitFighter If you get stuck modifying the php code, I can give you a bit clearer step by step.

              If you totally mess up the php code, just rerun the fog installer and it will reinstall off the original code.

              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
              • T
                TheBitFighter
                last edited by Feb 18, 2020, 2:46 PM

                I implemented the fix in my setup. It works HOWEVER just copying refind.conf and renaming it WILL NOT WORK!
                rEFInd seems to hardcoded look for refind.conf and WILL NOT ACCEPT a file named differently. I worked around this by naming both files refind.conf and putting them in different folders.

                Thanks again for your help!

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  5/7
                  Last post

                152

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project