Files
knutwurst--ps5-patchdl/Makefile
T
Knutwurst 01464ae88a PatchDL 0.0.1: scan, resolve, download and install PS5 game patches
Standalone PS5 payload with an embedded web UI on :12880, no etaHEN.

- Scans installed titles and classifies the source (genuine install,
  ShadowMountPlus mount, preinstall, unknown) from the on-disk layout.
- Reads name, installed version and the Sony version.xml URL from the PS5
  app database (vendored SQLite).
- Resolves version.xml past nanoDNS via a raw DNS query, TLS pinned to the
  SCEI DNAS root.
- Filters patches to the newest one compatible with the current firmware.
- Downloads the patch and installs it through AppInstUtil (sysmodule loaded
  at runtime), gated to genuine installs with a package title-id match guard.
- Action-based UI filters and an on-screen startup notification with the URL.
2026-06-23 14:52:35 +02:00

69 lines
1.7 KiB
Makefile

PS5_HOST ?= ps5
PS5_PORT ?= 9021
PATCHDL_HTTP_PORT ?= 12880
ETAHEN_DEPS_DIR ?= vendor/etahen
ifdef PS5_PAYLOAD_SDK
include $(PS5_PAYLOAD_SDK)/toolchain/prospero.mk
else
$(error PS5_PAYLOAD_SDK is undefined)
endif
PYTHON ?= python3
BIN := patchdl-ps5.elf
SRCS := src/main.c \
src/patchdl_assets.c \
src/patchdl_websrv.c \
src/patchdl_proc.c \
src/patchdl_fw.c \
src/patchdl_scan.c \
src/patchdl_appdb.c \
src/patchdl_net.c \
src/patchdl_resolve.c \
src/patchdl_verxml.c \
src/patchdl_install.c \
src/patchdl_notify.c
WEB_ASSETS := web/index.html web/styles.css web/app.js
GEN_SRCS := $(patsubst web/%,gen/web/%.c,$(WEB_ASSETS))
SQLITE_DIR := vendor/sqlite
SQLITE_OBJ := $(SQLITE_DIR)/sqlite3.o
SQLITE_CFLAGS := -O2 -w \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_WAL \
-DSQLITE_DEFAULT_MEMSTATUS=0 \
-DSQLITE_OMIT_DEPRECATED
CFLAGS := -g -O2 -Wall -Werror -Isrc -I"$(ETAHEN_DEPS_DIR)/include" -I"$(SQLITE_DIR)" -DPATCHDL_HTTP_PORT=$(PATCHDL_HTTP_PORT)
LDADD := -L"$(ETAHEN_DEPS_DIR)/lib" -lmicrohttpd -lkernel_sys -lpthread
ifdef CURL_DIR
CFLAGS += -DPATCHDL_HAVE_CURL -I"$(CURL_DIR)/include"
LDADD += -L"$(CURL_DIR)/lib" -lcurl -lpsl -lssl -lcrypto -lzstd -lz
endif
all: $(BIN)
gen/web:
mkdir -p gen/web
gen/web/%.c: web/% scripts/gen_asset_module.py | gen/web
$(PYTHON) scripts/gen_asset_module.py --path $* $< > $@
$(SQLITE_OBJ): $(SQLITE_DIR)/sqlite3.c
$(CC) $(SQLITE_CFLAGS) -c -o $@ $<
$(BIN): $(SRCS) $(GEN_SRCS) $(SQLITE_OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(LDADD)
test: $(BIN)
$(PS5_DEPLOY) -h $(PS5_HOST) -p $(PS5_PORT) $^
clean:
rm -rf $(BIN) gen $(SQLITE_OBJ)
.PHONY: all clean test