Removed the placeholder 'Coming soon...' partitions

- Dynamically creates and deletes `OPL Launcher` partitions as needed
- Files in the `CFG`, `CHT`, `LNG`, `THM`, and `APPS` folders on your PC are now copied to the PS2 drive during game sync
- **Open PS2 Loader** and **Launch Disc** are added to the Game Channel if they do not already exist
This commit is contained in:
CosmicScale 2025-01-04 16:27:53 +00:00
parent 831f7a1812
commit 762b4d73c2
23 changed files with 372 additions and 220 deletions

View File

@ -242,83 +242,67 @@ available=$((capacity - used))
# Call the function retreive avaliable space
function_space
# Divide available space by 128 to calculate the maximum number of partitions
PP=$(((available - 18560) / 128))
# Loop until the user enters a valid number of partitions
while true; do
clear
echo | tee -a "${INSTALL_LOG}"
echo " #########################################################################################"
echo " # 'OPL Launcher' partitions are used to launch games from the 'Game Channel.' #"
echo " # Consider how many games you want to install, and plan for future expansion. #"
echo " # Additional 'OPL Launcher' partitions cannot be created after setup. #"
echo " # #"
echo " # Note: The more partitions you create, the longer it will take to load the game list. #"
echo " # Fewer 'OPL Launcher' partitions leave more space for the 'Music' partition #"
echo " # and the 'POPS' partition for PS1 games. #"
echo " # #"
echo " # A good starting point is 200 partitions, but feel free to experiment. #"
echo " #########################################################################################"
echo
read -p " Enter the number of \"OPL Launcher\" partitions you would like (1-$PP): " PARTITION_COUNT
# Check if input is a valid number within the specified range
if [[ "$PARTITION_COUNT" =~ ^[0-9]+$ ]] && [ "$PARTITION_COUNT" -ge 1 ] && [ "$PARTITION_COUNT" -le $PP ]; then
# Ask the user to confirm the entered number
GB=$(((available + 2048 - (PARTITION_COUNT * 128)) / 1024))
echo
echo " You entered $PARTITION_COUNT partitions."
echo " This will leave $GB GB to be shared between the Music and POPS partitions."
echo
read -p " Do you wish to proceed? (y/n): " CONFIRMATION
if [[ "$CONFIRMATION" =~ ^[Yy]$ ]]; then
break # Exit the loop if the user confirms
else
echo " Please re-enter the number of partitions." | tee -a "${INSTALL_LOG}"
fi
else
echo
echo " Invalid input. Please enter a number between 1 and $PP." | tee -a "${INSTALL_LOG}"
read -p " Press any key to try again..."
fi
done
# Prompt user for partition size for music, validate input, and keep asking until valid input is provided
while true; do
GB=$(((available + 2048 - 10368 - (PARTITION_COUNT * 128)) / 1024))
GB=$(( GB > 40 ? 40 : GB ))
echo | tee -a "${INSTALL_LOG}"
echo " What size would you like the \"Music\" partition to be?" | tee -a "${INSTALL_LOG}"
echo " Remaining space will be allocated to the POPS partition for PS1 games" | tee -a "${INSTALL_LOG}"
echo " Minimum 10 GB, Maximum $GB GB" | tee -a "${INSTALL_LOG}"
read -p " Enter partition size (in GB): " gb_size
echo "What size would you like the \"Music\" partition to be?" | tee -a "${INSTALL_LOG}"
echo "Minimum 10 GB, Maximum 40 GB" | tee -a "${INSTALL_LOG}"
read -p "Enter partition size (in GB): " gb_size
# Check if the input is a valid number
if [[ ! "$gb_size" =~ ^[0-9]+$ ]]; then
echo " Invalid input. Please enter a valid number." | tee -a "${INSTALL_LOG}"
echo "Invalid input. Please enter a valid number." | tee -a "${INSTALL_LOG}"
continue
fi
# Check if the value is within the valid range
if (( gb_size >= 10 && gb_size <= GB )); then
if (( gb_size >= 10 && gb_size <= 40 )); then
music_partition=$((gb_size * 1024 - 2048))
pops_partition=$((available - (PARTITION_COUNT * 128) - music_partition - 128))
GB=$((pops_partition / 1024))
echo | tee -a "${INSTALL_LOG}"
echo " You have selected $gb_size GB for the \"Music\" partition." | tee -a "${INSTALL_LOG}"
echo " This will leave $GB GB for the POPS partition." | tee -a "${INSTALL_LOG}"
echo "You have selected $gb_size GB for the \"Music\" partition." | tee -a "${INSTALL_LOG}"
# Ask for confirmation
read -p " Are you sure you want to proceed? (y/n): " confirm
read -p "Are you sure you want to proceed? (y/n): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
echo
echo " $GB GB alocated for POPS partition." | tee -a "${INSTALL_LOG}"
break # Exit the loop
fi
else
echo " Invalid size. Please enter a value between 10 and $GB GB." | tee -a "${INSTALL_LOG}"
echo "Invalid size. Please enter a value between 10 and 40 GB." | tee -a "${INSTALL_LOG}"
fi
done
# Prompt user for partition size for POPS, validate input, and keep asking until valid input is provided
while true; do
GB=$(((available - 14976 - music_partition ) / 1024))
echo | tee -a "${INSTALL_LOG}"
echo "What size would you like the \"POPS\" partition to be?" | tee -a "${INSTALL_LOG}"
echo "All remaining space will be made available for OPL Launcher partitions" | tee -a "${INSTALL_LOG}"
echo "Minimum 10 GB, Maximum $GB GB" | tee -a "${INSTALL_LOG}"
read -p "Enter partition size (in GB): " gb_size
# Check if the input is a valid number
if [[ ! "$gb_size" =~ ^[0-9]+$ ]]; then
echo "Invalid input. Please enter a valid number." | tee -a "${INSTALL_LOG}"
continue
fi
# Check if the value is within the valid range
if (( gb_size >= 10 && gb_size <= $GB )); then
pops_partition=$((gb_size * 1024))
game_partitions=$(((available - 2048 - music_partition - pops_partition) / 128))
echo | tee -a "${INSTALL_LOG}"
echo "You have selected $gb_size GB for the \"POPS\" partition." | tee -a "${INSTALL_LOG}"
echo "This will leave enough space for $game_partitions games" | tee -a "${INSTALL_LOG}"
# Ask for confirmation
read -p "Are you sure you want to proceed? (y/n): " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
break # Exit the loop
fi
else
echo "Invalid size. Please enter a value between 10 and $GB GB." | tee -a "${INSTALL_LOG}"
fi
done
@ -328,80 +312,13 @@ COMMANDS+="mkpart __.POPS ${pops_partition}M PFS\n"
COMMANDS+="mkpart +OPL 128M PFS\nexit"
echo -e "$COMMANDS" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${INSTALL_LOG}" 2>&1
# Call the function to retrieve available space
function_space
echo | tee -a "${INSTALL_LOG}"
echo " Creating $PARTITION_COUNT \"OPL Launcher\" partitions..." | tee -a "${INSTALL_LOG}"
# Set starting partition number
START_PARTITION_NUMBER=1
# Initialize a counter for the successfully created partitions
successful_count=0
# Loop to create the specified number of partitions
for ((i = 0; i < PARTITION_COUNT; i++)); do
# Check if available space is at least 128 MB
if [ "$available" -lt 128 ]; then
echo | tee -a "${INSTALL_LOG}"
echo " Insufficient space for another partition." | tee -a "${INSTALL_LOG}"
break
fi
# Calculate the current partition number (starting at $START_PARTITION_NUMBER)
PARTITION_NUMBER=$((START_PARTITION_NUMBER + i))
# Generate the partition label dynamically (PP.001, PP.002, etc.)
PARTITION_LABEL=$(printf "PP.%03d" "$PARTITION_NUMBER")
# Build the command to create this partition
COMMAND="device ${DEVICE}\nmkpart ${PARTITION_LABEL} 128M PFS\nexit"
# Run the partition creation command in PFS Shell
echo -e "$COMMAND" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${INSTALL_LOG}" 2>&1
# Increment the count of successfully created partitions
((successful_count++))
# Call function_space after exiting PFS Shell to update the available space
function_space
done
# Display the total number of partitions created successfully
echo | tee -a "${INSTALL_LOG}"
echo " $successful_count \"OPL Launcher\" partitions created successfully." | tee -a "${INSTALL_LOG}"
echo | tee -a "${INSTALL_LOG}"
echo " Modifying partition headers..." | tee -a "${INSTALL_LOG}"
cd "${TOOLKIT_PATH}/assets/"
# After partitions are created, modify the header for each partition
for ((i = START_PARTITION_NUMBER; i < START_PARTITION_NUMBER + PARTITION_COUNT; i++)); do
PARTITION_LABEL=$(printf "PP.%03d" "$i")
sudo "${TOOLKIT_PATH}/helper/HDL Dump.elf" modify_header "${DEVICE}" "${PARTITION_LABEL}" >> "${INSTALL_LOG}" 2>&1
done
echo | tee -a "${INSTALL_LOG}"
echo " Making \"res\" folders..." | tee -a "${INSTALL_LOG}"
# make 'res' directory on all PP partitions
COMMANDS="device ${DEVICE}\n"
for ((i = START_PARTITION_NUMBER; i < START_PARTITION_NUMBER + PARTITION_COUNT; i++)); do
PARTITION_LABEL=$(printf "PP.%03d" "$i")
COMMANDS+="mount ${PARTITION_LABEL}\n"
COMMANDS+="mkdir res\n"
COMMANDS+="umount\n"
done
COMMANDS+="exit"
# Pipe all commands to PFS Shell for mounting, copying, and unmounting
echo -e "$COMMANDS" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${INSTALL_LOG}" 2>&1
echo | tee -a "${INSTALL_LOG}"
echo " Installing POPS and OPL..." | tee -a "${INSTALL_LOG}"
echo "Installing POPS and OPL..." | tee -a "${INSTALL_LOG}"
cd "${TOOLKIT_PATH}/assets/"
# Copy POPS files and OPL to relevent partitions
COMMANDS="device ${DEVICE}\n"
@ -476,7 +393,7 @@ function function_clear_temp() {
}
echo | tee -a "${INSTALL_LOG}"
echo " Running APA-Jail by Berion..." | tee -a "${INSTALL_LOG}"
echo "Running APA-Jail by Berion..." | tee -a "${INSTALL_LOG}"
# Signature injection (type A2):
MAGIC_NUMBER="4150414A2D413200"
@ -533,8 +450,8 @@ output=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc ${DEVICE} 2>&1)
# Check for the word "aborting" in the output
if echo "$output" | grep -q "aborting"; then
echo " Error: APA partition is broken on ${DEVICE}. Install failed." | tee -a "${INSTALL_LOG}"
read -p " Press any key to exit..."
echo "Error: APA partition is broken on ${DEVICE}. Install failed." | tee -a "${INSTALL_LOG}"
read -p "Press any key to exit..."
exit 1
fi
@ -542,59 +459,23 @@ if sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc "${DEVICE}" | grep -q '__.POP
sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc "${DEVICE}" | grep -q '__linux.8' && \
sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc "${DEVICE}" | grep -q '+OPL'; then
echo
echo " POPS, Music and +OPL partitions were created successfully." | tee -a "${INSTALL_LOG}"
echo "POPS, Music and +OPL partitions were created successfully." | tee -a "${INSTALL_LOG}"
sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc "${DEVICE}" >> "${INSTALL_LOG}"
else
echo
echo " Error: Some partitions are missing on ${DEVICE}. See log for details." | tee -a "${INSTALL_LOG}"
echo "Error: Some partitions are missing on ${DEVICE}. See log for details." | tee -a "${INSTALL_LOG}"
sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc "${DEVICE}" >> "${INSTALL_LOG}"
read -p " Press any key to exit..."
exit 1
fi
# Get the list of partition names
partitions=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc $DEVICE | grep -o 'PP\.[0-9]\+')
# Count detected partitions
detected_count=$(echo "$partitions" | wc -l)
missing_partitions=()
# Check for each partition from PP.001 to PP.<PARTITION_COUNT> and identify any missing partitions
for i in $(seq -f "%03g" 1 "$PARTITION_COUNT"); do
partition_name="PP.$i"
if ! echo "$partitions" | grep -q "$partition_name"; then
missing_partitions+=("$partition_name")
fi
done
# Report findings
if [ ${#missing_partitions[@]} -eq 0 ] && [ "$detected_count" -eq "$PARTITION_COUNT" ]; then
echo
echo " All OPL Launcher partitions are present." | tee -a "${INSTALL_LOG}"
else
if [ "$detected_count" -lt "$PARTITION_COUNT" ]; then
echo
echo " Warning: Expected $PARTITION_COUNT OPL Launcher partitions but found $detected_count!" | tee -a "${INSTALL_LOG}"
fi
if [ ${#missing_partitions[@]} -gt 0 ]; then
echo
echo " Some OPL Launcher partitions are missing. See log for details." | tee -a "${INSTALL_LOG}"
for partition in "${missing_partitions[@]}"; do
echo "$partition" >> "${INSTALL_LOG}"
done
fi
read -p " Press any key to exit..."
read -p "Press any key to exit..."
exit 1
fi
# Check if 'OPL' is found in the 'lsblk' output and if it matches the device
if ! lsblk -p -o NAME,LABEL | grep -q "${DEVICE}3"; then
echo " Error: APA-Jail failed on ${DEVICE}." | tee -a "${INSTALL_LOG}"
read -p " Press any key to exit..."
echo "Error: APA-Jail failed on ${DEVICE}." | tee -a "${INSTALL_LOG}"
read -p "Press any key to exit..."
exit 1
fi
echo | tee -a "${INSTALL_LOG}"
echo " PSBBN successfully installed." | tee -a "${INSTALL_LOG}"
read -p " Press any key to exit. "
echo "PSBBN successfully installed." | tee -a "${INSTALL_LOG}"
read -p "Press any key to exit. "

View File

@ -94,20 +94,20 @@ done
mounted_volumes=$(lsblk -ln -o MOUNTPOINT "$DEVICE" | grep -v "^$")
# Iterate through each mounted volume and unmount it
echo | tee -a ${INSTALL_LOG}
echo | tee -a "${LOG_FILE}"
echo "Unmounting volumes associated with $DEVICE..."
for mount_point in $mounted_volumes; do
echo "Unmounting $mount_point..." | tee -a ${INSTALL_LOG}
echo "Unmounting $mount_point..." | tee -a "${LOG_FILE}"
if sudo umount "$mount_point"; then
echo "Successfully unmounted $mount_point." | tee -a ${INSTALL_LOG}
echo "Successfully unmounted $mount_point." | tee -a "${LOG_FILE}"
else
echo "Failed to unmount $mount_point. Please unmount manually." | tee -a ${INSTALL_LOG}
echo "Failed to unmount $mount_point. Please unmount manually." | tee -a "${LOG_FILE}"
read -p "Press any key to exit..."
exit 1
fi
done
echo "All volumes unmounted for $DEVICE."| tee -a ${INSTALL_LOG}
echo "All volumes unmounted for $DEVICE."| tee -a "${LOG_FILE}"
# Validate the GAMES_PATH
if [[ ! -d "$GAMES_PATH" ]]; then
@ -124,7 +124,7 @@ echo "GAMES_PATH is valid: $GAMES_PATH" | tee -a "${LOG_FILE}"
if [ -f "./venv/bin/activate" ]; then
echo "The Python virtual environment exists."
else
echo "Error: The Python virtual environment does not exist."
echo "Error: The Python virtual environment does not exist." | tee -a "${LOG_FILE}"
read -p "Press any key to exit..."
exit 1
fi
@ -134,7 +134,7 @@ source "./venv/bin/activate"
# Check if activation was successful
if [ $? -ne 0 ]; then
echo "Failed to activate the virtual environment" | tee -a ${INSTALL_LOG}
echo "Failed to activate the virtual environment" | tee -a "${LOG_FILE}"
read -p "Press any key to exit..."
exit 1
fi
@ -164,6 +164,94 @@ fi
echo | tee -a "${LOG_FILE}"
echo "Games list successfully created"| tee -a "${LOG_FILE}"
# Check if PP.OPL exists and create it if not
if sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc "${DEVICE}" | grep -q 'PP.OPL'; then
echo
echo "PP.OPL exists." | tee -a "${LOG_FILE}"
else
# Count the number of 'OPL Launcher' partitions available
partition_count=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc $DEVICE | grep -o 'PP\.[0-9]\+' | grep -v '^$' | wc -l)
START_PARTITION_NUMBER="1"
echo "Installing Apps..." | tee -a "${LOG_FILE}"
successful_count=0
COMMANDS="device ${DEVICE}\n"
# Loop to delete all OPL Launcher partitions
for ((i = 0; i < partition_count; i++)); do
PARTITION_NUMBER=$((START_PARTITION_NUMBER + i))
# Generate the partition label dynamically (PP.001, PP.002, etc.)
PARTITION_LABEL=$(printf "PP.%03d" "$PARTITION_NUMBER")
# Build the command to create this partition
COMMANDS+="rmpart ${PARTITION_LABEL}\n"
# Increment the count of successfully deleted partitions
((successful_count++))
done
COMMANDS+="rmpart PP.WLE\n"
COMMANDS+="mkpart PP.DISC 128M PFS\n"
COMMANDS+="mkpart PP.WLE 128M PFS\n"
COMMANDS+="mkpart PP.OPL 128M PFS\n"
COMMANDS+="mount PP.DISC\n"
COMMANDS+="lcd ${TOOLKIT_PATH}/assets/DISC\n"
COMMANDS+="put disc-launcher.KELF\n"
COMMANDS+="put PS1VModeNeg.elf\n"
COMMANDS+="mkdir res\n"
COMMANDS+="cd res\n"
COMMANDS+="put info.sys\n"
COMMANDS+="put jkt_001.png\n"
COMMANDS+="cd ..\n"
COMMANDS+="umount\n"
COMMANDS+="mount PP.WLE\n"
COMMANDS+="lcd ${TOOLKIT_PATH}/assets/WLE\n"
COMMANDS+="put WLE.KELF\n"
COMMANDS+="mkdir res\n"
COMMANDS+="cd res\n"
COMMANDS+="put info.sys\n"
COMMANDS+="put jkt_001.png\n"
COMMANDS+="cd ..\n"
COMMANDS+="umount\n"
COMMANDS+="mount PP.OPL\n"
COMMANDS+="lcd ${TOOLKIT_PATH}/assets\n"
COMMANDS+="put OPL-Launcher-BDM.KELF\n"
COMMANDS+="mkdir res\n"
COMMANDS+="cd res\n"
COMMANDS+="lcd OPL\n"
COMMANDS+="put info.sys\n"
COMMANDS+="put jkt_001.png\n"
COMMANDS+="cd ..\n"
COMMANDS+="umount\n"
COMMANDS+="exit"
echo -e "$COMMANDS" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${LOG_FILE}" 2>&1
# Modify headers
cd "${TOOLKIT_PATH}/assets/DISC"
sudo "${TOOLKIT_PATH}/helper/HDL Dump.elf" modify_header "${DEVICE}" PP.DISC >> "${LOG_FILE}" 2>&1
cd "${TOOLKIT_PATH}/assets/WLE"
sudo "${TOOLKIT_PATH}/helper/HDL Dump.elf" modify_header "${DEVICE}" PP.WLE >> "${LOG_FILE}" 2>&1
cd "${TOOLKIT_PATH}/assets"
sudo "${TOOLKIT_PATH}/helper/HDL Dump.elf" modify_header "${DEVICE}" PP.OPL >> "${LOG_FILE}" 2>&1
cd "${TOOLKIT_PATH}"
fi
# Function to find available space
function function_space() {
output=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc ${DEVICE} 2>&1)
# Check for the word "aborting" in the output
if echo "$output" | grep -q "aborting"; then
echo "${DEVICE}: APA partition is broken; aborting." | tee -a "${LOG_FILE}"
read -p "Press any key to exit..."
exit 1
fi
# Extract the "used" value, remove "MB" and any commas
used=$(echo "$output" | awk '/used:/ {print $6}' | sed 's/,//; s/MB//')
capacity=124416
# Calculate available space (capacity - used)
available=$((capacity - used))
}
# Count the number of games to be installed
count=$(grep -c '^[^[:space:]]' "${ALL_GAMES}")
echo "Number of games to install: $count" | tee -a "${LOG_FILE}"
@ -174,15 +262,121 @@ partition_count=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc $DEVICE | grep
echo "Number of PP partitions: $partition_count" | tee -a "${LOG_FILE}"
# Check if the count exceeds the partition count
if [ "$count" -gt "$partition_count" ]; then
echo
echo "Error: Number of games ($count) exceeds the available partitions ($partition_count)." | tee -a ""${LOG_FILE}""
read -p "Press any key to exit..."
exit 1
if [ "$count" -lt "$partition_count" ]; then
START_PARTITION_NUMBER=$((count +1))
echo "Starting partition: $START_PARTITION_NUMBER" | tee -a "${LOG_FILE}"
PARTITION_COUNT=$((partition_count - count))
echo "Deleting $PARTITION_COUNT partitions" | tee -a "${LOG_FILE}"
successful_count=0
COMMAND="device ${DEVICE}\n"
# Loop to create the specified number of partitions
for ((i = 0; i < PARTITION_COUNT; i++)); do
# Calculate the current partition number (starting at $START_PARTITION_NUMBER)
PARTITION_NUMBER=$((START_PARTITION_NUMBER + i))
# Generate the partition label dynamically (PP.001, PP.002, etc.)
PARTITION_LABEL=$(printf "PP.%03d" "$PARTITION_NUMBER")
# Build the command to create this partition
COMMAND+="rmpart ${PARTITION_LABEL}\n"
# Increment the count of successfully deleted partitions
#echo "$PARTITION_LABEL"
((successful_count++))
done
COMMAND+="exit"
# Run the partition delete command in PFS Shell
echo -e "$COMMAND" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${LOG_FILE}" 2>&1
# Display the total number of partitions deleted successfully
echo | tee -a "${LOG_FILE}"
echo "$successful_count \"OPL Launcher\" partitions deleted successfully." | tee -a "${LOG_FILE}"
fi
# Check if the count exceeds the partition count
if [ "$count" -gt "$partition_count" ]; then
function_space
START_PARTITION_NUMBER=$((partition_count +1))
echo "Starting partition: $START_PARTITION_NUMBER" | tee -a "${LOG_FILE}"
PARTITION_COUNT=$((count - partition_count))
space_required=$((PARTITION_COUNT * 128))
echo "Space required: $space_required MB" | tee -a "${LOG_FILE}"
if [ "$space_required" -gt "$available" ]; then
echo "Not enough space for $PARTITION_COUNT partitions." | tee -a "${LOG_FILE}"
PARTITION_COUNT=$((available / 128))
game_count=$((count - PARTITION_COUNT))
echo "$PARTITION_COUNT partitions will be created. The first $game_count games will appear in the PSBBN Game Channel" | tee -a "${LOG_FILE}"
echo "Remaining PS2 games will appear in OPL only"
read -p "Press any key to continue..."
fi
echo "Creating $PARTITION_COUNT partitions..." | tee -a "${LOG_FILE}"
successful_count=0
# Loop to create the specified number of partitions
for ((i = 0; i < PARTITION_COUNT; i++)); do
# Check if available space is at least 128 MB
if [ "$available" -lt 128 ]; then
echo | tee -a "${LOG_FILE}"
echo "Insufficient space for another partition." | tee -a "${LOG_FILE}"
break
fi
# Calculate the current partition number (starting at $START_PARTITION_NUMBER)
PARTITION_NUMBER=$((START_PARTITION_NUMBER + i))
# Generate the partition label dynamically (PP.001, PP.002, etc.)
PARTITION_LABEL=$(printf "PP.%03d" "$PARTITION_NUMBER")
# Build the command to create this partition
COMMAND="device ${DEVICE}\nmkpart ${PARTITION_LABEL} 128M PFS\nexit"
# Run the partition creation command in PFS Shell
echo -e "$COMMAND" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${LOG_FILE}" 2>&1
# Increment the count of successfully created partitions
((successful_count++))
# Call function_space after exiting PFS Shell to update the available space
function_space
done
# Display the total number of partitions created successfully
echo | tee -a "${LOG_FILE}"
echo "$successful_count \"OPL Launcher\" partitions created successfully." | tee -a "${LOG_FILE}"
echo | tee -a "${LOG_FILE}"
echo "Modifying partition headers..." | tee -a "${LOG_FILE}"
cd "${TOOLKIT_PATH}/assets/"
# After partitions are created, modify the header for each partition
for ((i = START_PARTITION_NUMBER; i < START_PARTITION_NUMBER + PARTITION_COUNT; i++)); do
PARTITION_LABEL=$(printf "PP.%03d" "$i")
sudo "${TOOLKIT_PATH}/helper/HDL Dump.elf" modify_header "${DEVICE}" "${PARTITION_LABEL}" >> "${LOG_FILE}" 2>&1
done
echo | tee -a "${LOG_FILE}"
echo "Making \"res\" folders..." | tee -a "${LOG_FILE}"
# make 'res' directory on all PP partitions
COMMANDS="device ${DEVICE}\n"
for ((i = START_PARTITION_NUMBER; i < START_PARTITION_NUMBER + PARTITION_COUNT; i++)); do
PARTITION_LABEL=$(printf "PP.%03d" "$i")
COMMANDS+="mount ${PARTITION_LABEL}\n"
COMMANDS+="mkdir res\n"
COMMANDS+="umount\n"
done
COMMANDS+="exit"
# Pipe all commands to PFS Shell for mounting, copying, and unmounting
echo -e "$COMMANDS" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${LOG_FILE}" 2>&1
fi
cd "${TOOLKIT_PATH}"
# Get the list of partition names
partitions=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc $DEVICE | grep -o 'PP\.[0-9]*')
partition_count=$(sudo "${TOOLKIT_PATH}"/helper/HDL\ Dump.elf toc $DEVICE | grep -o 'PP\.[0-9]\+' | grep -v '^$' | wc -l)
missing_partitions=()
@ -316,6 +510,11 @@ echo | tee -a "${LOG_FILE}"
echo "Syncing PS2 games..." | tee -a "${LOG_FILE}"
sudo rsync -r --progress --ignore-existing --delete "${GAMES_PATH}/CD/" "${TOOLKIT_PATH}"/OPL/CD/ | tee -a "${LOG_FILE}"
sudo rsync -r --progress --ignore-existing --delete "${GAMES_PATH}/DVD/" "${TOOLKIT_PATH}"/OPL/DVD/ | tee -a "${LOG_FILE}"
sudo cp --update=none "${GAMES_PATH}/CFG/"* "${TOOLKIT_PATH}"/OPL/CFG >> "${LOG_FILE}" 2>&1
sudo cp --update=none "${GAMES_PATH}/CHT/"* "${TOOLKIT_PATH}"/OPL/CHT >> "${LOG_FILE}" 2>&1
sudo cp --update=none "${GAMES_PATH}/LNG/"* "${TOOLKIT_PATH}"/OPL/LNG >> "${LOG_FILE}" 2>&1
sudo cp --update=none "${GAMES_PATH}/THM/"* "${TOOLKIT_PATH}"/OPL/THM >> "${LOG_FILE}" 2>&1
sudo cp --update=none "${GAMES_PATH}/APPS/"* "${TOOLKIT_PATH}"/OPL/APPS >> "${LOG_FILE}" 2>&1
echo | tee -a "${LOG_FILE}"
echo "PS2 games sucessfully synced" | tee -a "${LOG_FILE}"
echo | tee -a "${LOG_FILE}"
@ -433,8 +632,6 @@ echo "All .cfg, info.sys, and .png files have been created in their respective s
echo | tee -a "${LOG_FILE}"
echo "Installing game assets..." | tee -a "${LOG_FILE}"
cd "${ICONS_DIR}"
# Build the mount/copy/unmount commands for all partitions
COMMANDS="device ${DEVICE}\n"
i=0
@ -443,11 +640,12 @@ while IFS='|' read -r game_title game_id publisher disc_type file_name; do
PARTITION_LABEL=$(printf "PP.%03d" "$((partition_count - i))")
COMMANDS+="mount ${PARTITION_LABEL}\n"
COMMANDS+="cd ..\n"
COMMANDS+="lcd ${TOOLKIT_PATH}/assets\n"
COMMANDS+="rm OPL-Launcher-BDM.KELF\n"
COMMANDS+="put OPL-Launcher-BDM.KELF\n"
# Navigate into the sub-directory named after the gameid
COMMANDS+="lcd ./${game_id}\n"
COMMANDS+="lcd ${ICONS_DIR}/${game_id}\n"
COMMANDS+="rm 'launcher.cfg'\n"
COMMANDS+="put 'launcher.cfg'\n"
COMMANDS+="cd res\n"
@ -456,28 +654,12 @@ while IFS='|' read -r game_title game_id publisher disc_type file_name; do
COMMANDS+="rm jkt_001.png\n"
COMMANDS+="put jkt_001.png\n"
COMMANDS+="umount\n"
COMMANDS+="lcd ..\n"
# Increment the loop counter
((i++))
done < "$ALL_GAMES"
# Process remaining partitions after the games
for ((j = partition_count - i; j >= 1; j--)); do
PARTITION_LABEL=$(printf "PP.%03d" "$j")
COMMANDS+="mount ${PARTITION_LABEL}\n"
COMMANDS+="cd ..\n"
COMMANDS+="rm OPL-Launcher-BDM.KELF\n"
COMMANDS+="put OPL-Launcher-BDM.KELF\n"
COMMANDS+="rm 'launcher.cfg'\n"
COMMANDS+="cd res\n"
COMMANDS+="rm info.sys\n"
COMMANDS+="put info.sys\n"
COMMANDS+="rm jkt_001.png\n"
COMMANDS+="umount\n"
done
COMMANDS+="lcd ../assets\n"
COMMANDS+="lcd ${TOOLKIT_PATH}/assets\n"
COMMANDS+="mount +OPL\n"
COMMANDS+="cd ..\n"
COMMANDS+="rm OPNPS2LD.ELF\n"
@ -488,7 +670,6 @@ COMMANDS+="exit"
# Pipe all commands to PFS Shell for mounting, copying, and unmounting
echo -e "$COMMANDS" | sudo "${TOOLKIT_PATH}/helper/PFS Shell.elf" >> "${LOG_FILE}" 2>&1
echo | tee -a "${LOG_FILE}"
echo "Cleaning up..." | tee -a "${LOG_FILE}"

View File

@ -40,13 +40,15 @@ If you appreciate my work and want to support the continued development of the *
- Added support for Arch-based Linux distributions
- Added confirmation prompts to the PSBBN installer script when creating partitions
- PSBBN image updated to version 2.01:
- Added **Open PS2 Loader** and **Launch Disc** to the Game Channel with a shortcut in the Navigator Menu
- Set USB keyboard layout to US English. Press `ALT+~` to toggle between kana and direct input
- Minor corrections to the English translation
- Added **Open PS2 Loader** and **Launch Disc** to the Game Channel
- The Game Installer script has been updated to dynamically create and delete `OPL Launcher` partitions as needed. Say goodbye to those annoying "Coming soon..." placeholders!
- Files placed in the `CFG`, `CHT`, `LNG`, `THM`, and `APPS` folders on your PC will now be copied to the PS2 drive during game sync
## New installation scripts
These scripts are essential for unlocking all the new features exclusive to version 2.0. They require a Linux environment to run. If Linux is not installed on your PC, you can use a live Linux environment on a bootable USB drive or a virtual machine. Debian-based distributions using `apt` and Arch-based distributions using `pacman` are supported. You will require a HDD/SSD for your PS2 that is larger than 200 GB, ideally 500 GB or larger. I highly recommend a SSD for better performance. The HDD/SSD can be connected to your PC internally or via USB.
These scripts are essential for unlocking all the new features exclusive to version 2.0. They require a Linux environment to run. If Linux is not installed on your PC, you can use a live Linux environment on a bootable USB drive or a virtual machine. Debian-based distributions using `apt` and Arch-based distributions using `pacman` are supported. You will require a HDD/SSD for your PS2 that is larger than 200 GB, ideally 500 GB or larger. I highly recommend a SSD for better performance. You can connect the HDD/SSD to your PC either directly via SATA or using a USB adapter.
## Video Tutorial:
@ -59,7 +61,7 @@ These scripts are essential for unlocking all the new features exclusive to vers
`02-PSBBN-Installer.sh` fully automates the installation of PSBBN
- Downloads the latest version of the `PSBBN Definitive English patch` from archive.org and installs it
- Asks how many 'OPL Launcher' partitions you'd like to create (for up to 700 games!)
- Asks how many `OPL Launcher` partitions you'd like to create (for up to 700 games!)
- Asks how large youd like the music partition
- Creates a __.POPS partition for PS1 games with the remaining space up to 128 GB
- Installs a custom build of OPL with exFAT and Auto Launch support for BDM devices
@ -83,7 +85,9 @@ By default the `games` folder is located in the same directory you installed the
### General Notes:
- PSBBN requires a Fat PS2 console** with expansion bay and an official Sony Network Adapter
- I would highly recommend using a **Kaico IDE to SATA Upgrade Kit** and a SATA SSD. The improved random access speed over a HDD really makes a big difference to the responsiveness of the PSBBN interface.
- Games in the PSBBN Game Channel listed as "Coming soon..." will launch OPL if selected
- PSBBN startup time increases when no active internet connection is available
- To quit PS1 games, press `L1 + SELECT + START`
- To quit PS2 games, press `L1 + L2 + R1 + R2 + SELECT + START`
- The `root` password for Linux is `password`. There is also a `ps2` user account with the password set as `password`
### Note on Retro GEM support:
@ -101,6 +105,7 @@ For physical PlayStation 2 game discs:
- Skips the PlayStation 2 logo check, allowing MechaPwn users to launch imports and master discs
Recommended usage:
- Add a shortcut for **Launch Disc** to the **Navigator Menu**
- Press `SELECT` to open the **Navigator Menu**
- Insert a game disc
- Select **Launch Disc** from the menu
@ -113,11 +118,12 @@ Recommended usage:
3. Settings > BDM Devices > HDD (GPT/MBR): On
- Make sure a PS2 memory card is inserted, then select `Save Changes` from the main menu.
### If, after trying the above steps, games still do not appear in the OPL games list and fail to launch from the PSBBN Game Channel, your drive may not be compatible with the exFAT version of OPL.
### If, after trying the above steps, games still do not appear in the OPL games list and fail to launch from the PSBBN Game Channel, your drive may not be currently compatible with the exFAT version of OPL.
Possible solutions:
1. Connect the PS2 HDD/SSD directly to your PC using an internal SATA connection or a different USB adapter, then rerun the PSBBN installer.
2. Use a different HDD/SSD and rerun the PSBBN installer.
1. Wait for the OPL bug fix. You can learn more and report your issue [here](https://github.com/ps2homebrew/Open-PS2-Loader/issues/1437)
2. Connect the PS2 HDD/SSD directly to your PC using an internal SATA connection or a different USB adapter, then rerun the PSBBN installer
3. Try using a different HDD/SSD and rerun the PSBBN installer
### Notes on APA-Jail:
APA-Jail, created and developed by [Berion](https://www.psx-place.com/resources/authors/berion.1431/), enables the PS2's APA partitions to coexist with an exFAT partition. This setup allows PSBBN to access the first 128 GB of the HDD/SSD directly. The remaining space on the drive is formatted as an exFAT partition, which can be accessed directly on a PC and by a [custom build of Open PS2 Loader](https://github.com/CosmicScale/Open-PS2-Loader-Retro-GEM/tree/psbbn-definitive-ver) on PS2. PS2 games in the `ISO` or `ZSO` format are stored on the exFAT partition.
@ -128,7 +134,7 @@ An application called [OPL Launcher BDM](https://github.com/CosmicScale/OPL-Laun
[OPL Launcher BDM](https://github.com/CosmicScale/OPL-Launcher-BDM) directs [Open PS2 Loader](https://github.com/CosmicScale/Open-PS2-Loader-Retro-GEM/tree/psbbn-definitive-ver) to launch specific PS2 games.
### Warning: Deleting or creating new partitions on your PS2 drive after setup will cause drive corruption.
### Warning: Creating new partitions manually on your PS2 drive may lead to drive corruption.
## Credits
- PSBBN Definitive English Patch by [CosmicScale](https://github.com/CosmicScale)
@ -138,14 +144,12 @@ An application called [OPL Launcher BDM](https://github.com/CosmicScale/OPL-Laun
- Contains code from `list_builder.py` from [XEB+ neutrino Launcher Plugin](https://github.com/sync-on-luma/xebplus-neutrino-loader-plugin) by [sync-on-luma](https://github.com/sync-on-luma), modified by [CosmicScale](https://github.com/CosmicScale)
- Contains data from `TitlesDB_PS1_English.txt` and `TitlesDB_PS2_English.txt` from the [Title Database Scrapper](https://github.com/GDX-X/Title-Database-Scrapper), modified by [CosmicScale](https://github.com/CosmicScale)
- [OPL Launcher BDM](https://github.com/CosmicScale/OPL-Launcher-BDM) written by [CosmicScale](https://github.com/CosmicScale)
- Custom build of [Open PS2 Loader](https://github.com/CosmicScale/Open-PS2-Loader-Retro-GEM/tree/psbbn-definitive-ver) with BDM contributions from [KrahJohlito](https://github.com/KrahJohlito) and Auto Launch modifications by [CosmicScale](https://github.com/CosmicScale)
- [Open PS2 Loader](https://github.com/ps2homebrew/Open-PS2-Loader) with BDM contributions from [KrahJohlito](https://github.com/KrahJohlito) and Auto Launch modifications by [CosmicScale](https://github.com/CosmicScale)
- [Retro GEM Disc Launcher](https://github.com/CosmicScale/Retro-GEM-PS2-Disc-Launcher) written by [CosmicScale](https://github.com/CosmicScale)
- Uses APA-Jail code from the [PS2 HDD Decryption Helper](https://www.psx-place.com/resources/ps2-hdd-decryption-helper.1507/) by [Berion](https://www.psx-place.com/resources/authors/berion.1431/)
- `APA Partition Header Checksumer` by Pinky from the [PS2 HDD Decryption Helper](https://www.psx-place.com/resources/ps2-hdd-decryption-helper.1507/) project. Linux port by Bucanero
- `ziso.py` from [Open PS2 Loader](https://github.com/ps2homebrew/Open-PS2-Loader) written by Virtuous Flame
- [PFS Shell](https://github.com/ps2homebrew/pfsshell)
- [HDL Dump](https://github.com/ps2homebrew/hdl-dump)
- [Open PS2 Loader](https://github.com/ps2homebrew/Open-PS2-Loader)
- This project also uses [PFS Shell](https://github.com/ps2homebrew/pfsshell), [HDL Dump](https://github.com/ps2homebrew/hdl-dump), [wLaunchELF](https://github.com/ps2homebrew/wLaunchELF) and [PS1VModeNeg](https://github.com/ps2homebrew/PS1VModeNeg)
---
<details>

BIN
assets/DISC/PS1VModeNeg.elf Normal file

Binary file not shown.

Binary file not shown.

18
assets/DISC/icon.sys Normal file
View File

@ -0,0 +1,18 @@
PS2X
title0=Launch Disc
title1=
bgcola=0
bgcol0=0,0,0
bgcol1=0,0,0
bgcol2=0,0,0
bgcol3=0,0,0
lightdir0=1.0,-1.0,1.0
lightdir1=-1.0,1.0,-1.0
lightdir2=0.0,0.0,0.0
lightcolamb=64,64,64
lightcol0=64,64,64
lightcol1=16,16,16
lightcol2=0,0,0
uninstallmes0=
uninstallmes1=
uninstallmes2=

View File

@ -1,4 +1,4 @@
title = Coming soon...
title = Launch Disc
title_id =
title_sub_id = 0
release_date =

BIN
assets/DISC/jkt_001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
assets/DISC/list.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

4
assets/DISC/system.cnf Normal file
View File

@ -0,0 +1,4 @@
BOOT2 = pfs:/disc-launcher.KELF
VER = 1.01
VMODE = NTSC
HDDUNITPOWER = NICHDD

21
assets/OPL/info.sys Normal file
View File

@ -0,0 +1,21 @@
title = Open PS2 Loader
title_id =
title_sub_id = 0
release_date =
developer_id =
publisher_id =
note =
content_web =
image_topviewflag = 0
image_type = 0
image_count = 1
image_viewsec = 600
copyright_viewflag = 1
copyright_imgcount = 1
genre =
parental_lock = 1
effective_date = 0
expire_date = 0
violence_flag = 0
content_type = 255
content_subtype = 0

BIN
assets/OPL/jkt_001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
assets/WLE/WLE.KELF Normal file

Binary file not shown.

18
assets/WLE/icon.sys Normal file
View File

@ -0,0 +1,18 @@
PS2X
title0=wLaunchELF
title1=
bgcola=0
bgcol0=0,0,0
bgcol1=0,0,0
bgcol2=0,0,0
bgcol3=0,0,0
lightdir0=1.0,-1.0,1.0
lightdir1=-1.0,1.0,-1.0
lightdir2=0.0,0.0,0.0
lightcolamb=64,64,64
lightcol0=64,64,64
lightcol1=16,16,16
lightcol2=0,0,0
uninstallmes0=
uninstallmes1=
uninstallmes2=

21
assets/WLE/info.sys Normal file
View File

@ -0,0 +1,21 @@
title = wLaunchELF
title_id =
title_sub_id = 0
release_date =
developer_id =
publisher_id =
note =
content_web =
image_topviewflag = 0
image_type = 0
image_count = 1
image_viewsec = 600
copyright_viewflag = 1
copyright_imgcount = 1
genre =
parental_lock = 1
effective_date = 0
expire_date = 0
violence_flag = 0
content_type = 255
content_subtype = 0

BIN
assets/WLE/jkt_001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
assets/WLE/list.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

4
assets/WLE/system.cnf Normal file
View File

@ -0,0 +1,4 @@
BOOT2 = pfs:/WLE.KELF
VER = 1.01
VMODE = NTSC
HDDUNITPOWER = NICHDD

0
games/APPS/.gitkeep Normal file
View File

0
games/CFG/.gitkeep Normal file
View File

0
games/CHT/.gitkeep Normal file
View File

0
games/LNG/.gitkeep Normal file
View File