[PATCH] x86: check for gpt header in platform_check_image
Philip Prindeville
philipp_subx at redfish-solutions.com
Mon Jan 12 15:36:11 PST 2026
While you're in there, can you fix the partition table stuff so that /var can be made persistent? Possibly adding a package that converts a system that didn't have a persistent /var to one that creates a partition out of the remaining free space, formats it, creates the appropriate subdirectories, and writes out an /etc/fstab entry...
> On Jan 3, 2026, at 9:30 AM, Jonas Lochmann <openwrt at jonaslochmann.de> wrote:
>
> 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
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list