Lakka: use different shutdown/reboot system commands

To avoid any filesystem corruption during shutdown/reboot a sleep is
added before shutdown/reboot is called. Also no quit is called, as the
RetroArch process will be killed by systemd. Quitting RetroArch may
result in unwanted restart of RetroArch by systemd.

Upstream of patch used by Lakka at build time
1943ad296e/packages/libretro/retroarch/patches/retroarch-02-graceful-shutdown-reboot-hack.patch
This commit is contained in:
Tomáš Kelemen (vudiq) 2021-11-17 20:30:17 +01:00
parent 0867227293
commit be92517b16
No known key found for this signature in database
GPG Key ID: 5CE55E600E0B3B22

View File

@ -4727,8 +4727,12 @@ bool command_event(enum event_command cmd, void *data)
runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_SHUTTING_DOWN), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
}
#ifdef HAVE_LAKKA
system("(sleep 1 && shutdown -P now) & disown");
#else
command_event(CMD_EVENT_QUIT, NULL);
system("shutdown -P now");
#endif /* HAVE_LAKKA */
#endif
break;
case CMD_EVENT_REBOOT:
@ -4738,8 +4742,12 @@ bool command_event(enum event_command cmd, void *data)
runloop_msg_queue_push(msg_hash_to_str(MSG_VALUE_REBOOTING), 1, 180, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
}
#ifdef HAVE_LAKKA
system("(sleep 1 && shutdown -r now) & disown");
#else
command_event(CMD_EVENT_QUIT, NULL);
system("shutdown -r now");
#endif /* HAVE_LAKKA */
#endif
break;
case CMD_EVENT_RESUME: