From b48ff3db079c6384e4bff739f75875970cfe58b4 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Fri, 9 Oct 2020 18:21:51 -0400 Subject: [PATCH] razer-cheryl2: Add workaround for weirdness in normal boot --- devices/razer-cheryl2/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices/razer-cheryl2/default.nix b/devices/razer-cheryl2/default.nix index ae782d3a..05560f3b 100644 --- a/devices/razer-cheryl2/default.nix +++ b/devices/razer-cheryl2/default.nix @@ -65,4 +65,23 @@ mobile.usb.gadgetfs.functions = { rndis = "gsi.rndis"; }; + + mobile.boot.stage-1.tasks = [ + # This works around an issue with the default boot and the panel. + # Instead we reboot in recovery mode where it just works :/ + (pkgs.writeText "reboot_recovery.rb" '' + class Tasks::MaybeRebootToRecovery < SingletonTask + def initialize() + add_dependency(:Files, "/proc/cmdline") + end + + def run() + if File.read("/proc/cmdline").match(/mdss_dsi_nt36830_wqhd_dualdsi_extclk_cmd_10bit/) + $logger.info("HACK!! Rebooting to recovery to have a working display...") + System.run("reboot", "recovery") + end + end + end + '') + ]; }