From nobody Sat Nov 2 14:24:56 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1487144391132625.118321108318; Tue, 14 Feb 2017 23:39:51 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 27B0F82136; Tue, 14 Feb 2017 23:39:49 -0800 (PST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8C20A82135 for ; Tue, 14 Feb 2017 23:39:47 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2017 23:39:47 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.143]) by FMSMGA003.fm.intel.com with ESMTP; 14 Feb 2017 23:39:45 -0800 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,165,1484035200"; d="scan'208";a="821084024" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Wed, 15 Feb 2017 15:39:44 +0800 Message-Id: <1487144384-39816-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [Patch] NetworkPkg/HttpBootDxe: Update to check specified media type X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" IANA has approved below new media type for EFI http(s) boot usage: application/vnd.efi.img application/vnd.efi.iso HTTP boot driver should be updated to check the above media type from Content-Type header field. Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting =20 --- NetworkPkg/HttpBootDxe/HttpBootDxe.h | 6 ++++-- NetworkPkg/HttpBootDxe/HttpBootSupport.c | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NetworkPkg/HttpBootDxe/HttpBootDxe.h b/NetworkPkg/HttpBootDxe/= HttpBootDxe.h index 2814594..a1e6792 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootDxe.h +++ b/NetworkPkg/HttpBootDxe/HttpBootDxe.h @@ -72,14 +72,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. // Driver Version // #define HTTP_BOOT_DXE_VERSION 0xa =20 // -// Provisional Standard Media Types defined in=20 -// http://www.iana.org/assignments/provisional-standard-media-types/provis= ional-standard-media-types.xhtml +// Standard Media Types defined in=20 +// http://www.iana.org/assignments/media-types // #define HTTP_CONTENT_TYPE_APP_EFI "application/efi" +#define HTTP_CONTENT_TYPE_APP_IMG "application/vnd.efi-img" +#define HTTP_CONTENT_TYPE_APP_ISO "application/vnd.efi-iso" =20 // // Protocol instances // extern EFI_DRIVER_BINDING_PROTOCOL gHttpBootDxeDriverBinding; diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBoot= Dxe/HttpBootSupport.c index d786d72..5cdc306 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c +++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c @@ -1174,17 +1174,25 @@ HttpBootCheckImageType ( return EFI_INVALID_PARAMETER; } =20 // // Determine the image type by the HTTP Content-Type header field first. - // "application/efi" -> EFI Image + // "application/efi" -> EFI Image + // "application/vnd.efi-iso" -> CD/DVD Image + // "application/vnd.efi-img" -> Virtual Disk Image // Header =3D HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_TYP= E); if (Header !=3D NULL) { if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_EFI) =3D= =3D 0) { *ImageType =3D ImageTypeEfi; return EFI_SUCCESS; + } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_ISO= ) =3D=3D 0) { + *ImageType =3D ImageTypeVirtualCd; + return EFI_SUCCESS; + } else if (AsciiStriCmp (Header->FieldValue, HTTP_CONTENT_TYPE_APP_IMG= ) =3D=3D 0) { + *ImageType =3D ImageTypeVirtualDisk; + return EFI_SUCCESS; } } =20 // // Determine the image type by file extension: --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel