Skip to content

Commit

Permalink
EnableGop: Improve standard ROM size detection in vBiosInsert.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ocbuild committed Jan 29, 2024
1 parent dd165c4 commit 37f1042
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Staging/EnableGop/vBiosInsert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ if [ "$TRUNCATE" -eq 0 ] ; then
TRUNCATE=1
TRUNCATE_SIZE="$AMD_SAFE_SIZE"
else
# If size is a multiple of 64KB assume it is the full available size
# of the VBIOS chip, unless overridden with -m.
printf '%x' "$ORIGINAL_SIZE" | grep -q "0000$" && TRUNCATE=1
# If original size is a plausible ROM size (exact power of two, 64KB or
# larger) treat it as the full available size of the VBIOS chip unless
# overridden with -m.
printf '%x' "$ORIGINAL_SIZE" | grep -Eq "^(1|2|4|8)0000+$" && TRUNCATE=1
if [ "$TRUNCATE" -eq 1 ] ; then
echo "Detected standard ROM size, truncating to original size..."
TRUNCATE_SIZE="$ORIGINAL_SIZE"
Expand Down

0 comments on commit 37f1042

Please sign in to comment.