From nobody Thu May 2 06:48:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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 1510557952956682.8181181400281; Sun, 12 Nov 2017 23:25:52 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 66C1620349DAC; Sun, 12 Nov 2017 23:21:45 -0800 (PST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 B0D7420349D9B for ; Sun, 12 Nov 2017 23:21:43 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2017 23:25:49 -0800 Received: from sfu5-mobl.ccr.corp.intel.com ([10.239.192.240]) by FMSMGA003.fm.intel.com with ESMTP; 12 Nov 2017 23:25:47 -0800 X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,388,1505804400"; d="scan'208";a="1288540" From: Fu Siyuan To: edk2-devel@lists.01.org Date: Mon, 13 Nov 2017 15:22:36 +0800 Message-Id: <20171113072236.24776-1-siyuan.fu@intel.com> X-Mailer: git-send-email 2.13.0.windows.1 Subject: [edk2] [Patch] NetworkPkg: Print error message to screen if error occurs during HTTP boot. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ye Ting , 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" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan Cc: Wu Jiaxin Cc: Ye Ting --- NetworkPkg/HttpBootDxe/HttpBootImpl.c | 21 +++++++++++++++++++++ NetworkPkg/HttpDxe/HttpImpl.c | 1 + 2 files changed, 22 insertions(+) diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c b/NetworkPkg/HttpBootDxe= /HttpBootImpl.c index 06a8a6a..d591db5 100644 --- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c +++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c @@ -327,6 +327,7 @@ HttpBootLoadFile ( // Status =3D HttpBootDiscoverBootInfo (Private); if (EFI_ERROR (Status)) { + AsciiPrint ("\n Error: Could not discover the boot information for = DHCP server.\n"); goto ON_EXIT; } } @@ -369,6 +370,7 @@ HttpBootLoadFile ( &Private->ImageType ); if (EFI_ERROR (Status) && Status !=3D EFI_BUFFER_TOO_SMALL) { + AsciiPrint ("\n Error: Could not retrieve NBP file size from HTTP= server.\n"); goto ON_EXIT; } } @@ -394,6 +396,22 @@ HttpBootLoadFile ( =20 ON_EXIT: HttpBootUninstallCallback (Private); + + if (Status =3D=3D EFI_ACCESS_DENIED) { + AsciiPrint ("\n Error: Could not establish connection with HTTP serve= r.\n"); + } else if (Status =3D=3D EFI_BUFFER_TOO_SMALL && Buffer !=3D NULL) { + AsciiPrint ("\n Error: Buffer size is smaller than the requested file= .\n"); + } else if (Status =3D=3D EFI_OUT_OF_RESOURCES) { + AsciiPrint ("\n Error: Could not allocate I/O buffers.\n"); + } else if (Status =3D=3D EFI_DEVICE_ERROR) { + AsciiPrint ("\n Error: Network device error.\n"); + } else if (Status =3D=3D EFI_TIMEOUT) { + AsciiPrint ("\n Error: Server response timeout.\n"); + } else if (Status =3D=3D EFI_ABORTED) { + AsciiPrint ("\n Error: Remote boot cancelled.\n"); + } else if (Status !=3D EFI_BUFFER_TOO_SMALL) { + AsciiPrint ("\n Error: Unexpected network error.\n"); + } return Status; } =20 @@ -555,6 +573,7 @@ HttpBootDxeLoadFile ( MediaPresent =3D TRUE; NetLibDetectMedia (Private->Controller, &MediaPresent); if (!MediaPresent) { + AsciiPrint ("\n Error: Could not detect network connection.\n"); return EFI_NO_MEDIA; } =20 @@ -595,6 +614,8 @@ HttpBootDxeLoadFile ( Status =3D HttpBootRegisterRamDisk (Private, *BufferSize, Buffer, Imag= eType); if (!EFI_ERROR (Status)) { Status =3D EFI_WARN_FILE_SYSTEM; + } else { + AsciiPrint ("\n Error: Could not register RAM disk to the system.\n= "); } } =20 diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 46d0323..57fa39f 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -523,6 +523,7 @@ EfiHttpRequest ( =20 FreePool (HostNameStr); if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Error: Could not retrieve the host address f= rom DNS server.\n")); goto Error1; } } --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel