From 0c04783a865eedaf8f7507abdc432eb1d85ca010 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sat, 30 Jul 2022 10:54:33 +0900 Subject: [PATCH] main: Check for SIP disable for proxy backdoor mode Seems -v stopped being filtered (or never was?). Explicitly check boot policy, so we don't depend on boot-args filtering directly (which can change). -v still makes things verbose unconditionally, but the proxy backdoor now requires that plus full SIP disable (sip0=127). Signed-off-by: Hector Martin --- src/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index e2d4698f..a80491e7 100644 --- a/src/main.c +++ b/src/main.c @@ -65,7 +65,15 @@ void run_actions(void) #ifndef BRINGUP #ifdef EARLY_PROXY_TIMEOUT - if (!cur_boot_args.video.display) { + int node = adt_path_offset(adt, "/chosen/asmb"); + u64 lp_sip0 = 0; + + if (node >= 0) { + ADT_GETPROP(adt, node, "lp-sip0", &lp_sip0); + printf("Boot policy: sip0 = %ld\n", lp_sip0); + } + + if (!cur_boot_args.video.display && lp_sip0 == 127) { printf("Bringing up USB for early debug...\n"); usb_init();