mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2025-01-06 03:27:17 +03:00
b4e6f98fc6
Allows running in the simulator.
31 lines
722 B
Ruby
31 lines
722 B
Ruby
module Hal
|
|
module RebootModes
|
|
extend self
|
|
|
|
Android = {
|
|
"recovery" => ["Reboot to recovery", ->() { run("reboot recovery") }],
|
|
"bootloader" => ["Reboot to bootloader", ->() { run("reboot bootloader") }],
|
|
}
|
|
|
|
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") }],
|
|
] +
|
|
reboot_modes.map do |identifier|
|
|
const, key = identifier.split(".", 2)
|
|
const_get(const)[key]
|
|
end
|
|
end
|
|
end
|
|
end
|