diff --git a/docs/fhs-mapping.md b/docs/fhs-mapping.md index 0113f070e2..9b962f89ef 100644 --- a/docs/fhs-mapping.md +++ b/docs/fhs-mapping.md @@ -172,6 +172,6 @@ Migration scripts ficam em `projects/ArchR/packages/archr/sources/post-update.d/ - [x] Auditoria de 297 paths concluída (2026-06-23). - [x] Mapeamento por classe definido. -- [ ] Fase 0 (vocabulário) — em andamento. +- [x] Fase 0 concluída (2026-06-23): `010-archr-fhs` em `/etc/profile.d`, archr(7) com seção ENVIRONMENT, vars apontando para `/storage/...`. Risco zero. - [ ] Fase 1 — não iniciada. - [ ] Fase 2..7 — não iniciadas. diff --git a/projects/ArchR/packages/archr/profile.d/010-archr-fhs b/projects/ArchR/packages/archr/profile.d/010-archr-fhs new file mode 100644 index 0000000000..6054b2f96c --- /dev/null +++ b/projects/ArchR/packages/archr/profile.d/010-archr-fhs @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2026-present ArchR (https://github.com/archr-linux) +# +# ArchR Filesystem Hierarchy vocabulary +# ------------------------------------- +# Phase 0 of the FHS migration (Arch-ification 2.2). +# +# These variables establish the Arch-friendly vocabulary for paths that +# ArchR scripts use. During this phase they point to the legacy +# LibreELEC-style /storage layout, so nothing changes at runtime. +# Subsequent phases migrate each path class to its FHS destination by +# flipping the right-hand side of the assignments here, while the +# variable name stays stable for callers. +# +# See docs/fhs-mapping.md in the source tree for the full plan. +# +# Convention for downstream scripts: always read paths via these +# variables, never hardcode "/storage/.config" again. Example: +# +# config_dir="${ARCHR_CONFIG}/drastic" +# instead of +# config_dir="/storage/.config/drastic" +# +# When a script is migrated to use ${ARCHR_X}, the next phase can move +# the underlying data without touching that script. + +# Class A: system configuration (-> /etc/archr eventually) +export ARCHR_ETC="${ARCHR_ETC:-/storage/.config}" + +# Class B: user/app configuration (-> /var/lib/archr/config eventually) +export ARCHR_CONFIG="${ARCHR_CONFIG:-/storage/.config}" + +# Class C: regenerable cache (-> /var/cache/archr eventually) +export ARCHR_CACHE="${ARCHR_CACHE:-/storage/.cache}" + +# Class D: persistent state/data (-> /var/lib/archr/data eventually) +export ARCHR_DATA="${ARCHR_DATA:-/storage/.local/share}" + +# Class E: user games library and adjacent media (-> /var/lib/archr/games eventually) +export ARCHR_GAMES="${ARCHR_GAMES:-/storage/roms}" + +# Class F: log files (-> /var/log/archr eventually) +export ARCHR_LOG="${ARCHR_LOG:-/storage/.cache/log}" + +# Class G: ephemeral temp (-> /var/tmp/archr eventually) +export ARCHR_TMP="${ARCHR_TMP:-/storage/.tmp}" diff --git a/projects/ArchR/packages/archr/sources/man/archr.7 b/projects/ArchR/packages/archr/sources/man/archr.7 index 14a4ea33f9..95fc52ca84 100644 --- a/projects/ArchR/packages/archr/sources/man/archr.7 +++ b/projects/ArchR/packages/archr/sources/man/archr.7 @@ -62,6 +62,60 @@ Send anonymized telemetry when the user opts in. .TP .B archr-retroachievements-info Display RetroAchievements account state and recent unlocks. +.SH ENVIRONMENT +ArchR scripts read filesystem paths through the +.B ARCHR_* +family of variables, exported by +.IR /etc/profile.d/010-archr-fhs . +This vocabulary is stable; the underlying paths migrate to FHS locations +across releases (see +.IR docs/fhs-mapping.md +in the source tree). Callers should never hardcode +.IR /storage/.config +or its siblings; use the variable instead. +.TP +.B ARCHR_ETC +System configuration. Currently +.IR /storage/.config ; +target +.IR /etc/archr . +.TP +.B ARCHR_CONFIG +User and application configuration (emulators, EmulationStation, +PortMaster). Currently +.IR /storage/.config ; +target +.IR /var/lib/archr/config . +.TP +.B ARCHR_CACHE +Regenerable cache (shader cache, fontconfig, service state). Currently +.IR /storage/.cache ; +target +.IR /var/cache/archr . +.TP +.B ARCHR_DATA +Persistent state and data. Currently +.IR /storage/.local/share ; +target +.IR /var/lib/archr/data . +.TP +.B ARCHR_GAMES +Games library root (ROMs, saves, screenshots, recordings). Currently +.IR /storage/roms ; +target +.IR /var/lib/archr/games . +.TP +.B ARCHR_LOG +Log files. Currently +.IR /storage/.cache/log ; +target +.IR /var/log/archr . +.TP +.B ARCHR_TMP +Ephemeral temp. Currently +.IR /storage/.tmp ; +target +.IR /var/tmp/archr . .SH FILES .TP .I /etc/os-release