From 9688741cc32bbe03d5bcd7f6689fd2266aa25186 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Tue, 14 Apr 2026 15:43:12 -0700 Subject: [PATCH] =?UTF-8?q?native:=20install-reboot=20(SDL=20path)=20?= =?UTF-8?q?=E2=86=92=20ac=5Freboot()=20instead=20of=20=5Fexit(0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The SDL init path's post-install reboot hit `_exit(0)` after trying sysrq-b + reboot -f. Exit code 0 tells init.sh "POWER OFF, don't reboot", so if the reboot attempts failed, init.sh would drop into its poweroff branch and wait forever instead of trying its own fallback ladder (reboot -f → sysrq-b → halt -f → sysrq-c panic). Route both install paths through ac_reboot() for consistency — reboot(2) syscall tries UEFI ResetSystem first (reboot=efi,cold), then systemctl/busybox reboot fallbacks, then _exit(2) which keys init.sh's reboot branch. Matches what os.mjs's "y: reboot" flow already does. Co-Authored-By: Claude Opus 4.6 (1M context) --- fedac/native/src/ac-native.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/fedac/native/src/ac-native.c b/fedac/native/src/ac-native.c index 0f50667cc..39cd8702f 100644 --- a/fedac/native/src/ac-native.c +++ b/fedac/native/src/ac-native.c @@ -2996,13 +2996,18 @@ int main(int argc, char *argv[]) { int should_reboot = draw_install_reboot_prompt(&graph, screen, display, input, tts, audio, install_ok, pixel_scale); if (should_reboot) { if (tts) tts_wait(tts); // let TTS finish before reboot - sync(); - usleep(500000); // 0.5s grace - // sysrq reboot (most reliable under initramfs) - FILE *sr = fopen("/proc/sysrq-trigger", "w"); - if (sr) { fputs("b", sr); fclose(sr); } - system("reboot -f"); - _exit(0); + // Use the shared ac_reboot() path — it tries reboot(2) + // syscall first (reboot=efi,cold cmdline steers this + // to UEFI ResetSystem which is the only consistently + // working path on coreboot Chromebooks), falls back + // to systemctl / busybox reboot -f, then finally + // _exit(2) so init.sh sees "reboot requested" and + // re-enters its own multi-tiered reboot loop + // (reboot -f → sysrq-b → halt -f → sysrq-c panic). + // The old path here did `_exit(0)` which triggered + // init.sh's POWEROFF branch, so a failing reboot(2) + // would hang waiting to power off instead of retrying. + ac_reboot(); } } } -- 2.51.2