1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-16 20:21:32 +03:00

Merge pull request #261 from samueldr-wip/devices/razer-cheryl2/workaround-qol

razer-cheryl2: Workaround made more descriptive
This commit is contained in:
Samuel Dionne-Riel 2020-12-27 17:24:49 -05:00 committed by GitHub
commit 17474b48f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,8 +75,17 @@
add_dependency(:Files, "/proc/cmdline")
end
def booted_with_recovery_fdt?()
# TODO: actually detect FDT using /proc/device-tree
cmdline = File.read("/proc/cmdline")
[
# Assume presence of that cmdline means it booted with normal boot
!cmdline.match(/mdss_dsi_nt36830_wqhd_dualdsi_extclk_cmd_10bit/),
].any?()
end
def run()
if File.read("/proc/cmdline").match(/mdss_dsi_nt36830_wqhd_dualdsi_extclk_cmd_10bit/)
unless booted_with_recovery_fdt?()
$logger.info("HACK!! Rebooting to recovery to have a working display...")
System.run("reboot", "recovery")
end