Conditional boot menu (aka different boot menu for Windows and Mac)


  • Developer

    Booting and imaging our Macminis is working great with FOG 1.2.0 but it’s still a bit of a hassle as we have both Windows and Mac OS X clients in our labs and I have to customize the boot menu by hand everytime I want to switch between those.
    I started to add some code to ‘/var/www/fog/lib/fog/BootMenu.class.php’ to check $_REQUEST[‘mac’]. Depending on the MAC address a different boot menu is being send to the client…

    As far as I can see even in current SVN this cannot be configured eventhough you can add custom boot menu entries, right?

    I’ll happily implement it myself but I wonder what would be the best way to do it? Would be great if someone could give me a hint on how to implement this the “proper FOG way”… thanks in advance!


  • Moderator

    a very edge case… you will likely need to DIY it.

    The developers can not program every single configuration, only the one that fits most use cases.


  • Moderator

    I’ll make a suggestion…

    Perhaps, after registering a PC or a Mac, through the Web GUI, we can simply manually tick a check box that says what it is… and that can be stored in the database. If the check-box for Mac isn’t ticked, assume PC.

    And then, maybe we can have two completely separate boot menus/methods depending solely on what the database has stored for said MAC address…

    JUST a suggestion… It really seems to me that this needs to be more streamlined.


  • Senior Developer

    That seems a better option that trying to make a guess at what menu is wanted when and wear based on the nic manufacturer (as at that point that’s all I can come up with to know “who” is connecting.)


  • Developer

    Current implementation checks ‘$this->Host->getOS()’. Depending an the return value I display Mac OS X in the boot menu or Windows. Quite simple and I guess I’ll be happy with this for now. Sorry for all the rumors I make about cosmetics like this…


  • Developer

    [quote=“Tom Elliott, post: 42870, member: 7271”]Why would that matter?[/quote]
    Because I want to boot straight into windows/linux/mac os x if there is no task scheduled for that client. FOG uses grub4dos or sanboot method to boot from the hard drive. But this does not work with Apple! What works for me is loading my own version of grub64bit.efi and then chainloading into Mac OS X with that. But that doesn’t work on PCs on the other hand. So I need to distinguish between PC and Apple. Maybe it’s just stupid how I try to do things. Please bear with me.
    [B]EDIT: I just realized that I didn’t explain my situation quite well enough! Updated the above post too. What I am trying to achieve is displaying a different menu whether there is a PC asking for it or an Apple. YES, I could just show the same boot menu to all of them. But I wonder if it can be done better…[/B]


  • Senior Developer

    Why would that matter?

    undionly.kpxe/ipxe.efi both have the same startup scripts. The ONLY purpose of default.ipxe is to point to the servers boot.php file. This process is identical, regardless of the bootup file itself. The boot file then get’s the information from BootMenu.class.php.


  • Developer

    Thanks a lot for your answer Tom! I am sorry but I am still convinced that the decision needs to be done in the boot menu… let me explain. First scenario with PC/BIOS:
    [CODE]
    BIOS -> PXE ROM -> DHCP -> tftp://fog-ip/undionly.kpxe -> default.ipxe -> boot.php
    -> option 1 (no task scheduled): chainload windows (grub4dos) or linux (using grub with loopback support as we use wubi)
    -> option 2 (task scheduled): run task[/CODE]
    And now with Apple/EFI:
    [CODE]
    EFI -> PXE ROM -> DHCP -> tftp://fog-ip/ipxe.efi -> default.ipxe -> boot.php
    -> option 1 (no task scheduled): chainload mac os x (using grub with efi support)
    -> option 2 (task scheduled): run task[/CODE]
    As you can see I do have DHCP user class settings to serve the correct iPXE binary. But where do I go from there? I could point ipxe.efi to a different ipxe-file, yes. But at some point I need to ask boot.php if this particular client has been scheduled a job or not, right?? I don’t see how I could possibly distinguish between ‘task’ and ‘normal boot’ before I get to load boot.php…

    Any ideas and comments are highly appreciated! :)


  • Moderator

    [quote=“Uncle Frank, post: 42799, member: 28116”]Booting and imaging our Macminis is working great with FOG 1.2.0 but it’s still a bit of a hassle as we have both Windows and Mac OS X clients in our labs and I have to customize the boot menu by hand everytime I want to switch between those.
    I started to add some code to ‘/var/www/fog/lib/fog/BootMenu.class.php’ to check $_REQUEST[‘mac’]. Depending on the MAC address a different boot menu is being send to the client…

    As far as I can see even in current SVN this cannot be configured eventhough you can add custom boot menu entries, right?

    I’ll happily implement it myself but I wonder what would be the best way to do it? Would be great if someone could give me a hint on how to implement this the “proper FOG way”… thanks in advance![/quote]

    Please, please elaborate on all your steps to image Macs.

    I’m very interested in this, as we have a massive number of Macs in our school district.


  • Senior Developer

    The boot menu shouldn’t have to be changed, unless you’re doing the “edit by hand” to remove the console issues for the Mac Mini’s.

    The “proper” method to get this working is technically to use user-class system.

    The DHCP server can detect how a client booting ((U)efi/legacy), and because of this, you can tell the systems what file to use to download. In the case of EFI booting, it can then tell the system to load up with the snp{,only}.efi and/or the ipxe.efi file. In the case of legacy it can direct to system to load the {ipxe,undionly}.{,k,kk}pxe file as needed.

    This is where I’ve not been able to come up with a “works” for all systems.

    I do know that the current svn stuff has fixes in place for the console issues, and that these files work fine on the efi systems, but it comes with the caveat that you need to tell the system to load the proper file at the proper time.

    I know this doesn’t give much insight but hopefully it can help lead you to a more automated system?


Log in to reply
 

1.0k
Online

39.4k
Users

11.1k
Topics

105.5k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.