From 6524ff1beb9b8aa92b7cbcf28c3ec0b6a9ecf97c Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 30 May 2024 10:54:29 -0400 Subject: [PATCH] Migrate existing configurator-related functions to configurator_functions.sh --- functions/configurator_functions.sh | 31 ++++++++++++++++++++++++++++ functions/other_functions.sh | 32 +---------------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/functions/configurator_functions.sh b/functions/configurator_functions.sh index e69de29b..4b7d66a1 100644 --- a/functions/configurator_functions.sh +++ b/functions/configurator_functions.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +check_bios_files() { + # This function validates all the BIOS files listed in the $bios_checklist and adds the results to an array called bios_checked_list which can be used elsewhere + # There is a "basic" and "expert" mode which outputs different levels of data + # USAGE: check_bios_files "mode" + + rm -f "$godot_bios_files_checked" # Godot data transfer temp files + touch "$godot_bios_files_checked" + + while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc + do + bios_file_found="No" + bios_hash_matched="No" + if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then + bios_file_found="Yes" + if [[ $bios_hash == "Unknown" ]]; then + bios_hash_matched="Unknown" + elif [[ $(md5sum "$bios_folder/$bios_subdir$bios_file" | awk '{ print $1 }') == "$bios_hash" ]]; then + bios_hash_matched="Yes" + fi + fi + if [[ "$1" == "basic" ]]; then + bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc") + echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc" >> "$godot_bios_files_checked" # Godot data transfer temp file + else + bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc" "$bios_subdir" "$bios_hash") + echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" >> "$godot_bios_files_checked" # Godot data transfer temp file + fi + done < $bios_checklist +} diff --git a/functions/other_functions.sh b/functions/other_functions.sh index b8ea9953..2c6f9947 100644 --- a/functions/other_functions.sh +++ b/functions/other_functions.sh @@ -286,36 +286,6 @@ dir_prep() { log i "$symlink is now $real" } -check_bios_files() { - # This function validates all the BIOS files listed in the $bios_checklist and adds the results to an array called bios_checked_list which can be used elsewhere - # There is a "basic" and "expert" mode which outputs different levels of data - # USAGE: check_bios_files "mode" - - rm -f "$godot_bios_files_checked" # Godot data transfer temp files - touch "$godot_bios_files_checked" - - while IFS="^" read -r bios_file bios_subdir bios_hash bios_system bios_desc - do - bios_file_found="No" - bios_hash_matched="No" - if [[ -f "$bios_folder/$bios_subdir$bios_file" ]]; then - bios_file_found="Yes" - if [[ $bios_hash == "Unknown" ]]; then - bios_hash_matched="Unknown" - elif [[ $(md5sum "$bios_folder/$bios_subdir$bios_file" | awk '{ print $1 }') == "$bios_hash" ]]; then - bios_hash_matched="Yes" - fi - fi - if [[ "$1" == "basic" ]]; then - bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc") - echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc" >> "$godot_bios_files_checked" # Godot data transfer temp file - else - bios_checked_list=("${bios_checked_list[@]}" "$bios_file" "$bios_system" "$bios_file_found" "$bios_hash_matched" "$bios_desc" "$bios_subdir" "$bios_hash") - echo "$bios_file"^"$bios_system"^"$bios_file_found"^"$bios_hash_matched"^"$bios_desc"^"$bios_subdir"^"$bios_hash" >> "$godot_bios_files_checked" # Godot data transfer temp file - fi - done < $bios_checklist -} - update_rpcs3_firmware() { create_dir "$roms_folder/ps3/tmp" chmod 777 "$roms_folder/ps3/tmp" @@ -699,7 +669,7 @@ ponzu() { rm -rf "$rdhome/ponzu" } -ponzu_remove(){ +ponzu_remove() { # Call me with yuzu or citra and I will remove them