-
Notifications
You must be signed in to change notification settings - Fork 1
Add initial support for LessOS #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0bcada0
Add LessOS generic entry point and rk3566 platform
nchapman afcbef5
Add LessOS boot flow matching stock platform pattern.
nchapman c367d28
Enable OpenGL ES rendering for rk3566 platform.
nchapman df47fea
Add runtime path resolution system.
nchapman af3320d
Update applications to use runtime paths.
nchapman 9b0a250
Fix rk3566 platform for LessOS.
nchapman beeb6ca
Update test infrastructure for runtime paths.
nchapman 03931bd
Clean up rk3566 docs.
nchapman 9e9e531
Undo tg5040 changes.
nchapman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/sh | ||
| # LessOS Bootstrap for LessUI | ||
| # Mirrors stock platform hijack scripts (miyoomini.sh, etc.) | ||
| # | ||
| # LessOS provides these environment variables before calling this script: | ||
| # LESSOS_PLATFORM - SoC/platform family (e.g., "RK3566") | ||
| # LESSOS_DEVICE - Specific device model (e.g., "Powkiddy RGB30") | ||
| # LESSOS_STORAGE - Writable storage path (e.g., "/storage") | ||
|
|
||
| SDCARD_PATH="${LESSOS_STORAGE:-/storage}" | ||
| SCRIPT_DIR="$(dirname "$0")" | ||
|
|
||
| # Copy .tmp_update to SD card (like miyoomini.sh does) | ||
| # This ensures the updater and platform boot scripts are in place | ||
| if [ -d "$SCRIPT_DIR/.tmp_update" ]; then | ||
| cp -rf "$SCRIPT_DIR/.tmp_update" "$SDCARD_PATH/" | ||
| sync | ||
| fi | ||
|
|
||
| # Run the updater (handles platform detection, updates, and launching) | ||
| "$SDCARD_PATH/.tmp_update/updater" | ||
|
|
||
| # Fallback if updater exits unexpectedly | ||
| reboot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/sh | ||
|
|
||
| if [ -n "$DATETIME_PATH" ]; then | ||
| echo `date +'%F %T'` > "$DATETIME_PATH" | ||
| sync | ||
| fi | ||
|
|
||
| cat /dev/zero > /dev/fb0 | ||
| poweroff | ||
| # echo s > /proc/sysrq-trigger | ||
| # echo u > /proc/sysrq-trigger | ||
| # echo o > /proc/sysrq-trigger |
Empty file.
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| -player_screen_sharpness = Crisp | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /** | ||
| * paths_stub.c - Test stub for runtime paths | ||
| * | ||
| * Provides initialized path globals for unit testing. | ||
| * Uses values from tests/support/platform.h (SDCARD_PATH="/tmp/test") | ||
| */ | ||
|
|
||
| #include "paths.h" | ||
|
|
||
| #include <string.h> | ||
|
|
||
| // Initialize paths with test values | ||
| char g_sdcard_path[PATHS_MAX_LEN] = "/tmp/test"; | ||
| char g_roms_path[PATHS_MAX_LEN] = "/tmp/test/Roms"; | ||
| char g_root_system_path[PATHS_MAX_LEN] = "/tmp/test/.system"; | ||
| char g_system_path[PATHS_MAX_LEN] = "/tmp/test/.system/test"; | ||
| char g_res_path[PATHS_MAX_LEN] = "/tmp/test/.system/res"; | ||
| char g_font_path[PATHS_MAX_LEN] = "/tmp/test/.system/res/font.ttf"; | ||
| char g_userdata_path[PATHS_MAX_LEN] = "/tmp/test/.userdata/test"; | ||
| char g_shared_userdata_path[PATHS_MAX_LEN] = "/tmp/test/.userdata/shared"; | ||
| char g_paks_path[PATHS_MAX_LEN] = "/tmp/test/.system/test/paks"; | ||
| char g_recent_path[PATHS_MAX_LEN] = "/tmp/test/.userdata/shared/.launcher/recent.txt"; | ||
| char g_simple_mode_path[PATHS_MAX_LEN] = "/tmp/test/.userdata/test/.simple_mode"; | ||
| char g_auto_resume_path[PATHS_MAX_LEN] = "/tmp/test/.userdata/test/.auto_resume"; | ||
| char g_faux_recent_path[PATHS_MAX_LEN] = "/tmp/test/Recently Played"; | ||
| char g_collections_path[PATHS_MAX_LEN] = "/tmp/test/Collections"; | ||
|
|
||
| static int s_initialized = 1; // Pre-initialized for tests | ||
|
|
||
| void Paths_init(void) { | ||
| // No-op for tests - already initialized with test values | ||
| } | ||
|
|
||
| int Paths_isInitialized(void) { | ||
| return s_initialized; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,9 @@ | |
| }, | ||
| "tg5040": { | ||
| "platform": "linux/amd64" | ||
| }, | ||
| "rk3566": { | ||
| "platform": "linux/amd64" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| /** | ||
| * paths.c - Runtime path resolution for dynamic storage locations | ||
| * | ||
| * Initializes all runtime paths based on environment variables or defaults. | ||
| */ | ||
|
|
||
| #include "paths.h" | ||
| #include "log.h" | ||
| #include "platform.h" | ||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
|
|
||
| // Runtime path storage | ||
| char g_sdcard_path[PATHS_MAX_LEN]; | ||
| char g_roms_path[PATHS_MAX_LEN]; | ||
| char g_root_system_path[PATHS_MAX_LEN]; | ||
| char g_system_path[PATHS_MAX_LEN]; | ||
| char g_res_path[PATHS_MAX_LEN]; | ||
| char g_font_path[PATHS_MAX_LEN]; | ||
| char g_userdata_path[PATHS_MAX_LEN]; | ||
| char g_shared_userdata_path[PATHS_MAX_LEN]; | ||
| char g_paks_path[PATHS_MAX_LEN]; | ||
| char g_recent_path[PATHS_MAX_LEN]; | ||
| char g_simple_mode_path[PATHS_MAX_LEN]; | ||
| char g_auto_resume_path[PATHS_MAX_LEN]; | ||
| char g_faux_recent_path[PATHS_MAX_LEN]; | ||
| char g_collections_path[PATHS_MAX_LEN]; | ||
|
|
||
| static int s_initialized = 0; | ||
|
|
||
| void Paths_init(void) { | ||
| if (s_initialized) { | ||
| return; | ||
| } | ||
|
|
||
| // Check for LessOS storage environment variable | ||
| const char* env_storage = getenv("LESSOS_STORAGE"); | ||
| if (env_storage && env_storage[0] != '\0') { | ||
| strncpy(g_sdcard_path, env_storage, PATHS_MAX_LEN - 1); | ||
| g_sdcard_path[PATHS_MAX_LEN - 1] = '\0'; | ||
| LOG_info("Paths_init: Using LESSOS_STORAGE=%s", g_sdcard_path); | ||
| } else { | ||
| // Fall back to compile-time default | ||
| strncpy(g_sdcard_path, SDCARD_PATH, PATHS_MAX_LEN - 1); | ||
| g_sdcard_path[PATHS_MAX_LEN - 1] = '\0'; | ||
| LOG_info("Paths_init: Using default SDCARD_PATH=%s", g_sdcard_path); | ||
| } | ||
|
|
||
| // Build all derived paths | ||
| (void)snprintf(g_roms_path, PATHS_MAX_LEN, "%s/Roms", g_sdcard_path); | ||
| (void)snprintf(g_root_system_path, PATHS_MAX_LEN, "%s/.system/", g_sdcard_path); | ||
| (void)snprintf(g_system_path, PATHS_MAX_LEN, "%s/.system/%s", g_sdcard_path, PLATFORM); | ||
| (void)snprintf(g_res_path, PATHS_MAX_LEN, "%s/.system/res", g_sdcard_path); | ||
| (void)snprintf(g_font_path, PATHS_MAX_LEN, "%s/.system/res/InterTight-Bold.ttf", g_sdcard_path); | ||
| (void)snprintf(g_userdata_path, PATHS_MAX_LEN, "%s/.userdata/%s", g_sdcard_path, PLATFORM); | ||
| (void)snprintf(g_shared_userdata_path, PATHS_MAX_LEN, "%s/.userdata/shared", g_sdcard_path); | ||
| (void)snprintf(g_paks_path, PATHS_MAX_LEN, "%s/paks", g_system_path); | ||
| (void)snprintf(g_recent_path, PATHS_MAX_LEN, "%s/.launcher/recent.txt", g_shared_userdata_path); | ||
| (void)snprintf(g_simple_mode_path, PATHS_MAX_LEN, "%s/enable-simple-mode", | ||
| g_shared_userdata_path); | ||
| (void)snprintf(g_auto_resume_path, PATHS_MAX_LEN, "%s/.launcher/auto_resume.txt", | ||
| g_shared_userdata_path); | ||
| (void)snprintf(g_faux_recent_path, PATHS_MAX_LEN, "%s/Recently Played", g_sdcard_path); | ||
| (void)snprintf(g_collections_path, PATHS_MAX_LEN, "%s/Collections", g_sdcard_path); | ||
|
|
||
| LOG_debug("Paths_init: g_roms_path=%s", g_roms_path); | ||
| LOG_debug("Paths_init: g_system_path=%s", g_system_path); | ||
| LOG_debug("Paths_init: g_res_path=%s", g_res_path); | ||
| LOG_debug("Paths_init: g_paks_path=%s", g_paks_path); | ||
|
|
||
| s_initialized = 1; | ||
| } | ||
|
|
||
| int Paths_isInitialized(void) { | ||
| return s_initialized; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
g_root_system_pathincludes a trailing slash in line 52 ("%s/.system/"), but other paths don't consistently use trailing slashes. This inconsistency could lead to malformed paths if code elsewhere doesn't expect the trailing slash. Consider removing it for consistency, or document why it's needed here.