installer: scaffold OpenOrbis app, PKG pipeline proven

This commit is contained in:
SirHumza committed 2026-09-24 16:29:32 +02:00
1 parent 683db49a6e
commit 241488f849
11 files changed
+184

No files matched your search

Binary file not shown.
BIN
View File
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
# orbisRPC Setup installer (OpenOrbis app).
# Flow: Inject (loopback 9090->9021->9020) -> token -> network test -> tweaks.
TITLE := orbisRPC Setup
VERSION := 0.4.0
TITLE_ID := ORPC00001
CONTENT_ID := IV0000-ORPC00001_00-ORBISRPCSETUP000
LIBS := -lc -lkernel -lc++ -lSceMsgDialog -lSceCommonDialog -lSceImeDialog -lSceSysmodule -lSceNet -lSceSsl -lSceSystemService -lSceUserService
ASSETS := $(wildcard installer/assets/**/*)
LIBMODULES := $(wildcard installer/sce_module/*)
TOOLCHAIN := $(OO_PS4_TOOLCHAIN)
PROJDIR := installer
COMMONDIR := $(TOOLCHAIN)/samples/_common
INTDIR := $(PROJDIR)/x64/Debug
CFILES := $(wildcard $(PROJDIR)/*.c)
CPPFILES := $(wildcard $(PROJDIR)/*.cpp)
OBJS := $(patsubst $(PROJDIR)/%.c, $(INTDIR)/%.o, $(CFILES)) $(patsubst $(PROJDIR)/%.cpp, $(INTDIR)/%.o, $(CPPFILES))
# llvmshim (no brew): export PATH="$HOME/llvmshim:$PATH" before make.
LLVM := $(HOME)/llvmshim
CC := $(LLVM)/clang
CCX := $(LLVM)/clang++
LD := $(LLVM)/ld.lld
CDIR := macos
CFLAGS := --target=x86_64-pc-freebsd12-elf -fPIC -funwind-tables -c -isysroot $(TOOLCHAIN) -isystem $(TOOLCHAIN)/include -Iorbisrpc -Iinstaller
CXXFLAGS := $(CFLAGS) -isystem $(TOOLCHAIN)/include/c++/v1
LDFLAGS := -m elf_x86_64 -pie --script $(TOOLCHAIN)/link.x --eh-frame-hdr -L$(TOOLCHAIN)/lib $(LIBS) $(TOOLCHAIN)/lib/crt1.o -L$(TOOLCHAIN)/lib
_unused := $(shell mkdir -p $(INTDIR))
all: $(CONTENT_ID).pkg
$(CONTENT_ID).pkg: installer/pkg.gp4
cd installer && $(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core pkg_build pkg.gp4 . && mv $(CONTENT_ID).pkg ..
installer/pkg.gp4: installer/eboot.bin installer/sce_sys/about/right.sprx installer/sce_sys/param.sfo installer/sce_sys/icon0.png $(LIBMODULES) $(ASSETS)
cd installer && $(TOOLCHAIN)/bin/$(CDIR)/create-gp4 -out pkg.gp4 --content-id=$(CONTENT_ID) --files "eboot.bin sce_sys/about/right.sprx sce_sys/param.sfo sce_sys/icon0.png sce_module/libSceFios2.prx sce_module/libc.prx $(patsubst installer/%,%,$(ASSETS))"
installer/sce_sys/param.sfo: installer/Makefile
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_new $@
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ APP_TYPE --type Integer --maxsize 4 --value 1
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ APP_VER --type Utf8 --maxsize 8 --value '$(VERSION)'
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ ATTRIBUTE --type Integer --maxsize 4 --value 0
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ CATEGORY --type Utf8 --maxsize 4 --value 'gd'
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ CONTENT_ID --type Utf8 --maxsize 48 --value '$(CONTENT_ID)'
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ DOWNLOAD_DATA_SIZE --type Integer --maxsize 4 --value 0
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ SYSTEM_VER --type Integer --maxsize 4 --value 0
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ TITLE --type Utf8 --maxsize 128 --value '$(TITLE)'
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ TITLE_ID --type Utf8 --maxsize 12 --value '$(TITLE_ID)'
$(TOOLCHAIN)/bin/$(CDIR)/PkgTool.Core sfo_setentry $@ VERSION --type Utf8 --maxsize 8 --value '$(VERSION)'
installer/eboot.bin: $(OBJS)
$(LD) $(INTDIR)/*.o -o $(INTDIR)/$(PROJDIR).elf $(LDFLAGS)
$(TOOLCHAIN)/bin/$(CDIR)/create-fself-macos -in=$(INTDIR)/$(PROJDIR).elf -out=$(INTDIR)/$(PROJDIR).oelf --eboot "installer/eboot.bin" --paid 0x3800000000000011
$(INTDIR)/%.o: $(PROJDIR)/%.c
$(CC) $(CFLAGS) -o $@ $<
$(INTDIR)/%.o: $(PROJDIR)/%.cpp
$(CCX) $(CXXFLAGS) -o $@ $<
clean:
rm -rf $(INTDIR) eboot.bin pkg.gp4 $(CONTENT_ID).pkg installer/sce_sys/param.sfo
Binary file not shown.
+14
View File
@@ -0,0 +1,14 @@
/* installer.c - orbisRPC Setup: Inject -> token -> network test -> tweaks.
* Skeleton: proves the app boots on-console with a native dialog. */
#include <stdio.h>
#include "ui.h"
#define SETUP_VERSION "0.4.0"
int main(void){
char msg[256];
snprintf(msg, sizeof msg,
"orbisRPC Setup %s\n\nInstaller skeleton boots.\nWizard lands next.", SETUP_VERSION);
ui_ok(msg);
return 0;
}
+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
<psproject xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" fmt="gp4" version="1000">
<volume>
<volume_type>pkg_ps4_app</volume_type>
<volume_id>PS4VOLUME</volume_id>
<volume_ts>2026-09-24 16:29:15</volume_ts>
<package content_id="IV0000-ORPC00001_00-ORBISRPCSETUP000" passcode="00000000000000000000000000000000"
storage_type="digital50" app_type="full" />
<chunk_info chunk_count="1" scenario_count="1">
<chunks>
<chunk id="0" layer_no="0" label="Chunk #0" />
</chunks>
<scenarios default_id="0">
<scenario id="0" type="sp" initial_chunk_count="1" label="Scenario #0">0</scenario>
</scenarios>
</chunk_info>
</volume>
<files img_no="0">
<file targ_path="eboot.bin" orig_path="eboot.bin" />
<file targ_path="sce_sys/about/right.sprx" orig_path="sce_sys/about/right.sprx" />
<file targ_path="sce_sys/param.sfo" orig_path="sce_sys/param.sfo" />
<file targ_path="sce_sys/icon0.png" orig_path="sce_sys/icon0.png" />
<file targ_path="sce_module/libSceFios2.prx" orig_path="sce_module/libSceFios2.prx" />
<file targ_path="sce_module/libc.prx" orig_path="sce_module/libc.prx" /> </files>
<rootdir>
<dir targ_name="sce_sys">
<dir targ_name="about" />
</dir>
<dir targ_name="sce_module" />
<dir targ_name="assets">
<dir targ_name="audio" />
<dir targ_name="fonts" />
<dir targ_name="images" />
<dir targ_name="misc" />
<dir targ_name="videos" />
</dir>
</rootdir>
</psproject>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.
+55
View File
@@ -0,0 +1,55 @@
/* ui.c - native PS4 dialogs: MsgDialog (ok / yes-no / progress) + ImeDialog.
* Host-testable pure parts live in ui_text.c; everything here needs the
* console (dialog system calls). */
#include "ui.h"
#include <stdio.h>
#include <string.h>
#include <orbis/CommonDialog.h>
#include <orbis/MsgDialog.h>
#include <orbis/Sysmodule.h>
static void base_init(OrbisMsgDialogParam *param){
memset(param, 0, sizeof(*param));
param->baseParam.size = (uint32_t)sizeof(param->baseParam);
param->baseParam.magic =
(uint32_t)(ORBIS_COMMON_DIALOG_MAGIC_NUMBER + (uint64_t)&param->baseParam);
param->size = sizeof(OrbisMsgDialogParam);
}
int ui_ok(const char *msg){
OrbisMsgDialogParam param;
OrbisMsgDialogUserMessageParam um;
OrbisMsgDialogResult res;
memset(&res, 0, sizeof res);
sceMsgDialogInitialize();
base_init(&param);
memset(&um, 0, sizeof um);
um.msg = msg;
um.buttonType = ORBIS_MSG_DIALOG_BUTTON_TYPE_OK;
param.userMsgParam = &um;
if(sceMsgDialogOpen(&param) < 0){ sceMsgDialogTerminate(); return -1; }
do { } while(sceMsgDialogUpdateStatus() != ORBIS_COMMON_DIALOG_STATUS_FINISHED);
sceMsgDialogClose();
sceMsgDialogGetResult(&res);
sceMsgDialogTerminate();
return 0;
}
int ui_confirm(const char *msg){
OrbisMsgDialogParam param;
OrbisMsgDialogUserMessageParam um;
OrbisMsgDialogResult res;
memset(&res, 0, sizeof res);
sceMsgDialogInitialize();
base_init(&param);
memset(&um, 0, sizeof um);
um.msg = msg;
um.buttonType = ORBIS_MSG_DIALOG_BUTTON_TYPE_YESNO_FOCUS_NO;
param.userMsgParam = &um;
if(sceMsgDialogOpen(&param) < 0){ sceMsgDialogTerminate(); return -1; }
do { } while(sceMsgDialogUpdateStatus() != ORBIS_COMMON_DIALOG_STATUS_FINISHED);
sceMsgDialogClose();
sceMsgDialogGetResult(&res);
sceMsgDialogTerminate();
return res.buttonId == ORBIS_MSG_DIALOG_BUTTON_ID_YES ? 1 : 0;
}
+10
View File
@@ -0,0 +1,10 @@
/* ui.h - native dialog helpers for the installer wizard. */
#ifndef INSTALLER_UI_H
#define INSTALLER_UI_H
/* Info dialog with OK. 0 shown, -1 failed to open. */
int ui_ok(const char *msg);
/* Yes/No dialog, focus on No (safe default). 1 yes, 0 no/closed, -1 error. */
int ui_confirm(const char *msg);
#endif