summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vendor.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/vendor.sh b/include/vendor.sh
index f3195c75..f7798edf 100644
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -565,11 +565,23 @@ patch_rom()
{
rom="$1"
+ # regarding ifs below:
+ # if a hash file exists, we only want to allow inject.
+ # if a hash file is missing, we only want to allow nuke.
+ # this logical rule prevents double-nuke and double-inject
+
+ # if injecting without a hash file
if [ "$has_hashes" != "y" ] && [ "$nukemode" != "nuke" ]; then
printf "inject: '%s' has no hash file. Skipping.\n" \
"$archive" 1>&2
return 1
fi
+ # nuking *with* a hash file, i.e. nuking what was nuked before
+ if [ "$has_hashes" = "y" ] && [ "$nukemode" = "nuke" ]; then
+ printf "inject nuke: '%s' has a hash file. Skipping nuke." \
+ "$archive" 1>&2
+ return 1
+ fi
[ -n "$CONFIG_HAVE_REFCODE_BLOB" ] && inject "fallback/refcode" \
"$CONFIG_REFCODE_BLOB_FILE" "stage"