hede
2024-07-21 09:20:01 UTC
Hi list,
does anybody know if it's possible to switch the boot menu entry to boot based on the reason the PC was powered on?
Say for example the following challenge:
- start Windows if someone powers it on via the power button
- start Linux if the system was powered on via LAN or a bios timer event
This would enable some general PC to also function as a remote backup PC. The user of the PC wants to start Windows if he powers it on via the Power Button. But additionally to that there is a timer event starting the PC at night for remote backups running at that time and the backup solution is for Linux.
I tried to find a solution using grub, systemd-boot, rEFInd and even the Windows Boot Manager with no success. It seems none of the famous boot managers is able to switch the boot entry based on the power up reason given by the UEFI.
Technically it should be possible, as dmidecode can show the reason:
Handle 0x0001, DMI type 1, 27 bytes
System Information
...
Wake-up Type: LAN Remote
vs.
Wake-up Type: Power Switch
(the first one was powered on via Intel AMT, the second one by the power switch, as an example)
It seems still no one has implemented that?
(the next problem would be to have a working Secure Boot + TPM hard disk decrypt operation for both systems... but this one is of no interest if there is no reason)
best regards
hede
does anybody know if it's possible to switch the boot menu entry to boot based on the reason the PC was powered on?
Say for example the following challenge:
- start Windows if someone powers it on via the power button
- start Linux if the system was powered on via LAN or a bios timer event
This would enable some general PC to also function as a remote backup PC. The user of the PC wants to start Windows if he powers it on via the Power Button. But additionally to that there is a timer event starting the PC at night for remote backups running at that time and the backup solution is for Linux.
I tried to find a solution using grub, systemd-boot, rEFInd and even the Windows Boot Manager with no success. It seems none of the famous boot managers is able to switch the boot entry based on the power up reason given by the UEFI.
Technically it should be possible, as dmidecode can show the reason:
Handle 0x0001, DMI type 1, 27 bytes
System Information
...
Wake-up Type: LAN Remote
vs.
Wake-up Type: Power Switch
(the first one was powered on via Intel AMT, the second one by the power switch, as an example)
It seems still no one has implemented that?
(the next problem would be to have a working Secure Boot + TPM hard disk decrypt operation for both systems... but this one is of no interest if there is no reason)
best regards
hede