1
1
I need to run a script before the operating system starts. The script reads a text file (on file-system FAT32), if the result is "A", then launch OS1, elseif the result is "B", then launches OS2 (another operating system). I thought of Grub, but I do not know how it could be done. Alternatively, I could use EFI Shell, but in the firmware of my computer there is no EFI Shell. How can I do? Thank you all.
2Welcome to Super User! An interesting question, but what problem are you trying to solve, if you don't mind my asking? If it's something along "reboot in X/Y on user intervention/programmatically" there might be ways of doing that depening on your setup :) – bertieb – 2018-05-09T08:26:57.563
When the operating system is running, it writes a text file to a FAT32 partition (via a script), depending on whether an event has occurred or not, let's say it writes "A" or "B" (a flag). This can be done by all operating systems installed on the machine. If "A" is written, then on the next reboot (or on re-ignition), OS1 must start, if instead "B" is written, then another operating system must start, say OS2 (not OS2 Warp :-)). That's all. Management must necessarily be pre-boot – Luciano – 2018-05-09T08:45:57.783
1@Luciano UEFI provides this feature out of the box. With Linux you have to run
efibootmgr -n <number>
(print numbers by runningefibootmgr
). With Windows you have to figure it out yourself, I haven't used it yet. – gronostaj – 2018-05-09T09:19:28.227