mirror of
https://github.com/CosmicScale/PSBBN-Definitive-English-Patch.git
synced 2025-03-10 10:17:51 +01:00
Improved mounting and unmounting of the OPL partition. Moved OPL folder creation to the game installer
This commit is contained in:
parent
6e74b6b357
commit
e47d2cc123
@ -399,28 +399,6 @@ function function_apajail_magic_number() {
|
||||
sudo dd if=/tmp/apajail_magic_number.bin of=${DEVICE} bs=8 count=1 seek=28 conv=notrunc >> "${INSTALL_LOG}" 2>&1
|
||||
}
|
||||
|
||||
function function_make_ps2_dirs() {
|
||||
if [ ! -d "/tmp/ps2_dirs" ]; then
|
||||
mkdir /tmp/ps2_dirs
|
||||
fi
|
||||
if [ "$(echo ${DEVICE} | grep -o /dev/loop)" = "/dev/loop" ]; then
|
||||
sudo mount ${DEVICE}p${PARTITION_NUMBER} /tmp/ps2_dirs
|
||||
else sudo mount ${DEVICE}${PARTITION_NUMBER} /tmp/ps2_dirs
|
||||
fi
|
||||
cd /tmp/ps2_dirs
|
||||
sudo mkdir -p APPS/ # Open PS2 Loader: applications
|
||||
sudo mkdir -p ART/ # Open PS2 Loader: disc covers (<GameID>_COV.png, <GameID>_ICO.png, <GameID>_SCR.png etc.)
|
||||
sudo mkdir -p CFG/ # Open PS2 Loader: per game configs (<GameID>.cfg)
|
||||
sudo mkdir -p CHT/ # Open PS2 Loader: cheats (<GameID>.cht)
|
||||
sudo mkdir -p CD/ # Open PS2 Loader: CD disc images (*.iso, *.zso)
|
||||
sudo mkdir -p DVD/ # Open PS2 Loader: DVD disc images (*.iso, *.zso)
|
||||
sudo mkdir -p LNG # Open PS2 Loader: Language files
|
||||
sudo mkdir -p THM/ # Open PS2 Loader: theme dirs (thm_<ThemeName>/*)
|
||||
sudo mkdir -p VMC/ # Open PS2 Loader: non-ECC PS2 Memory Card images (generic or <GameID>_0.bin, <GameID>_1.bin)
|
||||
sync
|
||||
sudo umount -l /tmp/ps2_dirs
|
||||
}
|
||||
|
||||
function function_apa_checksum_fix() {
|
||||
sudo dd if=${DEVICE} of=/tmp/apa_header_full.bin bs=512 count=2 >> "${INSTALL_LOG}" 2>&1
|
||||
"${TOOLKIT_PATH}/helper/PS2 APA Header Checksum Fixer.elf" /tmp/apa_header_full.bin | sed -n 8p | awk '{print $6}' | xxd -r -p > /tmp/apa_header_checksum.bin
|
||||
@ -462,7 +440,6 @@ fi
|
||||
} >> "${INSTALL_LOG}" 2>&1
|
||||
|
||||
PARTITION_NUMBER=3
|
||||
function_make_ps2_dirs
|
||||
|
||||
# Finalising recovery:
|
||||
if [ ! -d "${TOOLKIT_PATH}/storage/hdd/recovery" ]; then
|
||||
|
@ -434,9 +434,9 @@ if [ "$LAUNCHER" = "NEUTRINO" ]; then
|
||||
|
||||
while IFS= read -r -d '' zso_file; do
|
||||
iso_file="${zso_file%.*}.iso"
|
||||
echo "Converting: $zso_file -> $iso_file"
|
||||
echo "Converting: $zso_file -> $iso_file" | tee -a "${LOG_FILE}"
|
||||
|
||||
python3 "${HELPER_DIR}/ziso.py" -c 0 "$zso_file" "$iso_file"
|
||||
python3 -u "${HELPER_DIR}/ziso.py" -c 0 "$zso_file" "$iso_file" | tee -a "${LOG_FILE}"
|
||||
if [ "${PIPESTATUS[0]}" -ne 0 ]; then
|
||||
rm -f "$iso_file"
|
||||
echo "Error: Failed to uncompress $zso_file" | tee -a "${LOG_FILE}"
|
||||
@ -681,22 +681,34 @@ echo >> "${LOG_FILE}"
|
||||
echo "Mounting OPL partition" | tee -a "${LOG_FILE}"
|
||||
mkdir "${TOOLKIT_PATH}"/OPL 2>> "${LOG_FILE}"
|
||||
|
||||
sudo mount ${DEVICE}3 "${TOOLKIT_PATH}"/OPL
|
||||
sudo mount ${DEVICE}3 "${TOOLKIT_PATH}"/OPL >> "${LOG_FILE}" 2>&1
|
||||
|
||||
# Handle possibility host system's `mount` is using Fuse
|
||||
if [ $? -ne 0 ] && hash mount.exfat-fuse; then
|
||||
sudo mount.exfat-fuse ${DEVICE}3 "${TOOLKIT_PATH}"/OPL
|
||||
echo "Attempting to use exfat.fuse..." | tee -a "${LOG_FILE}"
|
||||
sudo mount.exfat-fuse ${DEVICE}3 "${TOOLKIT_PATH}"/OPL >> "${LOG_FILE}" 2>&1
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo
|
||||
echo
|
||||
echo "Error: Failed to mount ${DEVICE}3 - did you run 01-Setup.sh?"
|
||||
echo "Error: Failed to mount ${DEVICE}3" | tee -a "${LOG_FILE}"
|
||||
read -n 1 -s -r -p "Press any key to exit..."
|
||||
echo
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
# Create necessary folders if they don't exist
|
||||
for folder in APPS ART CFG CHT LNG THM VMC POPS CD DVD; do
|
||||
dir="${TOOLKIT_PATH}/OPL/${folder}"
|
||||
[[ -d "$dir" ]] || sudo mkdir -p "$dir" || {
|
||||
echo "Error: Failed to create $dir." | tee -a "${LOG_FILE}"
|
||||
read -n 1 -s -r -p "Press any key to continue..."
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
|
||||
echo | tee -a "${LOG_FILE}"
|
||||
echo "Syncing PS2 games..." | tee -a "${LOG_FILE}"
|
||||
sudo rsync -r --progress --ignore-existing --delete --exclude=".*" "${GAMES_PATH}/CD/" "${TOOLKIT_PATH}/OPL/CD/" 2>>"${LOG_FILE}" | tee -a "${LOG_FILE}"
|
||||
@ -732,8 +744,8 @@ ls -1 "${TOOLKIT_PATH}/OPL/DVD/" >> "${LOG_FILE}" 2>&1
|
||||
echo "PS2 games successfully synced" | tee -a "${LOG_FILE}"
|
||||
echo | tee -a "${LOG_FILE}"
|
||||
echo "Unmounting OPL partition..." | tee -a "${LOG_FILE}"
|
||||
sleep 5
|
||||
sudo umount "${TOOLKIT_PATH}"/OPL
|
||||
sync
|
||||
sudo umount -l "${TOOLKIT_PATH}"/OPL
|
||||
|
||||
mkdir -p "${ARTWORK_DIR}/tmp" 2>> "${LOG_FILE}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user