From 7f640407b9f329dd9eed0a685fbc56951e06dcae Mon Sep 17 00:00:00 2001 From: igor725 Date: Sat, 26 Oct 2024 03:02:18 +0300 Subject: [PATCH] Forgot these two guys --- package.bat | 46 ++++++++++++++++++++++++++++++++++++++++++++++ package.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 package.bat create mode 100755 package.sh diff --git a/package.bat b/package.bat new file mode 100644 index 0000000..e9d8a58 --- /dev/null +++ b/package.bat @@ -0,0 +1,46 @@ +@echo off +SETLOCAL EnableDelayedExpansion + +Rem Package information +set PKG_TITLE=%1 +set PKG_VERSION=%2 +set PKG_TITLE_ID=%3 +set PKG_CONTENT_ID=%4 + +Rem Create param.sfo +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_new sce_sys/param.sfo +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo APP_TYPE --type Integer --maxsize 4 --value 1 +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo APP_VER --type Utf8 --maxsize 8 --value %PKG_VERSION% +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo ATTRIBUTE --type Integer --maxsize 4 --value 0 +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo CATEGORY --type Utf8 --maxsize 4 --value "gd" +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo CONTENT_ID --type Utf8 --maxsize 48 --value %PKG_CONTENT_ID% +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo DOWNLOAD_DATA_SIZE --type Integer --maxsize 4 --value 0 +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo SYSTEM_VER --type Integer --maxsize 4 --value 0 +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo TITLE --type Utf8 --maxsize 128 --value %PKG_TITLE% +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo TITLE_ID --type Utf8 --maxsize 12 --value %PKG_TITLE_ID% +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe sfo_setentry sce_sys/param.sfo VERSION --type Utf8 --maxsize 8 --value %PKG_VERSION% + +Rem Get a list of assets for packaging +set module_files= +for %%f in (sce_module\\*) do set module_files=!module_files! sce_module/%%~nxf + +set asset_audio_files= +for %%f in (assets\\audio\\*) do set asset_audio_files=!asset_audio_files! assets/audio/%%~nxf + +set asset_fonts_files= +for %%f in (assets\\fonts\\*) do set asset_fonts_files=!asset_fonts_files! assets/fonts/%%~nxf + +set asset_images_files= +for %%f in (assets\\images\\*) do set asset_images_files=!asset_images_files! assets/images/%%~nxf + +set asset_misc_files= +for %%f in (assets\\misc\\*) do set asset_misc_files=!asset_misc_files! assets/misc/%%~nxf + +set asset_videos_files= +for %%f in (assets\\videos\\*) do set asset_videos_files=!asset_videos_files! assets/videos/%%~nxf + +Rem Create gp4 +%OO_PS4_TOOLCHAIN%\bin\windows\create-gp4.exe -out pkg.gp4 --content-id=%PKG_CONTENT_ID% --files "eboot.bin sce_sys/about/right.sprx sce_sys/param.sfo sce_sys/icon0.png %module_files% %asset_audio_files% %asset_fonts_files% %asset_images_files% %asset_misc_files% %asset_videos_files%" + +Rem Create pkg +%OO_PS4_TOOLCHAIN%\bin\windows\PkgTool.Core.exe pkg_build pkg.gp4 . diff --git a/package.sh b/package.sh new file mode 100755 index 0000000..f92cf59 --- /dev/null +++ b/package.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +PKG_TITLE="$1" +PKG_VERSION="$2" +PKG_TITLE_ID="$3" +PKG_CONTENT_ID="$4" + +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_new sce_sys/param.sfo +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo APP_TYPE --type Integer --maxsize 4 --value 1 +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo APP_VER --type Utf8 --maxsize 8 --value "$PKG_VERSION" +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo ATTRIBUTE --type Integer --maxsize 4 --value 0 +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo CATEGORY --type Utf8 --maxsize 4 --value "gd" +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo CONTENT_ID --type Utf8 --maxsize 48 --value "$PKG_CONTENT_ID" +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo DOWNLOAD_DATA_SIZE --type Integer --maxsize 4 --value 0 +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo SYSTEM_VER --type Integer --maxsize 4 --value 0 +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo TITLE --type Utf8 --maxsize 128 --value "$PKG_TITLE" +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo TITLE_ID --type Utf8 --maxsize 12 --value "$PKG_TITLE_ID" +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core sfo_setentry sce_sys/param.sfo VERSION --type Utf8 --maxsize 8 --value "$PKG_VERSION" + +FILES=$(find assets/ -type f -printf '%p ') +FILES="$FILES$(find sce_module/ -type f -name '*.prx' -printf '%p ')" + +# Create gp4 +$OO_PS4_TOOLCHAIN/bin/linux/create-gp4 -out pkg.gp4 --content-id="$PKG_CONTENT_ID" --files "eboot.bin sce_sys/about/right.sprx sce_sys/param.sfo sce_sys/icon0.png $FILES" + +# Create pkg +$OO_PS4_TOOLCHAIN/bin/linux/PkgTool.Core pkg_build pkg.gp4 .