19 Commits

Author SHA1 Message Date
Douglas Teles e4294ab47b Two-image build pipeline, clone support, initramfs splash
- Clone variant: mainline U-Boot v2025.10, boot.scr, clone DTS (type5)
- Initramfs splash: archr-init.c with embedded BMP, sub-second display
- Panel wizard: auto-detect with fsync persistence, evdev X-button reset
- Hotkeys: adc-keys volume for clone, HP jack detection, brightness persist
- Boot.ini: ASCII-only (no Unicode), GPIO check removed
- ES wrapper: removed framebuffer blanking (preserves splash)
- Build pipeline: both variants, splash generation, panel DTBOs
- .gitignore: exclude large bootloader trees and build artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 22:38:47 -03:00
Douglas Teles 70765e96bd update 26.02.25 2026-02-25 17:22:34 -03:00
Douglas Teles 2ccf5383ac update 26.02.23 2026-02-23 03:03:09 -03:00
Douglas Teles 476b05cd9a fix roadmap 2026-02-22 14:46:19 -03:00
Douglas Teles a9029b419f Fix ROADMAP.md diary timeline ordering
Move Day 17-18 entry to correct chronological position
(before "What's Left for v1.0 Stable", not after it).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:43:37 -03:00
Douglas Teles 18c229177a First successful build — 11 pipeline gaps fixed, repo organized
Build pipeline now produces a working bootable image. Found and fixed
11 gaps between the manually-built working SD and build-all.sh output:

Boot partition:
- extlinux.conf as primary boot method (U-Boot loads first)
- PanCho removed from boot.ini and build-image.sh
- Stale uInitrd removed (caused wrong boot path)
- logo.bmp (U-Boot native BMP) replaces broken splash-1.raw
- fstab uses LABEL=ROMS instead of /dev/mmcblk1p3
- Only R36S DTB copied (no extra r35s/rg351mp-linux)

Root filesystem:
- emulationstation.service created and enabled
- getty@tty1 disabled (ES takes over tty1)
- archr-boot-setup: Before=emulationstation.service, simplified
- All services use After=local-fs.target (not removed getty)
- boot-timing captures ES profiling data

New files added to repo:
- build-mesa.sh, build-retroarch.sh (were untracked)
- Custom DTS, ALSA config, controller autoconfig
- Runtime scripts (retroarch-launch, pmic-poweroff, hotkeys)
- VLC stub source, timezone data

Repo cleanup:
- README.md rewritten with build instructions + architecture
- .gitignore expanded (test scripts, failed approaches, logs)
- splash-show.sh removed (failed splash approach)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:01:13 -03:00
Douglas Teles 351e024374 update 26.02.19 2026-02-20 03:14:24 -03:00
Douglas Teles 4b88153812 update 26.02.18 2026-02-18 23:46:36 -03:00
Douglas Teles 54e8201a6f update 26.02.17/18 2026-02-18 00:34:51 -03:00
Douglas Teles 9aa062e0fc update 26.02.15 2026-02-15 23:37:25 -03:00
Douglas Teles 6b1934155a update 26.02.14/15 2026-02-15 02:27:02 -03:00
Douglas Teles a580bd3ce0 update 26.02.13/14 2026-02-14 04:14:39 -03:00
Douglas Teles 68b9ff798a Audio card working, LD_PRELOAD fix, volume/brightness hotkey fixes
Audio (3-iteration DTS fix chain):
- Removed duplicate pinctrl from codec node (pin conflict)
- Fixed sound-dai to reference &rk817_codec (MFD of_node mismatch)
- Removed DAPM routing/widgets (BSP codec has no DAPM widgets)
- Added 7 missing battery BSP properties

Runtime fixes:
- unset_preload.so prevents gl4es LD_PRELOAD inheritance to subprocesses
- ES Patch 5: getShOutput() null safety for popen() failure
- Volume hotkeys: use 'DAC Playback Volume' (not enum 'Playback')
- Brightness: 5% minimum clamp, persistence across reboots
- current_volume: reads correct ALSA control
- perfmax/perfnorm: guard DMC writes with file existence check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:07:37 -03:00
Douglas Teles 6e0e085eb8 gl4es GPU pipeline, ES display fixes, runtime hardening
GPU rendering:
- Panfrost driver working (6 root causes fixed)
- gl4es cross-compiled for aarch64 (GOA_CLONE=ON)
- ES switched to Desktop GL renderer (-DGL=ON, Renderer_GL21.cpp)
- Pipeline: ES (GL 2.1) → gl4es → GLES 2.0 → Panfrost (Mali-G31)

ES display (5 root causes fixed):
- SDL3 KMSDRM rebuild (ALARM ships without it)
- Autologin approach (systemd service can't get DRM master)
- MAJOR/MINOR version bug fix
- GL context restore after setIcon()
- Null safety for glGetString

New files:
- rebuild-es-sdcard.sh (quick SD card rebuild)
- config/PanCho.ini (18-panel selection)
- config/es_input.cfg (gpio-keys + adc-joystick)
- config/gamecontrollerdb.txt (SDL controller mappings)
- scripts/archr-hotkeys.py (volume, brightness, headphone)
- scripts/test-kmsdrm.py (KMSDRM diagnostic)
- bootloader/u-boot-r36s-working/ (fixed U-Boot)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:42:50 -03:00
Douglas Teles bfda02587e Update ROADMAP.md with detailed development diary
Expanded from summary format to day-by-day diary entries with
technical details: discoveries, failures, root causes, and fixes.
Covers all 16 sessions from Feb 4-11 based on conversation history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:40:09 -03:00
Douglas Teles 2082ac4049 Add ROADMAP.md with full project timeline and release tracking
Documents all milestones from project inception (2026-02-04) through
today's gl4es + Panfrost GPU integration. Tracks what's left for v1.0
stable release. Links from README.md for visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:31:23 -03:00
Douglas Teles 76d126a80f Tons of tons 2026-02-10 01:46:47 -03:00
Douglas Teles 84d7d19283 Add development documentation with technical context 2026-02-04 14:12:57 -03:00
Douglas Teles 487c4f2cbd Initial commit - Arch R project structure 2026-02-04 14:09:18 -03:00
3675 changed files with 51046 additions and 373232 deletions
-30
View File
@@ -1,30 +0,0 @@
---
name: Bug Report
about: Describe this issue
title: "[BUG]"
labels: ISSUE NEEDS REVIEW
assignees: ''
---
### Have you first checked existing issues and documentation for a solution?
[ArchR GitHub Issues](https://github.com/archr-linux/Arch-R/issues)
<!-- Any issue created without sufficient information may be closed. -->
### Describe the bug
<!-- A clear description of what the bug is. -->
### How to reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Play '....'
3. See error
### Information
- ArchR Version: [e.g. 20260316]
- Hardware Platform: [e.g. Powkiddy RGB20SX]
### Log file
<!-- Add debug log files that we can search for errors. -->
### Context
<!-- Add any context about the problem here. -->
-8
View File
@@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Help and Support
url: https://discord.gg/Q5RY3gEuwv
about: Please ask for help and post questions in our Discord
- name: Feature Requests
url: https://discord.gg/Q5RY3gEuwv
about: Please ask for feature requests in our Discord
-119
View File
@@ -1,119 +0,0 @@
&nbsp;&nbsp;<img src="distributions/ArchR/logos/archr-logo.png" width=192>
#
ArchR is a community developed Linux distribution for handheld gaming devices, forked from [ROCKNIX](https://github.com/ROCKNIX/distribution). Our goal is to produce an operating system that has the features and capabilities that we need, and to have fun as we develop it.
## Licenses
ArchR is a Linux distribution forked from ROCKNIX, made up of many open-source components. Components are provided under their respective licenses. This distribution includes components licensed for non-commercial use only.
### ArchR Branding
ArchR branding and images are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).
#### You are free to
* Share — copy and redistribute the material in any medium or format
* Adapt — remix, transform, and build upon the material
#### Under the following terms
* Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
* NonCommercial — You may not use the material for commercial purposes.
* ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
### ArchR Software
Copyright (C) 2024-2026 ArchR (https://github.com/archr-linux). Derived from ROCKNIX, Copyright (C) 2024 ROCKNIX (https://github.com/ROCKNIX).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
## Installation
* Download the latest version of ArchR.
* Decompress the image.
* Write the image to an SDCARD using an imaging tool. Common imaging tools include [Balena Etcher](https://www.balena.io/etcher/), [Raspberry Pi Imager](https://www.raspberrypi.com/software/), and [Win32 Disk Imager](https://sourceforge.net/projects/win32diskimager/). If you're skilled with the command line, dd works fine too.
### Installation Package Downloads
| **Device/Platform** | **Download Package** | **Documentation** |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| **Anbernic RG351P/M/V, Game Console R33S/R35S/R36S, ODROID Go Advance, ODROID Go Super, Magicx XU10, Powkiddy V10/RGB10** | [ArchR-RK3326.aarch64-$DATE-a.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3326.aarch64-$DATE-a.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/RK3326/) |
| **Magicx XU Mini M, Powkiddy RGB10X** | [ArchR-RK3326.aarch64-$DATE-b.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3326.aarch64-$DATE-b.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/RK3326/) |
| **Anbernic RG353P/M/V/VS/PS, RG503, RGARC-D/S, Powkiddy RK2023, RGB10 Max 3, RGB30, RGB20SX, RGB20 Pro** | [ArchR-RK3566.aarch64-$DATE-Generic.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3566.aarch64-$DATE-Generic.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/RK3566/) |
| **Anbernic RG552** | [ArchR-RK3399.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3399.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/RK3399/) |
| **Anbernic RG35XX PLUS/H/SP/2024, RG40XX V/H, RGCUBEXX, RG34XX SP, RG28XX [Must Follow Install Instructions](https://github.com/archr-linux/Arch-R/wiki/h700-installation)** | [ArchR-H700.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-H700.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/H700/) |
| **Hardkernel ODROID Go Ultra, Powkiddy RGB10 Max 3 Pro** | [ArchR-S922X.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-S922X.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/S922X/) |
| **Gameforce Ace (default). Orange Pi 5 / 5 Plus, Radxa Rock 5a / 5b / 5b+ / CM5, and Indiedroid Nova** | [ArchR-RK3588.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3588.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/RK3588/) |
| **Powkiddy x55** | [ArchR-RK3566.aarch64-$DATE-Powkiddy_x55.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3566.aarch64-$DATE-Powkiddy_x55.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/RK3566-X55/) |
| **Retroid Pocket 5, Pocket Mini, Pocket Mini V2, Pocket Flip2** | [ArchR-SM8250.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-SM8250.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/SM8250/) |
| **Ayn Odin 2, Odin 2 Mini, Odin 2 Portal, Thor, Ayaneo Pocket ACE/EVO/DMG/DS** | [ArchR-SM8550.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-SM8550.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/SM8550/) |
| **Ayaneo Pocket S2** | [ArchR-SM8650.aarch64-$DATE.img.gz](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-SM8650.aarch64-$DATE.img.gz) | [documentation](/documentation/PER_DEVICE_DOCUMENTATION/SM8650/) |
## Upgrading
* Download and install the update online via the System Settings menu.
* If you are unable to update online
* Download the latest version of ArchR from Github
* Copy the update to your device over the network to your device's update share.
* Reboot the device, and the update will begin automatically.
### Update Package Downloads
| **Device/Platform** | **Download Package** |
|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| **Anbernic RG351P/M/V, Game Console R33S/R35S/R36S, ODROID Go Advance, ODROID Go Super, Magicx XU10, XU Mini M, Powkiddy V10/RGB10/RGB10X** | [ArchR-RK3326.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3326.aarch64-$DATE.tar) |
| **Anbernic RG353P/M/V/VS/PS, RG503, RGARC-D/S, Powkiddy RK2023, RGB10 Max 3, RGB30, RGB20SX, RGB20 Pro, X55** | [ArchR-RK3566.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3566.aarch64-$DATE.tar) |
| **Anbernic RG552** | [ArchR-RK3399.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3399.aarch64-$DATE.tar) |
| **Anbernic RG35XX PLUS/H/SP/2024, RG40XX V/H, RGCUBEXX, RG34XX SP, RG28XX** | [ArchR-H700.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-H700.aarch64-$DATE.tar) |
| **Hardkernel ODROID Go Ultra, Powkiddy RGB10 Max 3 Pro** | [ArchR-S922X.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-S922X.aarch64-$DATE.tar) |
| **Gameforce Ace, Orange Pi 5 / 5 Plus, Radxa Rock 5a / 5b / 5b+ / CM5 and Indiedroid Nova** | [ArchR-RK3588.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-RK3588.aarch64-$DATE.tar) |
| **Retroid Pocket 5, Pocket Mini, Pocket Mini V2, Pocket Flip2** | [ArchR-SM8250.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-SM8250.aarch64-$DATE.tar) |
| **Ayn Odin 2, Odin 2 Mini, Odin 2 Portal, Thor, Ayaneo Pocket ACE/EVO/DMG/DS** | [ArchR-SM8550.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-SM8550.aarch64-$DATE.tar) |
| **Ayaneo Pocket S2** | [ArchR-SM8650.aarch64-$DATE.tar](https://github.com/archr-linux/Arch-R/releases/download/$DATE/ArchR-SM8650.aarch64-$DATE.tar) |
## Documentation
### Contribute
* [Building ArchR](https://github.com/archr-linux/distribution/wiki/contribute/build/)
* [Code of Conduct](https://github.com/archr-linux/distribution/wiki/contribute/code-of-conduct/)
* [Contributing to ArchR](https://github.com/archr-linux/distribution/wiki/contribute/)
* [Modifying ArchR](https://github.com/archr-linux/distribution/wiki/contribute/modify/)
* [Adding Hardware Quirks](https://github.com/archr-linux/distribution/wiki/contribute/quirks/)
* [Creating Packages](https://github.com/archr-linux/distribution/wiki/contribute/packages/)
* [Pull Request Template](/PULL_REQUEST_TEMPLATE.md)
### Play
* [Installing ArchR](https://github.com/archr-linux/distribution/wiki/play/install/)
* [Updating ArchR](https://github.com/archr-linux/distribution/wiki/play/update/)
* [Controls](https://github.com/archr-linux/distribution/wiki/play/controls/)
* [Netplay](https://github.com/archr-linux/distribution/wiki/play/netplay/)
* [Configuring Moonlight](https://github.com/archr-linux/distribution/wiki/systems/moonlight/)
* [Device Specific Documentation](/documentation/PER_DEVICE_DOCUMENTATION)
### Configure
* [Optimizations](https://github.com/archr-linux/distribution/wiki/configure/optimizations/)
* [Shaders](https://github.com/archr-linux/distribution/wiki/configure/shaders/)
* [Cloud Sync](https://github.com/archr-linux/distribution/wiki/configure/cloud-sync/)
* [VPN](https://github.com/archr-linux/distribution/wiki/configure/vpn/)
### Other
* [Frequently Asked Questions](https://github.com/archr-linux/distribution/wiki/faqs/)
* [Donating to ArchR](https://github.com/archr-linux/Arch-R)
## Change Log
### New Features
* Added...?
### Updates
* Updated...?
### Bug Fixes
* Fixed...?
**Full Changelog**: https://github.com/archr-linux/Arch-R/compare/$LAST_TAG...$DATE
+71 -160
View File
@@ -1,179 +1,90 @@
# build directories
/build.*/
/builds
/.fakeroot.*
.claude
# Build output
output/
# automatically downloaded source files
/sources/
# Kernel and bootloader source (cloned during build)
kernel/src/
bootloader/src/
# prebuild target binarys to provide
/target/
# Build cache
.cache/
rootfs/staging/
# mkpkg temp
mkpkg-temp
# options
/.libreelec
# private working directory
/.work/
# dedicated filesystem
/lost+found/
# symlinks...
/sources
/.work
# ccache
/.ccache/
# backup files
*.orig
# crap
.DS_Store
.directory
Thumbs.db
# Logs
*.log
# Archives and images (build artifacts)
*.tar.gz
*.xz
*.img
# Exception: U-Boot prebuilt binaries
!bootloader/u-boot-r36s-working/*.img
# Datasheets (copyrighted, not distributable)
*.pdf
# temp scripts (debug/install helpers)
fix-debug.sh
install-debug.sh
# Backup/stale configs
*.bak
*.bak-*
config/archr-6.6-r36s.config.bak-pre-splash
# ignore git repos from update scripts
tools/mkpkg/*.git
# Cross-compilation (doesn't work on ARM — use native chroot)
config/toolchain-aarch64.cmake
cross-build-es.sh
# ignore old linux configs
projects/**/*.old
# One-off deploy/diagnostic scripts (not part of build)
deploy-*.sh
diagnose-sd.sh
cleanup-*.sh
read-logs.sh
# Generated MIPI overlay output (regenerated by generator.sh)
config/mipi-generator/output/
# Quick rebuild scripts (development iteration, not part of main build)
quick-*.sh
quick-rebuild-es.sh.backup-patches1-17
# Generated DTBO overlays in u-boot config (copied from mipi-generator output)
projects/ArchR/devices/RK3326/packages/u-boot/config/overlays_original/*.dtbo
projects/ArchR/devices/RK3326/packages/u-boot/config/overlays_clone/*.dtbo
# Failed splash approach (retired)
scripts/archr-splash
scripts/archr-splash.c
scripts/splash-diag.sh
scripts/splash-display.py
scripts/splash-progress.py
scripts/splash-show.sh
# ArchR
/.archr
/.cache
/.doc_cache
/.env
/.es_cache
# Build artifacts from scripts
scripts/__pycache__/
scripts/libvlc-stub-aarch64.so
# Build log .txt files
log-*.txt
# Misc development files
/lib*.so*
/es-log*.txt
/log.txt
/.config
/apply-fix-round4.sh
/fix-sd-issues.sh
reddit-post.md
scripts/auto_suspend_update.sh
# Upstream/legacy distributions (not used by ArchR)
distributions/ROCKNIX/
distributions/LibreELEC/
distributions/LEIoT/
# Mesa recovery script (utility, not part of build)
restore-mesa26-gbm.sh
# Upstream/other platform projects (not used by PROJECT=ArchR)
projects/ROCKNIX/
projects/Allwinner/
projects/Amlogic/
projects/ARM/
projects/Generic/
projects/NXP/
projects/Qualcomm/
projects/Rockchip/
projects/RPi/
projects/Samsung/
# Website (separate project)
website/
# Non-R36S device directories
projects/ArchR/devices/H700/
projects/ArchR/devices/RK3399/
projects/ArchR/devices/RK3566/
projects/ArchR/devices/RK3588/
projects/ArchR/devices/S922X/
projects/ArchR/devices/SDM845/
projects/ArchR/devices/SM8250/
projects/ArchR/devices/SM8550/
projects/ArchR/devices/SM8650/
# Environment secrets
.env
# Non-R36S device documentation
bench-results/*
documentation/PER_DEVICE_DOCUMENTATION/H700/
documentation/PER_DEVICE_DOCUMENTATION/RK3399/
documentation/PER_DEVICE_DOCUMENTATION/RK3566/
documentation/PER_DEVICE_DOCUMENTATION/RK3588/
documentation/PER_DEVICE_DOCUMENTATION/S922X/
documentation/PER_DEVICE_DOCUMENTATION/SDM845/
documentation/PER_DEVICE_DOCUMENTATION/SM8250/
documentation/PER_DEVICE_DOCUMENTATION/SM8550/
documentation/PER_DEVICE_DOCUMENTATION/SM8650/
# Bootloader source trees (cloned/downloaded during build)
bootloader/rkbin/
bootloader/u-boot-mainline/
bootloader/u-boot-rk3326-clone/
# Kodi/mediacenter (MEDIACENTER not set in ArchR)
packages/mediacenter/
# Pre-built U-Boot backups (working binaries, not part of build pipeline)
bootloader/u-boot-clone-working/
# Driver addons (DRIVER_ADDONS_SUPPORT=no in ArchR)
packages/linux-driver-addons/
# Extracted DTBs (debugging artifacts)
bootloader/u-boot-r36s-working/extracted_dtb_*.dtb
# Kodi addons (no MEDIACENTER in ArchR)
# Kodi addons (no MEDIACENTER in ArchR) - keep addon-depends for shared libraries
packages/addons/*
!packages/addons/addon-depends/
# Platform-specific bootloaders/tools (not RK3326)
packages/tools/bcm2835-bootloader/
packages/tools/bcm2835-utils/
packages/tools/bcmstat/
packages/tools/rpi-eeprom/
packages/tools/amlogic-boot-fip/
packages/tools/exynos-boot-fip/
# Firmware not used by R36S (FIRMWARE=esp8089-firmware only)
packages/linux-firmware/brcmfmac_sdio-firmware/
packages/linux-firmware/brcmfmac_sdio-firmware-imx/
packages/linux-firmware/brcmfmac_sdio-firmware-rpi/
packages/linux-firmware/dvb-firmware/
packages/linux-firmware/firmware-dragonboard/
packages/linux-firmware/firmware-imx/
packages/linux-firmware/iwlwifi-firmware/
# Non-R36S CI workflows
.github/workflows/build-aarch64-emu-libretro.yml
.github/workflows/build-aarch64-emu-standalone.yml
.github/workflows/build-aarch64-qt6.yml
.github/workflows/build-aarch64-mame-lr.yml
# Emulators not used by RK3326 (too heavy or Vulkan-only)
projects/ArchR/packages/emulators/standalone/aethersx2-sa/
projects/ArchR/packages/emulators/standalone/azahar-sa/
projects/ArchR/packages/emulators/standalone/bigpemu-sa/
projects/ArchR/packages/emulators/standalone/cemu-sa/
projects/ArchR/packages/emulators/standalone/rpcs3-sa/
projects/ArchR/packages/emulators/standalone/supermodel-sa/
projects/ArchR/packages/emulators/standalone/xemu-sa/
projects/ArchR/packages/emulators/standalone/skyemu-sa/
projects/ArchR/packages/emulators/libretro/kronos-lr/
# Graphics packages not used by RK3326 (no Vulkan on Mali G31)
projects/ArchR/packages/graphics/libmali-vulkan/
projects/ArchR/packages/graphics/vulkan-wsi-layer/
# Qualcomm/non-RK3326 tools
projects/ArchR/packages/tools/archr-abl/
projects/ArchR/packages/tools/qcom-abl/
# Platform-specific base packages (not used by RK3326)
packages/audio/rpi-cirrus-config/
packages/tools/crust/
packages/tools/mkbootimg/
packages/tools/grub/
packages/linux-firmware/firmware-dragonboard/
packages/linux-firmware/firmware-imx/
packages/graphics/nvidia/
packages/multimedia/intel-vaapi-driver/
packages/multimedia/media-driver/
packages/multimedia/gmmlib/
packages/sysutils/open-vm-tools/
#other
docs/*
!docs/improvements.md
!docs/release-policy.md
!docs/fhs-mapping.md
bench-results/config/mipi-generator/__pycache__/
# Clone U-Boot build output
bootloader/u-boot-clone-build/
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 MiB

+90
View File
@@ -0,0 +1,90 @@
# Arch R - Project Documentation
## Project Overview
**Arch R** is a custom Arch Linux ARM-based gaming distribution for the R36S handheld console.
## Hardware Support
- **SoC**: Rockchip RK3326
- **Display**: 640x480 (rotated portrait)
- **USB OTG**: Host mode with VBUS power control
- **Wi-Fi**: AIC8800 USB adapter (with modeswitch support from a69c:5721 to a69c:8801)
- **Multiple R36S hardware revisions**: Multiple DTB support planned
## Build Requirements
- Ubuntu 22.04+ or Arch Linux
- Cross-compilation toolchain (aarch64-linux-gnu-gcc)
- Device Tree Compiler (dtc)
- QEMU for ARM64 userspace emulation
- ~10GB disk space
## Build Process
1. **Setup toolchain**: `sudo ./setup-toolchain.sh`
2. **Source environment**: `source env.sh`
3. **Build kernel**: `./build-kernel.sh`
4. **Build rootfs**: `sudo ./build-rootfs.sh`
5. **Build image**: `sudo ./build-image.sh`
## Key Technical Notes
### USB OTG Configuration
The R36S (when using RG351MP-based firmware) had USB OTG issues due to:
- `otg-port` status set to "disabled" in Device Tree
- `dr_mode` set to "otg" instead of "host"
- Missing `vbus-supply` reference to `otg_switch` regulator (phandle 0xec)
**Solution**: Modify Device Tree to:
```
usb@ff300000 {
dr_mode = "host"; // Force host mode
};
otg-port {
status = "okay"; // Enable OTG port
vbus-supply = <&otg_switch>; // Reference power regulator
};
```
### Wi-Fi Modeswitch
The AIC8800 USB adapter appears first as a CD-ROM device (VID:PID a69c:5721).
A udev rule triggers `/usr/bin/eject` to switch it to Wi-Fi mode (a69c:8801).
See: `config/udev/99-archr-r36s.rules`
### Multiple R36S Revisions
The R36S has multiple hardware revisions requiring different Device Trees.
The build system should be updated to:
1. Include all DTB variants in `/kernel/dts/`
2. Auto-detect hardware revision at boot
3. Load appropriate DTB
## Directory Structure
```
arch-r/
├── bootloader/ # U-Boot configuration
│ └── configs/
├── kernel/ # Kernel and Device Trees
│ ├── configs/ # Kernel defconfig
│ ├── dts/ # Device Tree sources/binaries
│ └── patches/ # Kernel patches
├── rootfs/ # Root filesystem
│ └── overlay/ # Files to overlay on rootfs
├── config/ # System configuration
│ ├── retroarch.cfg # RetroArch config for R36S
│ └── udev/ # udev rules
├── scripts/ # Runtime scripts
└── output/ # Build artifacts
```
## References
- Kernel: dArkOS kernel source (4.4.189)
- Base system: Arch Linux ARM aarch64
- Frontend: RetroArch + EmulationStation
-58
View File
@@ -1,58 +0,0 @@
FROM archlinux:latest
SHELL ["/usr/bin/bash", "-c"]
# Update system and install base packages
# Fix: archlinux:latest has corrupt pacman local db (missing desc files in overlay)
# Step 1: upgrade base system (creates new layer, fixes stale db entries)
RUN pacman-db-upgrade 2>/dev/null; \
for pkg in /var/lib/pacman/local/*/; do \
[ ! -f "${pkg}desc" ] && rm -rf "$pkg" 2>/dev/null; \
done; true
RUN pacman -Syu --noconfirm
# Step 2: clean stale entries from previous layer, then install build deps
RUN for pkg in /var/lib/pacman/local/*/; do \
[ ! -f "${pkg}desc" ] && rm -rf "$pkg" 2>/dev/null; \
done; true
RUN pacman -S --noconfirm --needed \
base-devel bc jdk-openjdk file gawk gettext git go gperf \
perl-json perl-xml-parser ncurses lzop make patchutils \
python python-setuptools parted unzip wget curl \
xorg-mkfontscale libxslt zip vim zstd rdfind automake \
xmlstarlet rsync which sudo rpcsvc-proto perl-parse-yapp xorg-bdftopcf \
dtc python-pip
# Python fdt package for MIPI panel overlay generation
RUN pip3 install --break-system-packages fdt
# Note: GCC downgrade removed - build system compiles its own cross-toolchain (GCC 15.1).
# Host GCC is only used for host tools. Fixes from projects/ArchR/packages/ handle
# any GCC 15 incompatibilities in individual packages (spirv-tools, llvm, etc.)
# Create build user
RUN useradd -m -s /bin/bash docker && \
echo 'docker ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Set locale
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# Ensure Perl tools (pod2man, yapp, etc.) are in standard PATH
RUN for f in /usr/bin/core_perl/*; do [ -f "$f" ] && ln -sf "$f" /usr/bin/ 2>/dev/null; done; \
for f in /usr/bin/vendor_perl/*; do [ -f "$f" ] && ln -sf "$f" /usr/bin/ 2>/dev/null; done; \
true
### Cross compiling on ARM
RUN if [ "$(uname -m)" = "aarch64" ]; then pacman -S --noconfirm qemu-user-static; fi
RUN if [ ! -d /lib64 ]; then ln -sf /usr/x86_64-archr-linux-gnu/lib64 /lib64 2>/dev/null || true; fi
RUN if [ ! -d /lib/x86_64-archr-linux-gnu ]; then ln -sf /usr/x86_64-archr-linux-gnu/lib /lib/x86_64-archr-linux-gnu 2>/dev/null || true; fi
RUN mkdir -p /work && chown docker /work
# Git safe.directory for any user (env-file may override HOME)
RUN git config --system --add safe.directory '*'
WORKDIR /work
USER docker
-33
View File
@@ -1,33 +0,0 @@
<img src="distributions/ArchR/logos/archr-logo.png" width=192>
---
## Licenses
ArchR is a Linux distribution forked from [ROCKNIX](https://github.com/ROCKNIX/distribution), made up of many open-source components. Components are provided under their respective licenses. This distribution includes components licensed for non-commercial use only.
### ArchR Branding
ArchR branding and images are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/). Original ROCKNIX branding remains the property of the ROCKNIX project.
You are free to:
- Share: copy and redistribute the material in any medium or format
- Adapt: remix, transform, and build upon the material
Under the following terms:
- Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial: You may not use the material for commercial purposes.
- ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
### ArchR Software
Copyright 2024-2026 ArchR (https://github.com/archr-linux)
Original software and scripts developed by the ArchR team are licensed under the terms of the [GNU GPL Version 2](https://choosealicense.com/licenses/gpl-2.0/). The full license can be found in this project's licenses folder.
Portions of this software are derived from ROCKNIX, Copyright 2024 ROCKNIX (https://github.com/ROCKNIX).
### Bundled Works
All other software is provided under each component's respective license. These licenses can be found in the software sources or in this project's licenses folder. Modifications to bundled software and scripts by the ArchR team are licensed under the terms of the software being modified.
-129
View File
@@ -1,129 +0,0 @@
-include $(HOME)/.archr/options
# Normalise OFFICIAL once, before any recipe runs. `override` makes
# this assignment win against MAKEFLAGS cmdline propagation, so
# recursive make invocations (build_distro -> make image) see the
# canonical "yes" value instead of the raw "y" / "Y" / "1" the user
# passed on the outer command line. `export` then forwards it to
# every shell, including scripts/image which tests `= "yes"` exact.
override OFFICIAL := $(if $(filter y yes Y YES 1,$(OFFICIAL)),yes,)
export OFFICIAL
all: world
system:
./scripts/image
release:
./scripts/image release
image:
./scripts/image mkimage
noobs:
./scripts/image noobs
clean:
./scripts/makefile_helper --clean
distclean:
./scripts/makefile_helper --distclean
src-pkg:
tar cvJf sources.tar.xz sources
docs:
./tools/foreach './scripts/clean emulators && ./scripts/build emulators'
world: RK3326
kconfig-olddefconfig-%:
DEVICE=$* ./tools/adjust_kernel_config olddefconfig
kconfig-menuconfig-%:
DEVICE=$* ./tools/adjust_kernel_config menuconfig
RK3326:
unset DEVICE_ROOT
OFFICIAL=$(if $(filter y yes Y YES 1,$(OFFICIAL)),yes,) PROJECT=ArchR DEVICE=RK3326 ARCH=arm ./scripts/build_distro
OFFICIAL=$(if $(filter y yes Y YES 1,$(OFFICIAL)),yes,) PROJECT=ArchR DEVICE=RK3326 ARCH=aarch64 ./scripts/build_distro
update:
PROJECT=ArchR DEVICE=RK3326 ARCH=aarch64 ./scripts/update_packages
package:
./scripts/build ${PACKAGE}
package-clean:
./scripts/clean ${PACKAGE}
## Docker builds - overview
# docker-* commands just wire up docker to call the normal make command via docker
# For example: make docker-RK3326 will use docker to call: make RK3326
# All variables are scoped to docker-* commands to prevent weird collisions/behavior with non-docker commands
docker-%: DOCKER_IMAGE := "archr-build:latest"
# DOCKER_WORK_DIR is the directory in the Docker image - it is set to /work by default
# Anytime this directory changes, you must run `make clean` similarly to moving the distribution directory
docker-%: DOCKER_WORK_DIR := $(shell if [ -n "${DOCKER_WORK_DIR}" ]; then echo ${DOCKER_WORK_DIR}; else echo "$$(pwd)" ; fi)
# ${HOME}/.archr/options is a global options file containing developer and build settings.
docker-%: GLOBAL_SETTINGS := $(shell if [ -f "${HOME}/.archr/options" ]; then echo "-v \"${HOME}/.archr/options:${HOME}/.archr/options\""; else echo ""; fi)
# LOCAL_SSH_KEYS_FILE is a variable that contains the location of the authorized keys file for development build use. It will be mounted into the container if it exists.
docker-%: LOCAL_SSH_KEYS_FILE := $(shell if [ -n "${LOCAL_SSH_KEYS_FILE}" ]; then echo "-v \"${LOCAL_SSH_KEYS_FILE}:${LOCAL_SSH_KEYS_FILE}\""; else echo ""; fi)
# EMULATIONSTATION_SRC is a variable that contains the location of local emulationstation source code. It will be mounted into the container if it exists.
docker-%: EMULATIONSTATION_SRC := $(shell if [ -n "${EMULATIONSTATION_SRC}" ]; then echo "-v \"${EMULATIONSTATION_SRC}:${EMULATIONSTATION_SRC}\""; else echo ""; fi)
# UID is the user ID of current user - ensures docker sets file permissions properly
docker-%: UID := $(shell id -u)
# GID is the main user group of current user - ensures docker sets file permissions properly
docker-%: GID := $(shell id -g)
# PWD is 'present working directory' and passes through the full path to current dir to docker (becomes 'work')
docker-%: PWD := $(shell pwd)
# Command to use (either `docker` or `podman`)
docker-%: DOCKER_CMD:= $(shell if which docker 2>/dev/null 1>/dev/null; then echo "docker"; elif which podman 2>/dev/null 1>/dev/null; then echo "podman"; fi)
# Podman requires some extra args (`--userns=keep-id` and `--security-opt=label=disable`). Set those args if using podman
# Make sure that docker isn't just an alias for podman
docker-%: PODMAN_ARGS:= $(shell if echo "$$(docker --version 2>/dev/null || podman --version 2>/dev/null )" | grep podman 1>/dev/null ; then echo "--userns=keep-id --security-opt=label=disable -v /proc/mounts:/etc/mtab"; fi)
# Launch docker as interactive if this is an interactive shell (allows ctrl-c for manual and running non-interactive - aka: build server)
docker-%: INTERACTIVE=$(shell [ -t 0 ] && echo "-it")
# By default pass through anything after `docker-` back into `make`
docker-%: COMMAND=make $*
# If the user issues a `make docker-shell` just start up bash as the shell to run commands
docker-shell: COMMAND=bash
# Command: builds and saves a docker builder image locally.
# The build user must also be a member of the "docker" group.
docker-image-build:
$(DOCKER_CMD) buildx create --use
$(DOCKER_CMD) buildx build --tag $(DOCKER_IMAGE) --platform $(shell if [ "$$(uname -m)" = "aarch64" ]; then echo "linux/arm64"; else echo "linux/amd64"; fi) --load .
# Command: pulls latest docker image from dockerhub. This will *replace* locally built version.
docker-image-pull:
$(DOCKER_CMD) pull $(DOCKER_IMAGE)
# Wire up docker to call equivalent make files using % to match and $* to pass the value matched by %
# After a successful RK3326 build, refresh the overlay-generator website's
# bundled base DTBs (/archr-bases) so they never drift from the shipped image.
# Runs host-side on purpose: the website repo is not mounted into the build
# container. The sync script is itself non-fatal, and the guard keeps it off
# non-build docker targets (docker-shell, docker-update, ...).
# Before any docker build, fail fast if the three shipped input-config
# artifacts drifted from the per-pad definitions (see projects/ArchR/inputs).
# Verification only: the build never rewrites the artifacts by itself.
docker-%:
@./projects/ArchR/inputs/gen-input-configs verify >/dev/null || \
{ ./projects/ArchR/inputs/gen-input-configs verify; exit 1; }
./scripts/get_env > .env
BUILD_DIR="$(DOCKER_WORK_DIR)" $(DOCKER_CMD) run $(PODMAN_ARGS) $(INTERACTIVE) --init --env-file .env --rm --user $(UID):$(GID) $(GLOBAL_SETTINGS) $(LOCAL_SSH_KEYS_FILE) $(EMULATIONSTATION_SRC) -v "$(PWD)":"$(DOCKER_WORK_DIR)" -v /tmp:/tmp -w "$(DOCKER_WORK_DIR)" $(DOCKER_EXTRA_OPTS) $(DOCKER_IMAGE) $(COMMAND)
@if [ "$*" = "RK3326" ]; then ./scripts/repo/sync-site-bases; fi
+211 -138
View File
@@ -1,65 +1,29 @@
<p align="center">
<img src="distributions/ArchR/logos/archr-logo.png" width="280" alt="Arch R" style="background:#000">
</p>
# Arch R
<p align="center">
<strong>Arch Linux-based gaming distribution for handheld devices.</strong>
<img src="ArchR.png" alt="Arch R" width="480">
</p>
<p align="center">
<a href="https://github.com/archr-linux/Arch-R/releases/latest"><img src="https://img.shields.io/github/release/archr-linux/Arch-R.svg?color=0080FF&label=latest%20version&style=flat-square" alt="Latest Version"></a>
<a href="https://github.com/archr-linux/Arch-R/commits"><img src="https://img.shields.io/github/commit-activity/m/archr-linux/Arch-R?color=0080FF&style=flat-square" alt="Activity"></a>
<a href="https://github.com/archr-linux/Arch-R/pulls"><img src="https://img.shields.io/github/issues-pr-closed/archr-linux/Arch-R?color=0080FF&style=flat-square" alt="Pull Requests"></a>
</p>
> **Arch Linux-based gaming distribution for R36S and all clones.**
>
> Leve como uma pluma.
---
Arch R is a custom Linux distribution for the **R36S** handheld gaming console and all its variants, built on top of [ROCKNIX](https://github.com/ROCKNIX/distribution) with an **Arch Linux-based** build environment. It supports **16 board profiles** and **20 display panels** across original and clone hardware.
Arch R is a custom Linux distribution built from scratch for the R36S handheld gaming console (RK3326 SoC, Mali-G31 GPU, 640x480 MIPI DSI display). It supports all R36S variants and clones with 18 different display panels.
## Features
- Arch Linux-based build system with Docker support.
- Kernel 6.12 LTS with board auto-detection via SARADC.
- Mesa Panfrost open-source GPU driver (GLES 3.1, no proprietary blobs).
- EmulationStation frontend with RetroArch and 18+ cores pre-installed.
- Full audio support with speaker/headphone auto-switch.
- Battery monitoring with capacity reporting and LED warning.
- MIPI panel overlays for every known motherboard revision, generated on demand by the online overlay generator at https://arch-r.io/overlay-generator/ (or during flashing by the Arch R Flasher).
- Separate images for original and clone boards, both with hardware auto-detection.
- Integrated cross-device local and remote network play.
- Fine-grained control for battery life and performance.
- Bluetooth audio and controller support (via USB Bluetooth adapter; the boards have no internal radio).
- USB audio devices (DACs, headsets, controllers with audio).
- Device sync with Syncthing and rclone.
- VPN support with WireGuard, Tailscale, and ZeroTier.
- Built-in scraping and RetroAchievements.
- **Kernel 6.6.89** (Rockchip BSP) — custom DTS with joypad, panel init sequences, audio, USB OTG
- **Mesa 26 Panfrost** — open-source GPU driver, GLES 1.0/2.0/3.1, no proprietary blobs
- **EmulationStation** (fcamod fork) — 78fps stable, GLES 1.0 native rendering
- **RetroArch 1.22.2** — KMS/DRM + EGL, 18+ cores pre-installed
- **19-second boot** — U-Boot logo → kernel → systemd → EmulationStation
- **Full audio** — ALSA, speaker + headphone auto-switch, volume hotkeys
- **Battery monitoring** — LED warning, capacity/voltage/temp reporting
- **Multi-panel support** — 18 panel DTBOs (6 original R36S + 12 clones)
## Supported Hardware
## Quick Start — Flash a Pre-built Image
### Boards
| Board | Image |
|-------|-------|
| R36S (original), R33S | Original |
| Odroid Go Advance / v1.1 / Super | Original |
| Anbernic RG351V / RG351M | Original |
| GameForce Chi, MagicX XU10 | Original |
| K36 / R36S clones / EE Clone | Clone |
| Powkiddy RGB10 / RGB10X / RGB20S | Clone |
| MagicX XU-Mini-M, BatLexp G350 | Clone |
### Display Panels
Panel overlays are not baked into the images. Generate the overlay for your exact motherboard revision at the online generator, https://arch-r.io/overlay-generator/ (pick your board, or upload the stock `dtb` from the SD card that shipped with the device), then copy the resulting file to `overlays/mipi-panel.dtbo` on the boot partition. The Arch R Flasher can also generate and install the overlay during flashing. The `/flash/overlays/` folder on a fresh install contains a `README.txt` with the same instructions.
## Quick Start
Download the latest images from [Releases](https://github.com/archr-linux/Arch-R/releases):
- **Original image** -- for genuine R36S and compatible boards.
- **Clone image** -- for K36 clones and compatible boards.
Flash to a MicroSD card:
Download the latest image from [Releases](../../releases), then:
```bash
xz -d ArchR-R36S-*.img.xz
@@ -67,113 +31,222 @@ sudo dd if=ArchR-R36S-*.img of=/dev/sdX bs=4M status=progress
sync
```
Insert the SD card and power on. The correct board DTB is selected automatically.
Insert the SD card into your R36S and power on. First boot creates a ROMS partition automatically.
## Building from Source
### Requirements
### Host Requirements
- Docker (recommended) or native Linux build environment
- ~40 GB free disk space
- ~8 GB RAM recommended
- **OS:** Ubuntu 22.04+ (or any Linux with QEMU user-static support)
- **Disk:** 30GB+ free space
- **RAM:** 4GB+ recommended
- **Time:** ~3-4 hours (first build), ~1 hour (incremental)
### Build
### Install Dependencies
```bash
git clone https://github.com/archr-linux/Arch-R.git
cd Arch-R
# Build Docker image (first time only)
make docker-image-build
# Build for R36S (all variants)
make docker-RK3326
sudo apt install -y \
gcc-aarch64-linux-gnu \
qemu-user-static \
binfmt-support \
parted \
dosfstools \
e2fsprogs \
rsync \
xz-utils \
imagemagick \
device-tree-compiler \
git \
bc \
flex \
bison \
libssl-dev
```
Output images are generated in `target/`.
### Build Everything
### Build Commands
```bash
git clone --recurse-submodules https://github.com/user/Arch-R.git
cd Arch-R
| Command | Description |
|---------|-------------|
| `make docker-RK3326` | Full build inside Docker |
| `make RK3326` | Native build (requires all dependencies) |
| `make docker-image-build` | Build the Docker build environment |
| `make clean` | Remove build artifacts |
# Full build (kernel + rootfs + mesa + ES + retroarch + panels + image)
sudo ./build-all.sh
```
## Architecture
The flashable image will be at `output/images/ArchR-R36S-YYYYMMDD.img.xz` (~860MB compressed).
Arch R separates **board configuration** from **panel configuration**:
### Build Individual Components
- **Board DTB** = hardware profile (GPIOs, PMIC, joypad, audio codec). Selected automatically by U-Boot via SARADC.
- **Panel overlay** = display init sequence and timings. Applied on top of the board DTB at boot time.
```bash
sudo ./build-all.sh --kernel # Kernel only (~10 min)
sudo ./build-all.sh --rootfs # Rootfs + Mesa + ES + RetroArch (~3 hours)
sudo ./build-all.sh --image # Image assembly only (~2 min)
sudo ./build-all.sh --clean # Remove all build artifacts
```
This means the same image works on all boards of a variant. Only the panel overlay needs to match the specific display.
### Build Pipeline
### Boot Flow
```
build-all.sh
├── build-kernel.sh # Cross-compile kernel 6.6.89 (~10 min)
├── build-rootfs.sh # Arch Linux ARM rootfs in QEMU chroot (~45 min)
├── build-mesa.sh # Mesa 26 with Panfrost + GLES 1.0 (~30 min)
├── build-emulationstation.sh # ES-fcamod with 21 patches (~20 min)
├── build-retroarch.sh # RetroArch + cores (~40 min)
├── generate-panel-dtbos.sh # 18 panel DTBO overlays (~10 sec)
└── build-image.sh # Assemble SD card image (~2 min)
```
All builds happen inside a QEMU aarch64 chroot — no cross-compilation issues.
## Project Structure
```
Arch-R/
├── build-all.sh # Master build orchestrator
├── build-kernel.sh # Kernel compilation
├── build-rootfs.sh # Root filesystem (Arch Linux ARM + services)
├── build-mesa.sh # Mesa 26 GPU driver
├── build-emulationstation.sh # EmulationStation frontend
├── build-retroarch.sh # RetroArch + cores
├── build-image.sh # SD card image assembly
├── config/
│ ├── archr-6.6-r36s.config # Kernel config fragment (393 options)
│ ├── boot.ini # U-Boot fallback boot script
│ ├── es_systems.cfg # EmulationStation system definitions
│ ├── retroarch.cfg # RetroArch base configuration
│ ├── asound.conf # ALSA audio configuration
│ └── autoconfig/ # RetroArch controller autoconfig
├── kernel/
│ └── dts/
│ ├── rk3326-gameconsole-r36s.dts # Custom R36S device tree
│ └── R36S-DTB/ # Reference panel DTBs
├── scripts/
│ ├── emulationstation.sh # ES launch wrapper
│ ├── retroarch-launch.sh # RetroArch launch wrapper
│ ├── archr-hotkeys.py # Volume/brightness hotkey daemon
│ ├── first-boot.sh # First boot setup (ROMS partition)
│ ├── generate-panel-dtbos.sh # Panel overlay generator
│ ├── pmic-poweroff # PMIC shutdown handler
│ └── vlc-stub.c # VLC stub library for ES build
├── bootloader/
│ └── u-boot-r36s-working/ # Pre-built U-Boot binaries
├── prebuilt/
│ └── cores/ # Pre-built RetroArch cores (FBNeo, MAME, N64, PSP)
├── ArchR.png # Boot logo source
└── ROADMAP.md # Development diary
```
## Hardware
| Component | Details |
|-----------|---------|
| SoC | Rockchip RK3326 (4x Cortex-A35 @ 1.5GHz) |
| GPU | Mali-G31 Bifrost (Mesa Panfrost, 600MHz) |
| RAM | 1GB DDR3L (786MHz) |
| Display | 640x480 MIPI DSI (18 panel variants) |
| Audio | RK817 codec, speaker + headphone jack |
| Storage | MicroSD (boot + rootfs + ROMS) |
| Controls | D-pad, ABXY, L1/L2/R1/R2, dual analog sticks |
| Battery | 3200mAh Li-Po (RK817 charger) |
| USB | OTG with host mode (VBUS power on GPIO0_B7) |
## Supported Panels
Arch R supports 18 display panels via DTBO overlays. The default image boots with **Panel 4-V22** (the most common R36S panel).
### Panel Auto-Detection
On first boot, Arch R runs a **panel detection wizard** that guides you through selecting your display panel:
1. **If your screen works** (you see text on screen): press **A** to confirm the current panel
2. **If your screen is black** (wrong panel): listen for audio beeps and use buttons to navigate:
- Each panel plays a different number of beeps (1 beep = first panel, 2 beeps = second, etc.)
- Press **B** to skip to the next panel
- Press **A** to confirm (you'll hear 3 rapid beeps)
- The system reboots with the correct panel applied
Your selection is saved permanently. To reset it later, **hold X during boot**.
### Panel List
| # | Panel | Notes |
|---|-------|-------|
| 1 | **Panel 4-V22** *(default)* | Most common (~60% of R36S units) |
| 2 | Panel 3-V20 | V20 board marking |
| 3 | Panel 5-V22 Q8 | V22 Q8 variant |
| 4 | Clone Panel 8 | ST7703 (G80CA-MB) |
| 5 | Panel 0 | Early R36S units |
| 6 | Panel 1-V10 | V10 board marking |
| 7 | Panel 2-V12 | V12 board marking |
| 8 | Clone Panel 1 | ST7703 |
| 9 | Clone Panel 3 | NV3051D |
| 10 | Clone Panel 7 | JD9365DA |
| 11 | Clone Panel 9 | NV3051D |
| 12 | Clone Panel 10 | ST7703 variant |
| 13 | Clone Panel 2 | ST7703 |
| 14 | Clone Panel 4 | NV3051D |
| 15 | Clone Panel 5 | ST7703 |
| 16 | Clone Panel 6 | NV3051D |
| 17 | R36 Max | 720x720 ST7703 |
| 18 | RX6S | NV3051D variant |
### Manual Panel Selection
If you prefer to set the panel manually (e.g., you know which panel you have from ArkOS/dArkOS):
**Step 1 — Mount the BOOT partition on your PC**
```bash
lsblk
sudo mount /dev/sdX1 /mnt
```
**Step 2 — Create panel.txt**
```bash
# Example: Panel 3-V20
echo 'PanelNum=3
PanelDTBO=ScreenFiles/Panel 3/mipi-panel.dtbo' | sudo tee /mnt/panel.txt
# Mark as confirmed (skip wizard on next boot)
echo 'confirmed' | sudo tee /mnt/panel-confirmed
```
For default Panel 4-V22 (no overlay needed):
```bash
echo 'PanelNum=4
PanelDTBO=' | sudo tee /mnt/panel.txt
echo 'confirmed' | sudo tee /mnt/panel-confirmed
```
**Step 3 — Unmount and boot**
```bash
sudo umount /mnt
sync
```
**To reset panel selection:** hold **X** during boot, or delete `panel-confirmed` from the BOOT partition.
## Boot Flow
```
Power On
U-Boot (BSP or mainline)
boot.scr: read SARADC hwrev, select board DTB
sysboot: load kernel + DTB + overlay from extlinux.conf
Kernel 6.12 + initramfs
mount root (ext4) + storage
switch_root to systemd
systemd
archr-autostart (quirks, governors, audio)
EmulationStation
U-Boot (idbloader → trust → uboot.img)
→ logo.bmp displayed on screen
→ boot.ini: load panel.txt → apply DTBO overlay (if non-default panel)
Kernel 6.6.89 + rk3326-gameconsole-r36s.dtb
→ systemd → panel-detect.service (first boot only)
→ archr-boot-setup (GPU + governors)
→ emulationstation.service → EmulationStation UI
≈ 19 seconds total (+ wizard on first boot)
```
### Partition Layout
## Contributing
| Partition | Filesystem | Label | Purpose |
|-----------|-----------|-------|---------|
| 1 | FAT32 | ARCHR | Boot (kernel, DTBs, overlays, boot.scr) |
| 2 | ext4 | ARCHR_ROOT | Root filesystem |
| 3 | ext4 | STORAGE | User data, ROMs, configs |
See [ROADMAP.md](ROADMAP.md) for current development status and planned features.
## Community
## License
Contributions are welcome. Please open issues or pull requests on [GitHub](https://github.com/archr-linux/Arch-R).
## Licenses
**Arch R** is a fork of [ROCKNIX](https://github.com/ROCKNIX/distribution), which is a fork of [JELOS](https://github.com/JustEnoughLinuxOS/distribution/). All upstream licenses apply.
You are free to:
- **Share**: copy and redistribute the material in any medium or format.
- **Adapt**: remix, transform, and build upon the material.
Under the following terms:
- **Attribution**: You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- **NonCommercial**: You may not use the material for commercial purposes.
- **ShareAlike**: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
### Arch R Software
Copyright (C) 2026-present [Arch R](https://github.com/archr-linux/Arch-R)
Original software and scripts developed by Arch R are licensed under the terms of the [GNU GPL Version 2](https://choosealicense.com/licenses/gpl-2.0/). The full license can be found in this project's licenses folder.
### Bundled Works
All other software is provided under each component's respective license. These licenses can be found in the software sources or in this project's licenses folder. Modifications to bundled software and scripts by upstream projects are licensed under the terms of the software being modified.
## Credits
Like any Linux distribution, this project is not the work of one person. It is the work of many people around the world who have developed the open-source components without which this project could not exist.
Special thanks to:
- **[ROCKNIX](https://github.com/ROCKNIX/distribution)** -- the upstream distribution that Arch R is forked from. ROCKNIX provided the complete build system, device support, EmulationStation integration, and the foundation for handheld gaming on Linux.
- **[JELOS](https://github.com/JustEnoughLinuxOS/distribution/)** -- the project that ROCKNIX was originally forked from.
- **[CoreELEC](https://coreelec.org/)** and **[LibreELEC](https://libreelec.tv/)** -- the embedded Linux distributions whose build system forms the backbone of this project.
- **[Hardkernel](https://www.hardkernel.com/)** -- for the Odroid Go Advance BSP U-Boot and kernel device trees.
- **[Rockchip](https://www.rock-chips.com/)** -- for the RK3326 SoC and rkbin firmware.
- **[Mesa](https://mesa3d.org/)** -- for the Panfrost open-source GPU driver.
- **[RetroArch](https://www.retroarch.com/)** and **[Libretro](https://www.libretro.com/)** -- for the emulation framework and cores.
- **[EmulationStation](https://emulationstation.org/)** -- for the frontend.
- All developers and contributors across the open-source community who made this possible.
GPL v3
+2027
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
#!/bin/sh
#
# fusing script for ODROID-GO2 based on Rockchip RK3326
#
IDBLOADER=idbloader.img
UBOOT=uboot.img
TRUST=trust.img
if [ -z $1 ]; then
echo "Usage ./sd_fusing.sh <SD card reader's device>"
exit 1
fi
sudo dd if=$IDBLOADER of=$1 conv=fsync bs=512 seek=64
sudo dd if=$UBOOT of=$1 conv=fsync bs=512 seek=16384
sudo dd if=$TRUST of=$1 conv=fsync bs=512 seek=24576
sync
sudo eject $1
echo Finished
Binary file not shown.
Binary file not shown.
Binary file not shown.
Submodule bootloader/u-boot-rk3326 added at 5606e804ff
Executable
+246
View File
@@ -0,0 +1,246 @@
#!/bin/bash
#==============================================================================
# Arch R - Master Build Script
#==============================================================================
# Builds everything: kernel, rootfs, and SD card image
#==============================================================================
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'
banner() {
echo -e "${CYAN}"
echo "╔═══════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ █████╗ ██████╗ ██████╗██╗ ██╗ ██████╗ ║"
echo "║ ██╔══██╗██╔══██╗██╔════╝██║ ██║ ██╔══██╗ ║"
echo "║ ███████║██████╔╝██║ ███████║ ██████╔╝ ║"
echo "║ ██╔══██║██╔══██╗██║ ██╔══██║ ██╔══██╗ ║"
echo "║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ██║ ║"
echo "║ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ║"
echo "║ ║"
echo "║ Gaming Distribution for R36S ║"
echo "║ ║"
echo "╚═══════════════════════════════════════════════════════════════╝"
echo -e "${NC}"
}
log() { echo -e "${GREEN}[BUILD]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }
usage() {
echo "Usage: $0 [options]"
echo ""
echo "Options:"
echo " --kernel Build kernel only"
echo " --rootfs Build rootfs only"
echo " --uboot Build U-Boot only"
echo " --image Build image only"
echo " --all Build everything (default)"
echo " --clean Clean all build artifacts"
echo " --help Show this help"
echo ""
}
BUILD_KERNEL=false
BUILD_ROOTFS=false
BUILD_UBOOT=false
BUILD_IMAGE=false
CLEAN=false
# Parse arguments
if [ $# -eq 0 ]; then
BUILD_KERNEL=true
BUILD_ROOTFS=true
BUILD_UBOOT=true
BUILD_IMAGE=true
else
while [[ $# -gt 0 ]]; do
case $1 in
--kernel) BUILD_KERNEL=true; shift ;;
--rootfs) BUILD_ROOTFS=true; shift ;;
--uboot) BUILD_UBOOT=true; shift ;;
--image) BUILD_IMAGE=true; shift ;;
--all) BUILD_KERNEL=true; BUILD_ROOTFS=true; BUILD_UBOOT=true; BUILD_IMAGE=true; shift ;;
--clean) CLEAN=true; shift ;;
--help) usage; exit 0 ;;
*) error "Unknown option: $1" ;;
esac
done
fi
banner
#------------------------------------------------------------------------------
# Clean
#------------------------------------------------------------------------------
if [ "$CLEAN" = true ]; then
log "Cleaning build artifacts..."
rm -rf "$SCRIPT_DIR/output"
rm -rf "$SCRIPT_DIR/.cache"
log "✓ Clean complete"
exit 0
fi
#------------------------------------------------------------------------------
# Prerequisites Check
#------------------------------------------------------------------------------
log "Checking prerequisites..."
# Check if running as root (needed for rootfs and image)
if [ "$BUILD_ROOTFS" = true ] || [ "$BUILD_IMAGE" = true ]; then
if [ "$EUID" -ne 0 ]; then
error "Rootfs and image build require root. Run with sudo."
fi
fi
# Check cross-compiler
if ! command -v aarch64-linux-gnu-gcc &> /dev/null; then
warn "Cross-compiler not found. Install with:"
warn " sudo apt install gcc-aarch64-linux-gnu"
if [ "$BUILD_KERNEL" = true ]; then
error "Cannot build kernel without cross-compiler"
fi
fi
# Check QEMU (for rootfs chroot)
if [ "$BUILD_ROOTFS" = true ]; then
if [ ! -f "/usr/bin/qemu-aarch64-static" ]; then
warn "QEMU static not found. Install with:"
warn " sudo apt install qemu-user-static"
fi
fi
log "✓ Prerequisites OK"
#------------------------------------------------------------------------------
# Build Steps
#------------------------------------------------------------------------------
START_TIME=$(date +%s)
if [ "$BUILD_KERNEL" = true ]; then
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING KERNEL"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/build-kernel.sh"
"$SCRIPT_DIR/build-kernel.sh"
fi
if [ "$BUILD_ROOTFS" = true ]; then
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING ROOTFS"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/build-rootfs.sh"
"$SCRIPT_DIR/build-rootfs.sh"
fi
# Build Mesa 26 (after rootfs, before ES — ES links against Mesa EGL/GLES)
if [ "$BUILD_ROOTFS" = true ]; then
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING MESA 26"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/build-mesa.sh"
"$SCRIPT_DIR/build-mesa.sh"
fi
# Build EmulationStation (after rootfs + Mesa, before image)
if [ "$BUILD_ROOTFS" = true ]; then
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING EMULATIONSTATION"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/build-emulationstation.sh"
"$SCRIPT_DIR/build-emulationstation.sh"
fi
# Build RetroArch with KMS/DRM (after rootfs + Mesa, before image)
if [ "$BUILD_ROOTFS" = true ]; then
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING RETROARCH"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/build-retroarch.sh"
"$SCRIPT_DIR/build-retroarch.sh"
fi
# Generate panel DTBOs (always, lightweight step)
log ""
log "═══════════════════════════════════════════════════════════════"
log " GENERATING PANEL DTBOs"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/scripts/generate-panel-dtbos.sh"
"$SCRIPT_DIR/scripts/generate-panel-dtbos.sh"
# Build custom U-Boot (optional — requires arm-linux-gnueabihf toolchain)
if [ "$BUILD_UBOOT" = true ] && [ -f "$SCRIPT_DIR/build-uboot.sh" ]; then
if command -v aarch64-linux-gnu-gcc &>/dev/null; then
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING U-BOOT"
log "═══════════════════════════════════════════════════════════════"
chmod +x "$SCRIPT_DIR/build-uboot.sh"
"$SCRIPT_DIR/build-uboot.sh"
else
warn "Skipping U-Boot build: aarch64-linux-gnu-gcc not found"
warn "Install: sudo apt install gcc-aarch64-linux-gnu"
fi
fi
if [ "$BUILD_IMAGE" = true ]; then
chmod +x "$SCRIPT_DIR/build-image.sh"
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING IMAGE (original)"
log "═══════════════════════════════════════════════════════════════"
"$SCRIPT_DIR/build-image.sh" --variant original
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILDING IMAGE (clone)"
log "═══════════════════════════════════════════════════════════════"
"$SCRIPT_DIR/build-image.sh" --variant clone
fi
#------------------------------------------------------------------------------
# Summary
#------------------------------------------------------------------------------
END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
MINUTES=$((DURATION / 60))
SECONDS=$((DURATION % 60))
log ""
log "═══════════════════════════════════════════════════════════════"
log " BUILD COMPLETE!"
log "═══════════════════════════════════════════════════════════════"
log ""
log "Build time: ${MINUTES}m ${SECONDS}s"
log ""
if [ -d "$SCRIPT_DIR/output" ]; then
log "Output files:"
ls -lh "$SCRIPT_DIR/output/"* 2>/dev/null || true
if [ -d "$SCRIPT_DIR/output/images" ]; then
log ""
log "Images:"
ls -lh "$SCRIPT_DIR/output/images/"* 2>/dev/null || true
fi
fi
log ""
log "🎮 Arch R is ready for R36S!"

Some files were not shown because too many files have changed in this diff Show More