mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-12 15:24:14 +03:00
boot/lib: Make reboot modes HAL more robust
Allows running in the simulator.
This commit is contained in:
parent
2410994f17
commit
b4e6f98fc6
@ -1,15 +1,27 @@
|
||||
module Hal
|
||||
module RebootModes
|
||||
extend self
|
||||
|
||||
Android = {
|
||||
"recovery" => ["Reboot to recovery", ->() { run("reboot recovery") }],
|
||||
"bootloader" => ["Reboot to bootloader", ->() { run("reboot bootloader") }],
|
||||
}
|
||||
|
||||
def self.options()
|
||||
def reboot_modes()
|
||||
if Configuration["HAL"] &&
|
||||
Configuration["HAL"]["boot"] &&
|
||||
Configuration["HAL"]["boot"]["rebootModes"]
|
||||
Configuration["HAL"]["boot"]["rebootModes"]
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
|
||||
def options()
|
||||
[
|
||||
["Reboot to system", ->() { run("reboot") }],
|
||||
] +
|
||||
Configuration["HAL"]["boot"]["rebootModes"].map do |identifier|
|
||||
reboot_modes.map do |identifier|
|
||||
const, key = identifier.split(".", 2)
|
||||
const_get(const)[key]
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user