Files
CosmicScale 97974ae91b PSBBN Definitive Patch v2.10 Update
PFS Shell.elf & HDL Dump.elf:
- PFS Shell updated to support creating 8 MB PFS partitions
- HDL Dump updated to properly modify their headers

PSBBN Disk Image:
- Disk created with a new version of PFS Shell for full compatibility with 8 MB PFS partitions
- Added a direct link to the Game Collection in the Top Menu
- Improved boot time for users without a connected Ethernet cable
- Modified the startup script to format and initialize the Music partition, allowing it to be smaller or larger than before.
- Reduced delay before button presses are registered when booting into Linux
- PS2 Linux partition now uses `ext2` instead of `reiserfs`
- Removed ISP Settings from the Top Menu
- Removed Open PS2 Loader shortcut from the Navigator Menu (user can add a shortcut to their choice of game launcher manually)
- Modified shortcuts to `LaunchELF` and `Launch Disc`
- Updated the About PlayStation BB Navigator page
- Enabled telnet access to PSBBN for development purposes
- Corrections to the English translation

02-PSBBN-Installer.sh:
- Prevents the script from installing the PSBBN Definitive Patch if the version is below 2.10
- Partitions the remaing space of the first 128 GB of the drive:
  - Music partition can now range between 1 GB and 104 GB
  - POPS partition can now range between 1 GB and 104 GB
  - Space reserved for 800 BBNL partitions
- Removed POPS installer (now handled by the Game Installer script)
- Code has been significantly cleaned up and optimized

03-Game-Installer.sh:
- Added a warning for users running PSBBN Definitive Patch below version 2.10
- The PS2 drive is now auto-detected
- Added an option to set a custom path to the `games` folder on your PC
- Allows new games and apps to be added without requiring a full sync
- BBNL partition size reduced from 128 MB to 8 MB, enabling up to 800 games/apps to be displayed in the Game Collection
- Fixed a bug preventing games with superscript numbers in their titles from launching
- General improvements to error checking and messaging
- Fixed issues detecting success/failure of some `rsync` commands
- `rsync` now runs only when needed
- Improved update process for POPStarter, OPL, NHDDL and Neutrino
- Game Installer now installs POPS binaries if missing
- Reduced number of commands executed with `sudo`
- ELF files are now installed in folders and include a `title.cfg`
- Code has been significantly cleaned up and optimized

list-builder.py:
- Merged `list-builder-ps1.py` and `list-builder-ps2.py` into a single script
- Now extracts game IDs for both PS1 and PS2 games

list-sorter.py:
- Game sorting logic has been moved here from the previous list builder scripts
- Sorting has been significantly improved

General:
- PSBBN Installer and Game Installer scripts now prevent the PC from sleeping during execution
- Added a check in each script to ensure it is run using Bash
- Updated README.md
2025-06-05 14:16:49 +01:00

182 lines
5.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Check if the shell is bash
if [ -z "$BASH_VERSION" ]; then
echo "Error: This script must be run using Bash. Try running it with: bash $0" >&2
exit 1
fi
echo -e "\e[8;30;100t"
TOOLKIT_PATH="$(pwd)"
clear
if [[ "$(uname -m)" != "x86_64" ]]; then
echo "Error: This script requires an x86-64 CPU architecture. Detected: $(uname -m)"
read -n 1 -s -r -p "Press any key to exit."
echo
exit 1
fi
cd "${TOOLKIT_PATH}"
# Check if the helper files exists
if [[ ! -f "${TOOLKIT_PATH}/helper/PFS Shell.elf" || ! -f "${TOOLKIT_PATH}/helper/HDL Dump.elf" ]]; then
echo "Required helper files not found. Please make sure you are in the 'PSBBN-Definitive-English-Patch'"
echo "directory and try again."
exit 1
fi
# Check if the current directory is a Git repository
if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
echo "This is not a Git repository. Skipping update check."
else
# Fetch updates from the remote
git fetch > /dev/null 2>&1
# Check the current status of the repository
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
BASE=$(git merge-base @ @{u})
if [ "$LOCAL" = "$REMOTE" ]; then
echo "The repository is up to date."
else
echo "Downloading updates..."
# Get a list of files that have changed remotely
UPDATED_FILES=$(git diff --name-only "$LOCAL" "$REMOTE")
if [ -n "$UPDATED_FILES" ]; then
echo "Files updated in the remote repository:"
echo "$UPDATED_FILES"
# Reset only the files that were updated remotely (discard local changes to them)
echo "$UPDATED_FILES" | xargs git checkout --
# Pull the latest changes
git pull --ff-only
if [[ $? -ne 0 ]]; then
echo
echo "Error: Update failed. Delete the PSBBN-Definitive-English-Patch directory and run the command:"
echo
echo "git clone https://github.com/CosmicScale/PSBBN-Definitive-English-Patch.git"
echo
read -n 1 -s -r -p "Then try running the script again. Press any key to exit"
echo
exit 1
fi
echo
echo "The repository has been successfully updated."
read -n 1 -s -r -p "Press any key to exit, then run the script again."
echo
exit 0
else
echo "The repository is up to date."
fi
fi
fi
echo " _____ _ ";
echo " / ___| | | ";
echo " \ \`--. ___| |_ _ _ _ __ ";
echo " \`--. \/ _ \ __| | | | '_ \ ";
echo " /\__/ / __/ |_| |_| | |_) |";
echo " \____/ \___|\__|\__,_| .__/ ";
echo " | | ";
echo " |_| ";
echo
echo " This script installs all dependencies required for the 'PSBBN Installer' and 'Game Installer'."
echo " It must be run first."
echo
read -n 1 -s -r -p " Press any key to continue..."
echo
echo
# Path to the sources.list file
SOURCES_LIST="/etc/apt/sources.list"
# Check if the file exists
if [[ -f "$SOURCES_LIST" ]]; then
# Remove the "deb cdrom" line and store the result
if grep -q 'deb cdrom' "$SOURCES_LIST"; then
sudo sed -i '/deb cdrom/d' "$SOURCES_LIST"
echo "'deb cdrom' line has been removed from $SOURCES_LIST."
else
echo "No 'deb cdrom' line found in $SOURCES_LIST."
fi
fi
# Check if user is on Debian-based system
if [ -x "$(command -v apt)" ]; then
sudo apt update && sudo apt install -y axel imagemagick xxd python3 python3-venv python3-pip nodejs npm bc rsync curl zip wget chromium
# Or if user is on Fedora-based system, do this instead
elif [ -x "$(command -v dnf)" ]; then
sudo dnf install -y gcc axel ImageMagick xxd python3 python3-devel python3-pip nodejs npm bc rsync curl zip wget chromium
# Or if user is on Arch-based system, do this instead
elif [ -x "$(command -v pacman)" ]; then
sudo pacman -Sy --needed archlinux-keyring && sudo pacman -S --needed axel imagemagick xxd python pyenv python-pip nodejs npm bc rsync curl zip wget chromium
fi
if [ $? -ne 0 ]; then
echo
echo "Error: Package installation failed."
read -n 1 -s -r -p "Press any key to exit..."
echo
exit 1
fi
# Check if mkfs.exfat exists, and install exfat-fuse if not
if ! command -v mkfs.exfat &> /dev/null; then
echo
echo "mkfs.exfat not found. Installing exfat driver..."
if [ -x "$(command -v apt)" ]; then
sudo apt install -y exfat-fuse
elif [ -x "$(command -v dnf)" ]; then
sudo dnf install -y exfatprogs
elif [ -x "$(command -v pacman)" ]; then
sudo pacman -S exfatprogs
fi
if [ $? -ne 0 ]; then
echo
echo "Error: Failed to install exfat driver."
read -n 1 -s -r -p "Press any key to exit..."
echo
exit 1
fi
fi
# Setup Python virtual environment and install Python dependencies
python3 -m venv venv
if [ $? -ne 0 ]; then
echo
echo "Error: Failed to create Python virtual environment."
read -n 1 -s -r -p "Press any key to exit..."
echo
exit 1
fi
source venv/bin/activate
pip install lz4 natsort
if [ $? -ne 0 ]; then
echo
echo "Error: Failed to install Python dependencies."
read -n 1 -s -r -p "Press any key to exit..."
echo
deactivate
exit 1
fi
deactivate
npm install puppeteer
if [ $? -ne 0 ]; then
echo
echo "Error: Failed to install puppeteer."
read -n 1 -s -r -p "Press any key to exit..."
echo
exit 1
fi
echo
echo "Setup completed successfully!"
read -n 1 -s -r -p "Press any key to exit..."
echo