Commit Graph

1209 Commits

Author SHA1 Message Date
Douglas Teles faa9c6f6c4 update: stop the linux package from wiping out-of-tree modules
Installing the linux package through pacman overwrote modules.dep with
the copy generated at kernel build time, which predates every
out-of-tree module: the joypad and the WiFi drivers vanished from the
index and the console booted with dead input and no network
(reproduced on real hardware). Two independent layers fix it: the repo
generator no longer ships any depmod-generated index inside packages
(modules.builtin*/order stay, they are kernel-owned depmod inputs),
and a new alpm hook rebuilds the index over the full overlay tree
after any transaction that touches kernel modules. linux goes to rel 3
so updated devices pick the clean package.
2026-07-08 21:22:34 -03:00
Douglas Teles 8275879350 gen-pacman-repo: create the seed root before invoking pacman
pacman resolves the --root path before doing any work and errors out
when it does not exist, so the seed always failed after the cleanup rm.
2026-07-07 22:03:09 -03:00
Douglas Teles ccb3eaaa86 gen-pacman-repo: seed the local db with an aarch64 no-sig config
The host pacman applies the host architecture and signature policy to
the seed transaction, so every aarch64 package was rejected and the
local-db tarball was silently skipped, leaving freshly flashed images
without an upgradable base.
2026-07-07 22:01:20 -03:00
Douglas Teles 6faa39c570 update: let kernel and DTB fixes flow through pacman via flash-sync
Until now anything living on the FAT boot partition (kernel Image and
the device trees) was reflash-only, breaking the promise that every
update can arrive either by rewriting the image or through pacman and
the ES update menu. Close the gap with three pieces:

- The linux package now ships the kernel image in the rootfs under
  /usr/share/bootloader/Image next to the device_trees it already
  installs, so a pacman upgrade of linux delivers both.
- archr-flash-sync copies Image to /flash/KERNEL (refreshing the
  KERNEL.md5 sidecar) and device_trees/*.dtb to /flash/dtbs, but only
  the files whose sha256 actually changed, each written as a verified
  .new temp in the same FAT directory and renamed over the original so
  the torn-write window is the rename alone. /flash/overlays (the
  user's panel overlay), extlinux, boot scripts and u-boot are never
  touched; u-boot/TPL live in raw sectors where a torn write bricks
  the card, so the bootloader intentionally stays image-flash only.
- An alpm PostTransaction hook (HookDir /etc/pacman.d/hooks) fires the
  sync whenever a transaction touches the bootloader payload.

gen-pacman-repo now prunes the .image build-plumbing directory from
packages, which would otherwise dump a duplicate raw kernel at /.image
on every update.

Hardware test pending: run archr-flash-sync by hand over SSH and check
the device still boots with the synced KERNEL and dtbs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 20:10:49 -03:00
Douglas Teles 9ff72420c6 repo: make local-overlay and meta packages deliver pacman updates
The pacman update channel silently dropped most local changes:

- gen-pacman-repo hardcoded pkgrel=1, ignoring PKG_REV. A package whose
  upstream PKG_VERSION is pinned (e.g. retroarch-joypads, where only the
  local gamepads/ overlay changes) could never produce a newer package,
  so `pacman -Syu` never saw the fix. Read PKG_REV and map it to the repo
  package release (default 1 when unset or dynamic).

- the archr meta package had PKG_VERSION="", so its install_pkg dir was
  "archr-" and the synthesized version was the constant "archr.". The
  main system-config package (system.cfg, runemu, wifictl, governors,
  networkservices) therefore never updated. Stamp it with the build
  timestamp so each rebuild ships a real, monotonically increasing
  version.

- bump retroarch-joypads PKG_REV to 2 so the corrected GO-Super Gamepad
  autoconfig ships as an update.

The kernel/DTB stays out of pacman on purpose: it lives on the FAT boot
partition, which pacman does not manage, so kernel changes ship by image
flash.
2026-06-30 16:47:29 -03:00
Douglas Teles 955434eade build: auto-sync overlay-generator base DTBs after each RK3326 build
The archr-website overlay generator bundles the three base DTBs
(r36s/eeclone/soysauce) it mirrors a user's stock DTB against. They have
to track the shipped image or every generated overlay anchors against
the wrong node structure (this had drifted: eeclone was off by 901 lines,
missing the emmc-disable + uart5 + tsadc changes).

Add scripts/repo/sync-site-bases (host-side, idempotent, non-fatal) and
call it from the Makefile after a successful docker-RK3326 build. It only
copies the files into the sibling archr-website checkout; review, commit
and redeploy of the site stay manual.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 11:08:26 -03:00
Douglas Teles 3d18661bf8 pacman: seed the installed (local) db so pacman -Syu upgrades the base
The image rootfs is a squashfs, not a pacman install, so /var/lib/pacman
(-> /storage/.pacman/db) ships empty: on every device `pacman -Q` returns 0
and `pacman -Qu` finds nothing, so archr-update / `pacman -Syu` reports "No
updates available" even when the repo carries newer base packages. The
headline 2.0 update path therefore only ever installed user addons, never
upgraded the base system (confirmed live: local/ holds only ALPM_DB_VERSION).

Fix in two self-contained parts (no image-build wiring, so the seed always
matches the build that produced it):

- gen-pacman-repo: after building the sync db, register every just-built
  package as installed (`pacman -U --dbonly`, files already in the squashfs)
  and publish the resulting local/ tree as <repo>-localdb.tar.gz alongside
  the packages.
- autostart/004-seed-pacmandb: on first boot, if the local db is still empty
  (only ALPM_DB_VERSION) and the network is up, pull <repo>-localdb.tar.gz
  from the configured release channel and extract it into
  /storage/.pacman/db. Idempotent and skipped once the db is populated, so a
  user's own pacman activity is never clobbered.

PENDING VALIDATION: needs a full build + repo publish to confirm the seed is
produced and that `pacman -Syu` then sees base upgrades. Best-effort on the
generator side (logs a warning rather than failing the repo build).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 22:04:29 -03:00
Douglas Teles 2bb9ebb50a gen-pacman-repo: fall back to dirname when PKG_VERSION is a shell expr
awk -F'"' '/^PKG_VERSION/ ...' pulls the literal string out of the
package.mk, but a handful of packages set their version dynamically:

    PKG_VERSION="$(get_pkg_version gstreamer)"

The build system resolves that at build time and the install_pkg dir
ends up correctly named (gst-libav-1.27.1/). The packager, though, was
storing the raw "$(get_pkg_version gstreamer)" string, which then
went through the charset filter and became ".get_pkg_version.gstreamer."
in the asset name. Five packages slipped through in the first
repo-dev release with broken names (gst-libav, gst-plugins-good,
vitaquake2-{rogue,xatrix,zaero}-lr).

Detect any '$(' or '${' in the version string and treat it as
"unresolved", which trips the existing dirname-suffix fallback.
27 ArchR packages use this pattern; the fix covers all of them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-24 00:32:18 -03:00
Douglas Teles 7addeb691a pacman: drop per-package signing, sign only the repo db
First repo-dev release uploaded 1000/1078 assets before hitting
GitHub's documented per-release limit of 1000 assets. The cap is
hit because every package shipped a paired .sig, doubling the
count without adding meaningful security.

The trust path now flows entirely through the database:
  - archr-keyring ships the master public key.
  - archr.db.sig proves the db came from the maintainer.
  - The db records the SHA256 of every package; pacman re-hashes
    after download and refuses mismatches.

To compromise a package the attacker would have to publish a
modified db that lists their hash, which requires the signing
subkey. The per-package .sig was redundant against this attack.

This is the same model Arch Linux ARM, EndeavourOS and SteamOS
use in production.

pacman.conf SigLevel flips from "Required DatabaseOptional" to
"PackageOptional DatabaseRequired"; comment expanded so a future
reader sees the why.

gen-pacman-repo drops the `gpg --detach-sign` step inside
build_one_pkg(); repo-add --sign still signs the db at the end.
Asset count shrinks from 1078 to 543 (535 packages + 8 db
artifacts), which fits comfortably in a single GitHub Release.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 23:27:27 -03:00
Douglas Teles 41d376a029 gen-pacman-repo: fix package layout for pacman 7 repo-add
Three bugs caught while smoke-testing against an existing
build.ArchR-RK3326.aarch64/install_pkg tree:

1. BUILD_DIR auto-detection glob did not include the trailing arch
   suffix, so build.ArchR-RK3326.aarch64 never matched. Now matches
   build.*-RK3326*aarch64*.

2. Version sanitization used `echo | tr -c '[charset]' '.'` which
   turns the trailing newline into a stray '.', producing versions
   like "1.0.8." that pacman refuses. Swapped to printf.

3. Package layout was wrong for pacman 7 repo-add:
   - .PKGINFO must be the FIRST entry in the tar (pacman streams it).
   - No "./" prefix on file names (matches makepkg output).
   - .PKGINFO needs `pkgbase` and `xdata = pkgtype=pkg` lines, not
     just `pkgname`.
   Rewrote the packing block to assemble an explicit file list with
   .PKGINFO first, then tar -T.

Also: install_pkg name extraction is more robust now — sed strips
both 40-char git hashes and semver suffixes to recover the real
package name, and the package.mk lookup uses find rather than
literal globbing so packages nested at any depth are found.

Smoke test confirms repo-add accepts the resulting archive, signs
archr.db with the configured signer, and emits the expected
symlinks archr.db -> archr.db.tar.gz.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 17:43:08 -03:00
Douglas Teles b6ceea9347 2.1: pacman as real update mechanism (client side)
Decision: pacman repo lives on GitHub Releases at
archr-linux/archr-repo. No VPS, no repo.arch-r.io. Google Drive stays
out of runtime (backup/archive only). Cloudflare R2 fallback deferred.
Detail in docs/release-policy.md.

archr-update rewritten end-to-end:
- 188 lines of dead POST-to-update.arch-r.io code replaced by an
  87-line wrapper around pacman -Syu. The POST endpoint never existed
  so there is no legacy compat to preserve.
- subcommands: check, update, info. system.cfg "updates.branch" maps
  to repo-stable / repo-next / repo-dev tags on archr-linux/archr-repo;
  the mirrorlist is rewritten on every invocation so channel switches
  are immediate.

pacman.conf rebuilt around a single [archr] repo (Arch Linux ARM
upstream removed). SigLevel starts at "Required DatabaseOptional"
during bootstrap; will tighten to "Required" once the production
master key signs the .db.

pacman-init reachability test points at github.com and the keyring
populate target is "archr" instead of "archlinuxarm".

archr-keyring repurposed: the three archlinuxarm keyring files are
removed; package.mk now expects archr.gpg / archr-trusted /
archr-revoked under keys/ and ships empty placeholders until the real
ArchR master key is generated.

scripts/repo/gen-pacman-repo + README: take the build.*-RK3326 tree
that "make docker-RK3326" leaves behind, package each install_pkg/<x>
as a .pkg.tar.zst with synthesized .PKGINFO, run repo-add to build
archr.db, optionally GPG-sign everything. Emits a `gh release create`
command for the publish step. CI hook left as a follow-up.

docs/improvements.md 2.1 marked partial: client and build script are
ready; what blocks the first usable release is generating the GPG
master key, creating archr-linux/archr-repo on GitHub, and one manual
publish for the repo-dev tag to validate the end-to-end loop.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-23 17:03:35 -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
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 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 fe8aa3d349 Adjust boot partition size and update filesystem check options in mkimage script 2026-04-29 14:21:42 -03:00
Douglas Teles 272217362d Update Mesa to version 26.0.5 and adjust related dependencies
- Bump Mesa version from 26.0.3 to 26.0.5 with updated SHA256 checksum.
- Modify RK3326 device tree to increase regulator max voltage for ARM.
- Update OPP settings in RK3326 DTS patch for improved performance.
- Add Python3 and xz to PortMaster dependencies.
- Enhance PortMaster startup script for better directory handling and cleanup.
- Implement HDMI resolution check with timeout in autostart script.
- Add turbo mode configuration to system settings.
- Refactor CPU frequency functions to utilize available frequencies more effectively.
- Update Dolphin emulator scripts to improve gptokeyb process handling.
- Introduce new systemd configuration for timesyncd to optimize polling intervals.
- Set uinput permissions in udev rules for better controller input handling.
- Adjust emulator package.mk to optimize performance for RK3326.
- Modify mkimage script to ensure proper FAT32 formatting and filesystem checks.
- Enhance benchmark script to auto-detect device-specific paths and improve logging.
2026-04-28 23:07:44 -03:00
Douglas Teles 433244480f Update package.mk files to enable shared libraries for libmodplug, libsamplerate, libffi, and pcre2; modify DISTRO_DISKLABEL in options; add CMake options for libwebp; enhance mkimage script to hide root partition from file managers. 2026-04-03 13:04:56 -03:00
Douglas Teles 5e074f3e0c PortMaster critical reqs 2026-04-02 14:46:07 -03:00
Douglas Teles 5ba203e756 Tons of hotfixes 2026-03-23 14:19:12 -03:00
Douglas Teles 8c6e686f58 Build fixes 2026-03-20 11:36:42 -03:00
Douglas Teles c542304146 New architecture release 2026-03-18 17:32:41 -03:00
tiopex 7a656ea09d SM8550/SM8650: Add generate boot.img file
Remove grub and dtb
2026-03-02 14:52:13 +01:00
spycat88 8e951552bc rocknix: use a 16kb cluster size on fat partitions 2025-12-27 15:59:25 +00:00
sydarn 2562d3390a Change default cmake&meson buildtype to release 2025-11-21 19:52:27 +01:00
spycat88 1a3ca5c935 makefile_helper: only chmod syncthing as this is what fails to rm 2025-11-17 19:46:41 +00:00