51723 Commits

Author SHA1 Message Date
Douglas Teles 71d8968a1a FHS F3: logs and update over Arch paths
Class F (logs) and Class G (temp/update) reshuffled.

Logs:
- /var/log was already a mount from /storage/.cache/log via
  packages/sysutils/busybox/system.d/var-log.mount, so journald already
  writes to /var/log/journal in FHS terms. runemu.sh debug log moves
  from /storage/.cache/log/runemu-debug.log to /var/log/runemu-debug.log
  (same physical bytes, FHS surface).
- createlog (top-level busybox script) packs archive zips into
  /var/log/archr/archive instead of /storage/logfiles. ArchR tmpfiles
  z_01_archr.conf creates the backing dir under the storage overlay so
  the path is writable on first boot.

Update:
- /var/cache/archr/update is a bridge symlink to /storage/.update added
  by the archr meta-package. archr-update, automount and the [update]
  samba share all flipped to the FHS path.
- factoryreset still preserves /storage/.update by its real name in
  the find regex; that path is also what the pre-boot bootloader
  scripts read, so the backing path is the canonical one and the
  bridge is just the userland surface. Comment added so this is
  obvious to future readers.
- busybox/scripts/init keeps UPDATE_ROOT=/storage/.update because it
  runs in the initramfs before /var is even available.

Overlayfs workdirs (/storage/.tmp/*-workdir) and /storage/.boot.hint
documented as no-op in fhs-mapping.md: the overlayfs kernel layer
requires upperdir and workdir to share a filesystem, and the boot
hint is part of the U-Boot handshake.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 16:02:59 -03:00
Douglas Teles baddc23110 FHS F2.4 + close: fstrim.run bridged, F2 complete
Last Class C bridge: /var/cache/archr/fstrim.run -> /storage/.cache.
The stamp file does not exist at first boot; touch follows the symlink
and creates the file on the storage side, where future fstrim runs
read it to remember the last run.

docs/fhs-mapping.md updated:
- Fase 2 marked complete with the 5 caches actually migrated
  (mesa, fontconfig, kernel-overlays, locpath, fstrim.run).
- Documents that the initial Class C bucket of 44 paths was a coarse
  auto-classification: most of those paths are state (-> F4 / Class D),
  logs (-> F3 / Class F) or already redirected upstream.
- Three already-no-op redirects called out: journald.conf.d,
  systemd-machine-id, system_timezone (already symlinked by their
  owning packages).

Next: F3 (Class F+G, logs and temp).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:56:21 -03:00
Douglas Teles 61cbea372e FHS F2.3: kernel-overlays + locpath under /var/cache/archr
Two more Class C bridges, same pattern as F2.1/F2.2:
- /var/cache/archr/kernel-overlays -> /storage/.cache/kernel-overlays
- /var/cache/archr/locpath -> /storage/.cache/locpath

Consumers flipped to the Arch-friendly path:
- busybox/scripts/kernel-overlays-setup: OVERLAY_CONFIG_DIR
- busybox/profile.d/10-locale.conf: LOCPATH
- wayland/util/foot/scripts/foot.sh: LOCPATH (ArchR override only)

Service files (locale.service, kernel-overlays tmpfiles.d) keep
addressing the /storage backing path because they are the layer that
creates the actual rw overlay dir; the bridge symlink points at it.

Top-level packages/wayland/util/foot/scripts/foot.sh is upstream
LibreELEC heritage and stays untouched; the ArchR override is the
file the runtime actually executes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:54:46 -03:00
Douglas Teles c370b0ca48 FHS F2.2: fontconfig cache -> /var/cache/fontconfig
Fontconfig's cache directory is baked into the binary at configure
time. Flip --with-cache-dir from /storage/.cache/fontconfig to the
Arch-standard /var/cache/fontconfig and install a bridge symlink
pointing back to the storage overlay so the cache survives reboots.

Same bridge pattern as the systemd /etc redirects and the F2.1 mesa
shader cache: surface looks FHS, substrate stays on /storage.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:52:38 -03:00
Douglas Teles a5b1862117 FHS F2.1: mesa_shader_cache -> /var/cache/mesa
First migration of the Class C cache work: the Mesa shader cache moves
from the LibreELEC-style /storage/.cache/mesa_shader_cache to the
Arch-standard /var/cache/mesa.

Implementation follows the bridge-symlink pattern systemd already uses
for /etc/*: the archr meta-package creates /var/cache/mesa as a
build-time symlink into /storage/.cache/mesa_shader_cache. Mesa,
runemu.sh and any inspector see the FHS path; writes still land on the
storage overlay so the cache survives reboots.

archr/package.mk: mkdir /var/cache, ln -sf the symlink.

quirks/profile.d/041-panfrost: MESA_SHADER_CACHE_DIR=/var/cache/mesa.
Comment explains the bridge so future readers do not assume tmpfs.

runemu.sh: create the cache dir through /var/cache/mesa instead of
the legacy /storage path. Comment updated to mention the symlink.

systemd/tmpfiles.d/z_01_archr.conf is intentionally left targeting the
backing path /storage/.cache/mesa_shader_cache: it is internal plumbing
that must guarantee the real overlay dir exists; /var/cache/mesa is
the surface, /storage/.cache/mesa_shader_cache stays the substrate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:51:37 -03:00
Douglas Teles 2227151d46 FHS F1: marked no-op (systemd already redirects /etc paths)
Audit of projects/ArchR/packages/sysutils/systemd/package.mk showed
the Class A paths are already FHS-correct at runtime: systemd creates
build-time symlinks from /etc/modules-load.d, /etc/sysctl.d,
/etc/tmpfiles.d, /etc/udev/{hwdb,rules}.d and /etc/systemd/*conf.d
pointing into /storage/.config/.

For any tool inspecting the running system, /etc/modules-load.d is a
real populated directory in /etc. The fact that the symlink target
lands on the storage overlay is internal plumbing required because
the rootfs is squashfs read-only.

Repointing those targets to /var/lib/archr/etc would be cosmetic in
exchange for adding a bind-mount in the init script. Not worth it.

hosts/resolv keep their existing template+render pipeline
(network-base-setup reads /storage/.config/{hosts,resolv}.conf and
writes /run/archr/{hosts,resolv}.conf at boot).

Fase 1 closed without code change. Fase 2 (Class C: cache) is next
and has actual work.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:48:59 -03:00
Douglas Teles ca904d5257 FHS F0: introduce ARCHR_* path vocabulary
profile.d/010-archr-fhs exports seven variables (ARCHR_ETC,
ARCHR_CONFIG, ARCHR_CACHE, ARCHR_DATA, ARCHR_GAMES, ARCHR_LOG,
ARCHR_TMP) that future ArchR scripts should read instead of
hardcoding /storage/.config and siblings. Every variable defaults to
its current /storage location so behaviour is identical to today;
subsequent FHS phases will flip the right-hand side without touching
the callers.

archr(7) gains an ENVIRONMENT section describing each variable, its
current value and its FHS target so anyone writing a new script knows
which name to use.

docs/fhs-mapping.md: F0 marked complete; F1..F7 still pending.

Risk: zero. The new file is read at login but only sets variables.
No script reads them yet.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:35:31 -03:00
Douglas Teles cc5febb42f docs: FHS migration plan for Arch-ification 2.2
docs/fhs-mapping.md: full audit (297 unique /storage paths classified
across 7 classes A-G + Z special cases), seven-phase plan, rules of
the road. Phase 0 introduces the vocabulary (vars in
/etc/profile.d/archr-fhs.sh) without moving any data. Each subsequent
phase ends in a commit with grep + boot validation before the next
one starts. User data (saves, ROMs) is phase 6, only after all other
phases survived at least one release on the stable channel.

.gitignore: whitelist docs/fhs-mapping.md so the plan stays tracked
alongside improvements.md and release-policy.md while the rest of
docs/ remains user-local.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:33:09 -03:00
Douglas Teles 2c960e72d1 docs: track improvements.md and release-policy.md
.gitignore had docs/* blocking everything; the rest of the directory
remains user-local notes, so whitelist only the two files that belong
to the project: improvements.md (Arch-ification roadmap, with the
architectural decision that LibreELEC overlay is by design) and
release-policy.md (semver-RC until v2.0, YYYY.MM.PATCH after, three
release channels mapped to updates.branch).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:15:12 -03:00
Douglas Teles 1dbf5705ca linux: fix incomplete 6.12.94 bump
Commit 4273d71442 was meant to bump PKG_VERSION 6.12.79 -> 6.12.94 and
remove the now-upstream u_ether patch in one commit, but the git add
failed silently on a path that had already been git-rm'd, so only the
patch deletion landed and the version bump itself stayed unstaged.

This adds the missing PKG_VERSION and PKG_SHA256 lines so the build
actually picks up 6.12.94.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:00:46 -03:00
Douglas Teles 7c82f31dae Arch-ification 2.6 + 2.7: identity files and archr(7) man page
scripts/image: rewrite /etc/os-release block to the freedesktop layout
expected by third-party tools. ID_LIKE=arch is the change that makes
ArchR detect-cleanly as Arch family across distros, package managers
and analytics. PRETTY_NAME, ANSI_COLOR, LOGO, DOCUMENTATION_URL,
SUPPORT_URL and BUG_REPORT_URL added on top, with sensible fallbacks
from GIT_ORGANIZATION/GIT_REPO when the user has not overridden them
in distributions/ArchR/options.

Drop the empty /etc/archr-release sentinel file alongside os-release.
Arch ships /etc/arch-release the same way (empty by convention) for
tools that detect distro family by file presence rather than by parsing
os-release.

distributions/ArchR/options: fix typo HOME_URL "arc-r.io" -> "arch-r.io".

projects/ArchR/packages/archr: ship archr(7) under /usr/share/man/man7.
First man page of the distro, covers the public command surface
(archr-update, archr-config, archr-systems, etc.), the file locations
that matter (/etc/os-release, /etc/archr-release, /storage layout) and
the architectural decision recorded today (LibreELEC-style read-only
rootfs + storage overlay is by design, not technical debt; SteamOS
validates the model).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 15:00:08 -03:00
Douglas Teles 4273d71442 linux: bump RK3326 kernel 6.12.79 -> 6.12.94 (LTS)
Sliding within the same 6.12 LTS branch (longterm support runs until
December 2026), this picks up 15 stable patch releases of bugfix
and CVE work without touching ABI/API.

Pin the source tarball with PKG_SHA256 so a network MITM cannot
silently swap the kernel under us.

Drop 0020-usb-gadget-u_ether-guard-NULL-gadget-in-eth_get_drvinfo.patch
— that fix landed upstream in 6.12.81 stable. Keeping our copy would
conflict on apply.

The remaining nine patches all touch areas (panfrost, ntsync,
rtl8xxxu) that received no churn in the 79..94 window, so they
should apply unchanged; the next docker-RK3326 build will confirm.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 14:28:19 -03:00
Douglas Teles b56fd7cce6 Sync sysutils fixes from ROCKNIX
systemd: re-enable timedated (was -Dtimedated=false). Drop the
post-install safe_remove that nuked /usr/bin/timedatectl so users
can finally run timedatectl set-timezone from the shell. Two
upstream-equivalent patches accompany the build: 0600 redirects
the timedated write target to /var/run/localtime (writable on our
read-only rootfs), 0601 makes the timezone reader follow indirect
symlinks (matches the /etc -> /storage layout).

udevil: pull the cleaned udevil.conf (UFS gate moved from
allowed_devices to forbidden_devices, /dev/sd* whitelisted as
removable). The udev rule now bails on anything that is not
usb-storage. Internal mmc devices were never matched by the prior
KERNEL=="sd*|sr*" filter anyway, but this makes the intent
explicit and stops misclassified eSATA-like devices.

input_sense: grep -line-buffered before the parse loop so only
EV_KEY / EV_SW / error-reading lines reach the case statement.
evtest output is mostly EV_ABS noise we threw away anyway; this
cuts the CPU spent on the dispatch hot path on every controller.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 14:22:51 -03:00
Douglas Teles 120d279213 Sync standalone + libretro emulator fixes from ROCKNIX
retroarch: bump to commit bdba046f (v1.22.2 + fixes) and rebase the
two local patches (0010-paths, 0011-cheevos-sounds) so they apply
cleanly against the new tree.

setsettings.sh: configure_hotkeys now detects the InputPlumber-emulated
DualSense pad first, then falls back to js0 / joypad. Without this,
retroarch took the raw event device and the hotkey binding never
matched what InputPlumber actually exposed to userspace.

drastic-sa: pull the new libdrastouch (sharp-shimmerless + quilez
pixel shaders, SDL2 hook) and the matching start_drastic.sh, which
now reads the shader setting and exports DSHOOK_SHADER. Drops the
dead S922X libmali block we never executed on RK3326.

hypseus-singe: rewrite of start_hypseus.sh fixes broken controls
(autoconfig.cfg lookup was matching too loosely) and adds the
set_kill on exit so the quit hotkey actually terminates the
emulator instead of leaving it parented to ES.

ppsspp-sa: add 005-hide-unsupported-ui-items.patch to drop the
"www.ppsspp.org" link and the "Buy PPSSPP Gold" button from the
main screen. Handheld UX cleanup, no behavioral change.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 14:22:31 -03:00
Douglas Teles 5805267f90 Sync RK3326 + 6.12-LTS bugfixes from ROCKNIX
mali-bifrost (RK3326): replace patch 003 with the clean RK3576-style
version. Drops the dead BSP-style probe-defer dance, balances the
regulator refcount during probe (mirrors the clock prepare/enable),
and removes the regulator_is_enabled guard that was silently skipping
the disable on suspend. Frees the kernel log of the "missed warnings"
sunshineinabox flagged.

iwd (network): ControlPortOverNL80211=true so 802.1X EAPOL frames go
through nl80211 instead of the legacy raw socket. Some clones with
modern wifi firmware fail association otherwise.

linux 6.12-LTS: add 0020-usb-gadget-u_ether-guard-NULL-gadget upstream
fix. Without it, querying ethtool on the surviving NCM interface
during gadget detach dereferences a NULL dev->gadget pointer and
panics. Affects anyone who flips USB gadget mode at runtime.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 14:16:13 -03:00
Douglas Teles a495eb10a9 Sync graphics + compat package bumps from ROCKNIX
Aligns ArchR with the ROCKNIX 20260601 batch of dependency bumps:
- Mesa 26.0.5 / 26.1.1 -> 26.1.3 (latest stable)
- libdrm 2.4.125 -> 2.4.134
- vulkan-headers 1.4.321 / 1.4.347 -> 1.4.354
- vulkan-loader 1.4.321 / 1.4.347 -> 1.4.354
- wayland 1.23.1 / 1.24.0 -> 1.25.0
- wayland-protocols 1.44 / 1.45 -> 1.49
- box64 -> v0.4.2 (commit 7eeb5016)

Both top-level packages/ and projects/ArchR/packages/ overrides
updated where applicable so the ArchR build resolves the new
versions consistently. Mesa keeps the upstream freedesktop tarball
at packages/ and the gitlab archive at projects/ArchR/ (no change
to delivery URL strategy).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 14:14:43 -03:00
sydarn 1b16ce8405 scripts/get_env: fix to not overwrite PATH from current system
This solves building in docker on nixos, for example.

Thanks to @LukeDSchenk
2026-06-23 14:09:41 -03:00
Douglas Teles b71670a51f Add bench-results directory to .gitignore for cleaner builds 2026-05-27 18:29:35 -03:00
Douglas Teles 5835c74d6c mipi-generator: route Y3506 Soysauce audio through SPKO direct (no amp)
The Y3506 family (V03/V04/V05 soysauce variants) ships without an
external speaker amplifier on the PCB; the rk817 SPKO line drives
the mono speaker directly. The vendor BSP 4.4 hides this with
hardcoded DAPM widgets and routes in rk817_codec.c, but mainline
ASoC respects the DT strictly, so the speaker stayed muted on every
Y3506 board even though the hardware path exists.

Changes:

config/archr-dts/rk3326-gameconsole-r36s.dts
  Adds three pre-defined sound card variants with status=disabled:
    rk817-sound-amplified (external amp gated by GPIO)
    rk817-sound-simple    (external amp on regulator, no GPIO gate)
    rk817-sound-spko-direct (no external amp, SPKO straight to speaker)
  The default rk817-sound stays active with the historic amp routing,
  so any board the overlay generator cannot positively re-classify
  keeps working as it did in v2.0-rc3.

config/mipi-generator/archr-dtbo.py
  - Picks one of the three variants based on flags + vendor signals:
    NAm flag -> spko-direct (Y3506 family)
    spk-con-gpio / spk-ctl-gpios detected -> amplified
    SRs flag without GPIO -> simple
    otherwise -> keep base DTS default (amp routing)
  - Accepts simple-audio-card,hp-det-gpio as a fallback to hp-det-gpio
    so V05 boards that use the canonical mainline name are no longer
    silently skipped by the audio block.
  - Tolerates missing /pinctrl/headphone/hp-det in the vendor DTB
    (some boards bind via the codec phandle only).
  - Short-circuit branch (odroidgo3 + SDORIG) now still toggles the
    sound card variant when NAm is set, so the six Soysauce batches
    that go through that early return still get spko-direct.
  - Fallback branch when the audio block crashes still applies
    spko-direct when NAm is set (covers six Y3506 V03/V04 batches
    where the vendor DTB omits hp-det-gpio entirely).

config/mipi-generator/generator.sh
  - Appends NAm to every overlay generated under soysauce/, in
    stable order with the existing SDORIG and variant flags.

Audit of all 44 vendor DTBs after the change:
  18 clones    -> default (amp routing preserved)
  15 original  -> default (amp routing preserved)
  11 soysauce  -> spko-direct (V03/V04/V05 all classes covered)

Reported by gemstoned via Discord: Soysauce V05 speaker would not
play under v2.0-rc3 even with HPi/SRs overlay flags toggled. Root
cause traced to (a) the variant nodes referenced by archr-dtbo.py
only existing in eeclone.dts and not in r36s.dts, and (b) the
vendor BSP rk817_codec.c hardcoded DAPM that mainline ASoC ignores.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v2.0-rc4
2026-05-26 20:29:37 -03:00
Douglas Teles 9aeb8ce1b1 Improve OFFICIAL variable normalization in Makefile for consistent build behavior 2026-05-26 16:39:25 -03:00
Douglas Teles f3c1e54483 mipi-generator: extract joypad wiring + auto-discover custom vendor props
The overlay generator now propagates board-specific hardware that the
  previous version dropped on the floor:

  - Amux selectors and per-button GPIO pin numbers (varies per subdevice:
    clone uses 16/15/11, original 11/8/13, soysauce 13/12/17)
  - button-adc tunings (deadzone/fuzz/flat) when vendor differs
  - rumble-gpio (R36S V20 2025-05-18, GR36 — fixes "rumble stuck on")
  - Panel status LEDs red/green/blue1/blue2 (8 soysauce V04+/V05 boards)

  Adds an auto-discovery pass that propagates ANY remaining vendor
  property not in our whitelist/blacklist, logging each propagation in
  applied.txt so future board variants surface their quirks instead of
  silently inheriting the original layout.

  Blacklist preserves joypad-name/product/revision (ES gamecontrollerdb
  match), per-button linux,code (vendor uses F-keys, ArchR uses standard
  BTN_*) and PMIC regulator ranges (our base intentionally has expanded
  ranges for the 1512MHz CPU OC).
2026-05-25 21:48:44 -03:00
Douglas Teles 859bab2c0e Add support for GamePark GP32 emulator and update GPU driver installation path 2026-05-25 18:07:12 -03:00
Douglas Teles c06d56ef39 Update supported emulators and cores documentation; add new extensions for ports and improve dependency checks for additional Arch-based distros 2026-05-14 17:58:47 -03:00
Douglas Teles f40d235197 Add support for micro-gamepad compatibility in archr-joypad driver 2026-05-14 13:32:40 -03:00
Douglas Teles f3260292d2 Fix joypad compatibility for Y3506 (soysauce) boards to use single-ADC driver 2026-05-14 12:03:31 -03:00