Skip to content

Commit 80d2f08

Browse files
FORCED: Overwriting Tuna with local state
1 parent 8a6f6ba commit 80d2f08

3 files changed

Lines changed: 190 additions & 87 deletions

File tree

.github/workflows/compile-core.yml

Lines changed: 108 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,123 @@
1-
name: Build [All]
1+
name: Build PS2 Exploits Installer
22

33
on:
4-
workflow_dispatch:
4+
workflow_dispatch: # Allows manual triggering
55
push:
66
paths:
77
- 'installer/**'
88
- 'installer_res/**'
99
- '.github/workflows/compile-core.yml'
1010
schedule:
11-
- cron: "0 15 1 * *"
11+
- cron: "0 15 1 * *" # Runs at 3 PM UTC on the 1st of every month
1212

1313
jobs:
1414
build-packages:
1515
runs-on: ubuntu-latest
16-
container: ps2dev/ps2dev:v1.0
16+
container: ps2dev/ps2dev:v1.0 # Uses a Docker container with PS2SDK pre-installed
17+
1718
steps:
18-
- name: Install dependencies
19-
run: apk add --no-cache build-base git zip p7zip
19+
- name: Install build dependencies
20+
run: apk add --no-cache build-base git zip p7zip tar # Added tar for .tar.gz
2021

21-
- uses: actions/checkout@v4
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
2224
with:
23-
fetch-depth: 0
25+
fetch-depth: 0 # Fetch all history for changelog generation
2426

2527
- name: Generate build metadata
28+
id: metadata
2629
run: |
2730
echo "SHA8=${GITHUB_SHA::8}" >> $GITHUB_ENV
31+
# BUILD_TS will be YYYY-MM-DD_HH-MM-SS
2832
echo "BUILD_TS=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
33+
# DATE_FLAT will be YYYY-MM-DD, used for the internal folder name by pack.sh
34+
echo "DATE_FLAT=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
35+
echo "::set-output name=sha8::${GITHUB_SHA::8}"
36+
echo "::set-output name=build_ts::$(date +'%Y-%m-%d_%H-%M-%S')"
37+
echo "::set-output name=date_flat::$(date +'%Y-%m-%d')"
2938
30-
- name: Compile
39+
- name: Compile Installer ELFs
40+
env:
41+
FMCB_INSTALLER_VERSION: ${{ steps.metadata.outputs.sha8 }} # Pass SHA8 as version
3142
run: |
3243
cd installer
33-
make rebuild FMCB_INSTALLER_VERSION=${{ env.SHA8 }} EE_BIN_DIR=../installer_res/
34-
make rebuild FMCB_INSTALLER_VERSION=${{ env.SHA8 }} EE_BIN_DIR=../installer_res/ EXFAT=1
44+
echo "Building standard ELF (output to ../installer_res/)..."
45+
make rebuild EE_BIN_DIR=../installer_res/
46+
echo "Building exFAT ELF (output to ../installer_res/)..."
47+
make rebuild EE_BIN_DIR=../installer_res/ EXFAT=1
48+
cd ..
3549
36-
- name: Prepare folder for Release
50+
- name: Run pack.sh to create initial archives
51+
env:
52+
SHA8: ${{ steps.metadata.outputs.sha8 }} # Pass SHA8 to pack.sh for commit.txt
3753
run: |
3854
cd installer_res
3955
chmod +x ./pack.sh
40-
./pack.sh
41-
mkdir -p ../release_artifacts
42-
mv ../FMCB-1966.7z ../release_artifacts/OSDMenu-Installer-${{ env.BUILD_TS }}.7z
56+
./pack.sh # This script creates archives like ../FMCB-1966.7z
57+
cd ..
58+
# The primary output we care about is FMCB-1966.7z, created in project root by pack.sh
4359
44-
- name: Upload artifact
60+
- name: Prepare and Repackage Release
61+
id: repackage
62+
run: |
63+
INITIAL_ARCHIVE_NAME="FMCB-1966.7z" # This is what pack.sh creates in project root for the main package
64+
TEMP_EXTRACT_DIR="temp_extract_for_repack"
65+
FINAL_CONTENT_DIR_BASENAME="OSDMenu-Installer" # pack.sh creates this folder name base for the 1966 version
66+
FINAL_CONTENT_DIR="${FINAL_CONTENT_DIR_BASENAME}-${{ steps.metadata.outputs.date_flat }}" # e.g., OSDMenu-Installer-2025-05-09
67+
68+
RELEASE_ARTIFACTS_DIR="release_artifacts"
69+
mkdir -p ${RELEASE_ARTIFACTS_DIR}
70+
71+
echo "Initial archive from pack.sh: ${INITIAL_ARCHIVE_NAME}"
72+
if [ ! -f "${INITIAL_ARCHIVE_NAME}" ]; then
73+
echo "Error: ${INITIAL_ARCHIVE_NAME} not found after pack.sh execution!"
74+
exit 1
75+
fi
76+
77+
echo "Creating temporary extraction directory: ${TEMP_EXTRACT_DIR}"
78+
mkdir -p ${TEMP_EXTRACT_DIR}
79+
cd ${TEMP_EXTRACT_DIR}
80+
81+
echo "Extracting ${INITIAL_ARCHIVE_NAME}..."
82+
7z x ../${INITIAL_ARCHIVE_NAME}
83+
84+
if [ ! -d "${FINAL_CONTENT_DIR}" ]; then
85+
echo "Error: Expected directory ${FINAL_CONTENT_DIR} not found after extraction!"
86+
ls -la # List contents for debugging
87+
exit 1
88+
fi
89+
90+
echo "Changing to content directory: ${FINAL_CONTENT_DIR}"
91+
cd "${FINAL_CONTENT_DIR}"
92+
93+
# Define new base name for repackaged archives
94+
REPACK_BASE_NAME="PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}"
95+
96+
echo "Creating .zip archive: ../../${RELEASE_ARTIFACTS_DIR}/${REPACK_BASE_NAME}.zip"
97+
zip -r9 ../../${RELEASE_ARTIFACTS_DIR}/${REPACK_BASE_NAME}.zip .
98+
99+
echo "Creating .7z archive: ../../${RELEASE_ARTIFACTS_DIR}/${REPACK_BASE_NAME}.7z"
100+
7z a -t7z -mx=9 ../../${RELEASE_ARTIFACTS_DIR}/${REPACK_BASE_NAME}.7z .
101+
102+
echo "Creating .tar.gz archive: ../../${RELEASE_ARTIFACTS_DIR}/${REPACK_BASE_NAME}.tar.gz"
103+
tar -czvf ../../${RELEASE_ARTIFACTS_DIR}/${REPACK_BASE_NAME}.tar.gz .
104+
105+
cd ../../ # Back to project root
106+
rm -rf ${TEMP_EXTRACT_DIR} # Clean up temporary directory
107+
108+
echo "Repackaging complete. New archives are in ${RELEASE_ARTIFACTS_DIR}/"
109+
ls -la ${RELEASE_ARTIFACTS_DIR}/
110+
111+
- name: Upload Repackaged Artifacts
45112
if: success()
46113
uses: actions/upload-artifact@v4
47114
with:
48-
name: FMCB-${{ env.SHA8 }}
49-
path: release_artifacts/OSDMenu-Installer-${{ env.BUILD_TS }}.7z
115+
name: PS2-Exploits-Installer-${{ steps.metadata.outputs.sha8 }}
116+
path: |
117+
release_artifacts/PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}.zip
118+
release_artifacts/PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}.7z
119+
release_artifacts/PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}.tar.gz
120+
retention-days: 7
50121

51122
- name: Generate changelog since last tag
52123
id: changelog
@@ -61,20 +132,30 @@ jobs:
61132
else
62133
LOG_BODY="$(git log --pretty=format:"- %s (%h) by %an")"
63134
fi
135+
136+
# Escape special characters for multiline JSON string
137+
LOG_BODY="${LOG_BODY//'%'/'%25'}"
138+
LOG_BODY="${LOG_BODY//$'\n'/'%0A'}"
139+
LOG_BODY="${LOG_BODY//$'\r'/'%0D'}"
64140
65-
echo 'RELEASE_BODY<<EOF' >> $GITHUB_ENV
66-
echo "$LOG_BODY" >> $GITHUB_ENV
67-
echo 'EOF' >> $GITHUB_ENV
141+
echo "::set-output name=body::$LOG_BODY"
68142
69-
- name: Create release
70-
uses: marvinpinto/action-automatic-releases@latest
143+
- name: Create GitHub Release
144+
if: success() # Only run if previous steps were successful
145+
uses: marvinpinto/action-automatic-releases@latest # Or your preferred release action
71146
with:
72147
repo_token: "${{ secrets.GITHUB_TOKEN }}"
73-
automatic_release_tag: "OSDMenu"
148+
automatic_release_tag: "Tuna-v${{ steps.metadata.outputs.build_ts }}" # Use a dynamic tag like Tuna-vYYYY-MM-DD_HH-MM-SS
74149
prerelease: true
75-
title: "OSDMenu Installer"
150+
title: "PS2 Exploits Installer (Build ${{ steps.metadata.outputs.build_ts }})"
76151
files: |
77-
release_artifacts/OSDMenu-Installer-${{ env.BUILD_TS }}.7z
152+
release_artifacts/PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}.zip
153+
release_artifacts/PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}.7z
154+
release_artifacts/PS2-Exploits-Installer-${{ steps.metadata.outputs.build_ts }}.tar.gz
78155
body: |
156+
Automated pre-release build.
157+
Commit: ${{ steps.metadata.outputs.sha8 }}
158+
Build Timestamp: ${{ steps.metadata.outputs.build_ts }}
159+
79160
### Recent Changes:
80-
${{ env.RELEASE_BODY }}
161+
${{ steps.changelog.outputs.body }}

installer/Makefile

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# Makefile for the FreeMcBoot Installer EE (Emotion Engine) application
22

33
# Target ELF name parts
4-
EE_BIN_DIR = ./
4+
# EE_BIN_DIR is the output directory for the ELFs.
5+
# It's defined as './' here for local builds.
6+
# The GitHub Actions workflow (compile-core.yml) overrides this to EE_BIN_DIR=../installer_res/
7+
EE_BIN_DIR = ./
58
EE_BIN_BASE_NAME = UNC_FMCBInstaller
69
EE_BIN_PACKED_BASE_NAME = FMCBInstaller
710

8-
# exFAT support option (0 = no, 1 = yes)
9-
EXFAT ?= 0 # Default to 0 if not set externally
11+
# exFAT support option (0 = no, 1 = yes) - Can be overridden from command line, e.g., make EXFAT=1
12+
EXFAT ?= 0 # Default to 0 (no exFAT support) if not set externally
1013

1114
# Determine suffix based on EXFAT option
1215
HAS_EXFAT =
1316
ifeq ($(EXFAT), 1)
1417
HAS_EXFAT = _EXFAT
1518
endif
1619

17-
# Final ELF names
20+
# Final ELF names. These will be placed in EE_BIN_DIR.
1821
EE_BIN = $(EE_BIN_DIR)$(EE_BIN_BASE_NAME)$(HAS_EXFAT).elf
1922
EE_BIN_PACKED = $(EE_BIN_DIR)$(EE_BIN_PACKED_BASE_NAME)$(HAS_EXFAT).elf
2023

@@ -36,12 +39,12 @@ EE_OBJS = main.o iop.o UI.o menu.o libsecr.o pad.o system.o graphics.o ReqSpaceC
3639
$(EE_RES_OBJS) $(EE_IOP_OBJS) mctools_rpc.o
3740

3841
# Include paths for EE compilation
39-
EE_INCS := -I$(PS2SDK)/ports/include \
42+
EE_INCS := -I. \
43+
-I$(PS2SDK)/ports/include \
4044
-I$(PS2SDK)/ee/include \
4145
-I$(PS2SDK)/common/include \
4246
-I./irx/source/secrsif/src \
43-
-I./irx/source/mctools/src/ \
44-
-I. # Add current directory for project headers like main.h, UI.h etc.
47+
-I./irx/source/mctools/src/
4548

4649
# Linker flags for EE
4750
EE_LDFLAGS := -L$(PS2SDK)/ports/lib \
@@ -58,7 +61,8 @@ EE_GPVAL = -G8192
5861

5962
# CFLAGS for EE compilation
6063
# -Os for size optimization, -mgpopt for GP optimization
61-
EE_CFLAGS += -Os -mgpopt $(EE_GPVAL)
64+
# Added -Wall for all warnings, -Wno-string-plus-int to suppress a common GCCism warning
65+
EE_CFLAGS += -Os -mgpopt $(EE_GPVAL) -Wall -Wno-string-plus-int
6266

6367
# Conditional compilation for exFAT support
6468
ifeq ($(EXFAT), 1)
@@ -78,7 +82,7 @@ ifdef FMCB_INSTALLER_VERSION
7882
EE_CFLAGS += -DFMCB_INSTALLER_VERSION=\"$(FMCB_INSTALLER_VERSION)\"
7983
endif
8084

81-
# Default rule to build all
85+
# Default rule to build all (now defaults to the packed version)
8286
all: $(EE_BIN_PACKED)
8387

8488
# Rule to compile .c files to .o
@@ -94,22 +98,26 @@ all: $(EE_BIN_PACKED)
9498
$(EE_AS) $(EE_ASFLAGS) $< -o $@
9599

96100
# Rule to link EE objects into the final ELF
97-
$(EE_BIN) : $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o
98-
$(EE_CC) $(EE_CFLAGS) -nostartfiles $(EE_LDFLAGS) -o $(EE_BIN) $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o $(EE_LIBS)
101+
# Standard order: crt0.o, then your objects, then libraries.
102+
$(EE_BIN) : $(PS2SDK)/ee/startup/crt0.o $(EE_OBJS)
103+
$(EE_CC) $(EE_CFLAGS) -nostartfiles $(EE_LDFLAGS) -o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(EE_OBJS) $(EE_LIBS)
99104

100105
# Rule to pack the ELF using ps2-packer
101106
$(EE_BIN_PACKED): $(EE_BIN)
102-
@echo " -- Compressing ELF --"
107+
@echo " -- Compressing ELF $(EE_BIN) -> $(EE_BIN_PACKED) --"
103108
ps2-packer -v $< $@
104109

105110
# Rule to clean compiled files
106111
clean:
107112
@echo " -- Cleaning compiled files --"
108113
rm -f $(EE_BIN) $(EE_BIN_PACKED) $(EE_OBJS) \
109-
*_irx.c background.c buttons.c IOPRP_img.c \
110-
usbmass_bd_irx.c bdm_irx.c bdmfs_fatfs_irx.c # Clean exFAT specific generated files too
114+
IOPRP_img.c IOMANX_irx.c FILEXIO_irx.c SIO2MAN_irx.c PADMAN_irx.c MCMAN_irx.c \
115+
MCSERV_irx.c SECRSIF_irx.c MCTOOLS_irx.c USBD_irx.c POWEROFF_irx.c DEV9_irx.c \
116+
ATAD_irx.c HDD_irx.c PFS_irx.c \
117+
background.c buttons.c \
118+
usbmass_bd_irx.c bdm_irx.c bdmfs_fatfs_irx.c USBHDFSD_irx.c # Clean all possible generated .c files
111119

112-
# Rule to rebuild (clean then build)
120+
# Rule to rebuild (clean then build all)
113121
rebuild: clean all
114122

115123
# Rules for converting binary resources/IRXs to C arrays using bin2c
@@ -152,10 +160,10 @@ USBD_irx.c: $(PS2SDK)/iop/irx/usbd.irx
152160
ATAD_irx.c: $(PS2SDK)/iop/irx/ps2atad.irx
153161
bin2c $< $@ ATAD_irx
154162

155-
HDD_irx.c: $(PS2SDK)/iop/irx/ps2hdd-osd.irx # Or ps2hdd.irx depending on SDK version/config
163+
HDD_irx.c: $(PS2SDK)/iop/irx/ps2hdd-osd.irx
156164
bin2c $< $@ HDD_irx
157165

158-
PFS_irx.c: $(PS2SDK)/iop/irx/ps2fs.irx # Or pfsaux.irx / pfs.irx depending on SDK
166+
PFS_irx.c: $(PS2SDK)/iop/irx/ps2fs.irx
159167
bin2c $< $@ PFS_irx
160168

161169
# Custom/Project-specific IRXs (from IRX_DIR)
@@ -165,7 +173,7 @@ SECRSIF_irx.c: $(IRX_DIR)/secrsif.irx
165173
MCTOOLS_irx.c: $(IRX_DIR)/mctools.irx
166174
bin2c $< $@ MCTOOLS_irx
167175

168-
IOPRP_img.c: $(IRX_DIR)/IOPRP.img # This is an IOP Reset Program image
176+
IOPRP_img.c: $(IRX_DIR)/IOPRP.img
169177
bin2c $< $@ IOPRP_img
170178

171179
# Conditional IRX to C conversion based on EXFAT support

0 commit comments

Comments
 (0)