Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit 756212c

Browse files
committed
tg5040: another potential fix for hung shutdowns
deprecate all the things
1 parent b2a8111 commit 756212c

5 files changed

Lines changed: 42 additions & 20 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@ Extras:
6666

6767
| Device | Added | Status |
6868
| -- | -- | -- |
69-
| Anbernic RG28xx | MinUI-20240429b-2 | Maintained |
70-
| Anbernic RG34xx | MinUI-20241227-0 | Maintained |
69+
| Anbernic RG28xx | MinUI-20240429b-2 | Deprecated |
70+
| Anbernic RG34xx | MinUI-20241227-0 | Deprecated |
7171
| Anbernic RG35xx | MinUI-20230922b-2 | Deprecated |
72-
| Anbernic RG35xx Plus | MinUI-20240106b-0 | Maintained |
73-
| Anbernic RG35xxH | MinUI-20240120b-1 | Maintained |
74-
| Anbernic RG35xxSP | MinUI-20240525-0 | Maintained |
75-
| Anbernic RG40xxH | MinUI-20240717-1 | Maintained |
76-
| Anbernic RG40xxV | MinUI-20240831-0 | Maintained |
77-
| Anbernic RG CubeXX | MinUI-202401028-0 | Active |
72+
| Anbernic RG35xx Plus | MinUI-20240106b-0 | Deprecated |
73+
| Anbernic RG35xxH | MinUI-20240120b-1 | Deprecated |
74+
| Anbernic RG35xxSP | MinUI-20240525-0 | Deprecated |
75+
| Anbernic RG40xxH | MinUI-20240717-1 | Deprecated |
76+
| Anbernic RG40xxV | MinUI-20240831-0 | Deprecated |
77+
| Anbernic RG CubeXX | MinUI-202401028-0 | Maintained |
7878
| GKD Pixel | MinUI-20240120b-1 | Deprecated |
7979
| M17 | MinUI-20231126b-2 | Deprecated |
8080
| MagicX XU Mini M | MinUI-20240831-0 | Deprecated |
81-
| MagicX Mini Zero 28 | MinUI-20250111-0 | Active |
81+
| MagicX Mini Zero 28 | MinUI-20250111-0 | Maintained |
8282
| Miyoo A30 | MinUI-20240705-0 | Maintained |
83-
| Miyoo Flip | MinUI-20250111-0 | Active |
83+
| Miyoo Flip | MinUI-20250111-0 | Deprecated |
8484
| Miyoo Mini | MinUI-20230922b-2 | Deprecated |
8585
| Miyoo Mini Plus | MinUI-20230922b-2 | Deprecated |
8686
| Powkiddy RGB30 | MinUI-20231014b-1 | Deprecated |
87-
| Trimui Brick | MinUI-20241028-0 | Active |
87+
| Trimui Brick | MinUI-20241028-0 | Deprecated |
8888
| Trimui Smart | MinUI-20230922b-2 | Deprecated |
8989
| Trimui Smart Pro | MinUI-20231111b-2 | Maintained |
9090

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
date > $LOGS_PATH/shutdown.txt
4+
5+
printf s >/proc/sysrq-trigger 2>/dev/null
6+
printf u >/proc/sysrq-trigger 2>/dev/null
7+
printf o >/proc/sysrq-trigger 2>/dev/null
8+
9+
# should never reach here
10+
exec /sbin/poweroff -f
11+
12+
# should really never reach here
13+
sleep 60

todo.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,20 @@ EXTRAS
1111

1212
---
1313

14+
tg5040
15+
- stock MainUI just does poweroff then sleep 60
16+
- could this be responsible?
17+
else if (event.type==SDL_QUIT) PWR_powerOff();
18+
I _think_ I still encountered a hang after commenting this out
19+
but it was only used for macOS so I'm leaving it off
20+
- ChatGPT suggested changing /etc/init.d/runtrimui
21+
(not /usr/trimui/bin/runtrimui.sh)
22+
to a procd service to avoid a busybox race condition
23+
I have observed the issue even with this setup
24+
1425
all
26+
deprecate everything
27+
start fresh with even less
1528
pulled SND_* from [REDACTED]
1629
no issues with sound quality but
1730
PS games crash on load...

workspace/all/common/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ FALLBACK_IMPLEMENTATION void PLAT_pollInput(void) {
13251325
btn = BTN_NONE;
13261326
}
13271327
}
1328-
else if (event.type==SDL_QUIT) PWR_powerOff();
1328+
// else if (event.type==SDL_QUIT) PWR_powerOff(); // added for macOS debug
13291329

13301330
if (btn==BTN_NONE) continue;
13311331

workspace/tg5040/platform/platform.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ void PLAT_enableBacklight(int enable) {
514514
}
515515

516516
void PLAT_powerOff(void) {
517-
system("rm -f /tmp/minui_exec && sync");
517+
unlink("/tmp/minui_exec");
518518
sleep(2);
519519

520520
SetRawVolume(MUTE_VOLUME_RAW);
@@ -524,13 +524,9 @@ void PLAT_powerOff(void) {
524524
PWR_quit();
525525
GFX_quit();
526526

527-
system("ifconfig wlan0 down");
528-
system("killall -15 wpa_supplicant");
529-
system("killall -9 udhcpc");
530-
system("cat /dev/zero > /dev/fb0 2>/dev/null");
531-
system("poweroff");
532-
// exit(0);
533-
while (1) pause(); // lolwat
527+
// stock does this (except with native poweroff)
528+
system("shutdown");
529+
sleep(60);
534530
}
535531

536532
///////////////////////////////

0 commit comments

Comments
 (0)