Boot Order
-
And through FOG, it is possible to change the Boot Order? During deployment, the Boot Order switches to Windows/Debian/Ubuntu. But suppose I want to change it again automatically when creating an OS Task, so that the machine boots via iPXE again and installs the OS I need. If this is possible, please clarify how to do it.
-
@chevengur I have not had to do this before, but I can tell you in concept how to go about it.
You will need to create a post install script, that script gets executed just after the image is pushed to the computer and before its rebooted. This script is a bash shell script (remember the FOS engine is linux based).
Since it is linux based you will need to use linux command line tools to reset the boot image. The tool named is efibootmgr. This command is built into FOS linux engine.
So on its simplest form, you will create a FOG post install script and that script will call the efibootmgr to set the boot image. Understand that MS Windows will change this order without notice and at random times during its life.
Its not hard to do, but it will take a little effort on you to work out what is needed.
I can’t give you a step by step on how to do this but I can give you a general direction to look in if you want to go down this path.
-
@george1421 I came to this a day ago, but efibootmgr doesn’t really want to change the boot priority — maybe there are some tricks or specific moments when the script needs to be used. Could you tell me the best way to do this?
-
@chevengur I can tell you how I would go about figuring this this.
- Take a computer that represents the finished design of how your disk are laid out.
- Schedule a deployment to that computer, but before you hit the schedule task button, tick the debug checkbox then schedule the deployment. No worries as long as you pick debug mode since it will never get to the deployment phase.
- Now pxe boot the target computer, it should boot into the FOS linux console. After a few screens of text you need to clear with the enter key you will be dropped to the FOS linux command prompt.
- From there issue, the
efibootmgrcommand with no parameters. It should print something similar to below (note this is from my laptop)
thunder@lightning:~$ efibootmgr BootCurrent: 0005 Timeout: 2 seconds BootOrder: 0005,0004,0000,0001,0002,0003 Boot0000* UEFI BC511 NVMe SK hynix 256GB SN9BN62231050BJ2H 1 HD(1,GPT,d00df89f-1edb-44f8-b325-245b607b2321,0x800,0x100000)/File(\EFI\Boot\BootX64.efi){auto_created_boot_option} Boot0001* ONBOARD NIC (IPV4) PciRoot(0x0)/Pci(0x1f,0x6)/MAC(b44,0)/IPv4(0.0.0.00.0.0.0,0,0){auto_created_boot_option} Boot0002* ONBOARD NIC (IPV6) PciRoot(0x0)/Pci(0x1f,0x6)/MAC(b440)/IPv6([::]:<->[::]:,0,0){auto_created_boot_option} Boot0003* UEFI HTTPs Boot (MAC:B445065BDC4B) PciRoot(0x0)/Pci(0x1f,0x6)/MAC(b445065bdc4b,0)/IPv4(0.0.0.00.0.0.0,0,0)/Uri(){auto_created_boot_option} Boot0004* debian HD(1,GPT,d00df89f-1edb-07b2321,0x800,0x100000)/File(\EFI\debian\shimx64.efi) Boot0005* Ubuntu HD(1,GPT,d00df89f-1edb-607b2321,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)You can see from this the default
BootOrderis 5, 4, 0, 1, 2, 3 this lists the different boot managers found by the firmware.So it will boot ubuntu first, then debian, the hard drive, onboard nic v4, onboard nic v6, http boot.
Now lets say I wanted debian to boot first I might issue the command.
efibootmgr -o 4,5, 0,1, 2, 3Now reboot the computer with the
rebootcommand see if it changes the boot order specific to your options.After you get this worked out, you will need to clean up this deploy task on your fog server so it doesn’t do this moving forward. But for debugging as long as the fos engine doesn’t complete, every time you reboot the computer will enter the FOS debug console. This helps with debugging and tweaking your post install script.