mirror of
https://github.com/mihawk-99/PS5_RetroArch.git
synced 2026-10-18 23:09:29 -05:00
The frontend now builds into a signed title, and the PS5 driver is in
RetroArch's table in the image that ships, not only in the source.
bash tools/build-title.sh
-> 225 of 225 sources compiled, archived into build/ra/libretroarch.a
-> dist/PPSA99169/eboot.bin, 8,026,239 bytes
container: signed, plaintext; 12 segments; integrity: valid
digest 71c88975040535a02b462618dd394a7a378034272c9bffa43ce0ca4b717ab9b7
(identical across two consecutive builds)
readelf -r build/ra/obj/gfx_video_driver.c.o
-> .rela.data.video_drivers holds exactly two entries: video_ps5, video_null
nm build/llvm-pie.elf
-> video_ps5, video_null, rarch_main and a single main
bash tools/check-manifest.sh
-> 7 files match their digests, none extra, eboot.bin magic 4f153d1d, and it
fails as it should when one byte of the image is changed
tools/verify.sh
-> PASS (format unit build integration evidence)
Registration and entry point. The port's changes are applied by
tools/apply-port-patches.py to the configured copy under build/ra-conf and never
to vendor/retroarch; patches/series names both. RetroArch's own main is compiled
out with -DHAVE_MAIN, the flag its desktop build passes, so src/main.cpp supplies
the only one and calls rarch_main.
Five faults fixed on the way, each recorded in docs/PHASE_LOG.md: the build read
sources from vendor/ and headers from build/ra-conf, so the driver table in the
image had no ps5 entry; 36 hand-written -DHAVE_* flags included six features
configure had turned off; config.h alone is not enough because a source can test a
feature before it is reached (libchdr without zlib); five Linux-only subsystems
were in the object list and are now off at their own configure switches; and two
link-time stubs the pipeline refuses needed -DNDEBUG and -DZSTD_TRACE=0.
The abandoned route is removed: deploy.py, console-launch.sh, check-payload.sh,
scaffold-native.sh, build-native-app.sh, install-title.sh and deploy.sh. Every
tool named by another tool now exists - tools/fetch-retroarch.sh was named by
three tools and three documents and had never been committed, and it now pins
RetroArch at v1.22.2 (69a4f0e) and drops the history so upstream cannot be
committed into. The gate scripts that had never been written are written:
lint-shell, lint-format, check-manifest. The template's unit test, which built a
test for a file that does not exist here, is replaced by tests/test_frontend.py.
The title has not run yet. It is built, signed and manifested; the folder has to
reach /data/homebrew/PPSA99169, and writes from this machine do not take on that
console.
84 lines
3.5 KiB
Bash
Executable File
84 lines
3.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# PS5 RetroArch - the format gate's first half: syntax, and the Python side.
|
|
#
|
|
# bash tools/lint-shell.sh
|
|
#
|
|
# What this checks, and what it deliberately does not. There is no shellcheck and
|
|
# no shfmt on the machine this was written on, so this gate is not a style check;
|
|
# it is the check that a script parses. That is worth having on its own: a
|
|
# malformed tools/*.sh is discovered by whichever build step runs it, which on
|
|
# this project is often a 60-second compile or a deploy, and the failure then
|
|
# looks like a build failure rather than a typo in a file nobody was editing.
|
|
#
|
|
# The Python half is the same idea with `ast`, which imports nothing and runs
|
|
# nothing - a tool that has a syntax error and a side effect on import does not
|
|
# get to have the side effect here.
|
|
#
|
|
# Secrets are checked for, not read: .env is git-ignored and no committed file may
|
|
# name a console address or a credential. The rule is in AGENTS.md, and a grep is
|
|
# the cheapest way to keep it true.
|
|
|
|
set -euo pipefail
|
|
|
|
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
|
cd "$root"
|
|
|
|
failures=0
|
|
note() { printf ' %s\n' "$*"; }
|
|
bad() { printf ' FAIL %s\n' "$*" >&2; failures=$((failures + 1)); }
|
|
|
|
# Files this project maintains. vendor/ and build/ are fetched or generated, and
|
|
# their syntax is not this project's responsibility.
|
|
mapfile -t shells < <(find tools -maxdepth 1 -type f -name '*.sh' | sort)
|
|
(( ${#shells[@]} )) || bad 'no shell scripts found under tools/'
|
|
|
|
echo "==> [lint-shell] syntax of ${#shells[@]} scripts"
|
|
for script in "${shells[@]}"; do
|
|
if bash -n "$script" 2>/tmp/lint-shell.error; then
|
|
note "ok $script"
|
|
else
|
|
bad "$script: $(head -1 /tmp/lint-shell.error)"
|
|
fi
|
|
done
|
|
|
|
mapfile -t pythons < <(find tools tests -maxdepth 1 -type f -name '*.py' 2>/dev/null | sort)
|
|
echo "==> [lint-shell] syntax of ${#pythons[@]} python tools"
|
|
for script in "${pythons[@]}"; do
|
|
if python3 -c 'import ast,sys; ast.parse(open(sys.argv[1], encoding="utf-8").read())' "$script" 2>/tmp/lint-python.error; then
|
|
note "ok $script"
|
|
else
|
|
bad "$script: $(tail -1 /tmp/lint-python.error)"
|
|
fi
|
|
done
|
|
|
|
echo "==> [lint-shell] editors and line endings"
|
|
# A script with CRLF or a stray byte-order mark fails on the console-facing side
|
|
# of this project in ways that read as "command not found" with no obvious cause.
|
|
while IFS= read -r file; do
|
|
if LC_ALL=C grep -q $'\r' "$file"; then
|
|
bad "$file: contains a carriage return (CRLF line ending)"
|
|
fi
|
|
if head -c 3 "$file" | LC_ALL=C grep -q $'\xef\xbb\xbf'; then
|
|
bad "$file: starts with a byte-order mark"
|
|
fi
|
|
done < <(find tools patches -type f \( -name '*.sh' -o -name '*.py' -o -name 'series' \) 2>/dev/null | sort)
|
|
note 'checked for CRLF and byte-order marks'
|
|
|
|
echo "==> [lint-shell] no committed console address or credential"
|
|
# The value itself is not printed: a gate that echoes a secret into a log has
|
|
# published it. Only the file and the key are named.
|
|
leaks=0
|
|
while IFS= read -r hit; do
|
|
printf ' FAIL %s\n' "$hit" >&2
|
|
leaks=$((leaks + 1))
|
|
done < <(grep -rlnE '(PS5_HOST|PS5_FTP_PASSWORD|KLOG_PORT|PS5_CTL_PORT)[[:space:]]*=[[:space:]]*[^[:space:]]' \
|
|
--include='*.sh' --include='*.py' --include='*.md' --include='*.json' --include='*.yml' \
|
|
tools docs patches README.md AGENTS.md Makefile 2>/dev/null | sort)
|
|
(( leaks == 0 )) || failures=$((failures + leaks))
|
|
|
|
if (( failures > 0 )); then
|
|
printf 'lint-shell: %s problem(s)\n' "$failures" >&2
|
|
exit 1
|
|
fi
|
|
echo "lint-shell: PASS"
|