[PATCH] x86: check for gpt header in platform_check_image

Jonas Lochmann openwrt at jonaslochmann.de
Sat Jan 3 08:30:07 PST 2026


The previous check only looked for specific boot code in the MBR.
The previous check is still kept as a fallback path.

Signed-off-by: Jonas Lochmann <openwrt at jonaslochmann.de>
---
 .../linux/x86/base-files/lib/upgrade/platform.sh | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
index 5dad7a538a..719ab49963 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -4,13 +4,15 @@ platform_check_image() {
 	local diskdev partdev diff
 	[ "$#" -gt 1 ] && return 1
 
-	case "$(get_magic_word "$1")" in
-		eb48|eb63) ;;
-		*)
-			v "Invalid image type"
-			return 1
-		;;
-	esac
+	part_magic_efi "$1" || {
+		case "$(get_magic_word "$1")" in
+			eb48|eb63) ;;
+			*)
+				v "Invalid image type"
+				return 1
+			;;
+		esac
+	}
 
 	export_bootdevice && export_partdevice diskdev 0 || {
 		v "Unable to determine upgrade device"
-- 
2.47.3




More information about the openwrt-devel mailing list