5
I'm looking for a more elegant way of choosing which OS to boot than using the menu provided by grub, and I think it would be neat to have a switch on the case with two states (e.g. Ubuntu and Windows), that decide which OS will be loaded. I've been doing some thinking, and it seems to me like you should be able to solve it by hooking the switch to a PWM generator, and connect the generator to a fan speed input pin. Then from grub read the fan speed, and do a conditional test that determines which OS to load.
In pseudocode:
if (fan.speed > threshold) then
load Windows;
else
load Ubuntu;
end
My two questions are therefore:
- How do you use a test with grub to determine which OS to start?
- How can you read the fan speed from grub during startup?
Other solutions and ideas are of course welcome as well :)
If you mask all the keys except for <kbd>8<\kbd> and <kbd>2</kbd>, you can use this solution for your problem
– Prasanna – 2016-03-14T14:02:06.6171I have done this to switch between a primary and secondary hdd. The concept is the same. Splice the power cable, to both hdds, to the mechanical switch. When turned to A power goes to A and when turned to B power goes to B – Ramhound – 2016-03-16T16:40:25.523