From owner-svn-src-head@freebsd.org Thu Aug 31 17:32:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F46EE0291D; Thu, 31 Aug 2017 17:32:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 598DA1B83; Thu, 31 Aug 2017 17:32:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7VHWEJj037246; Thu, 31 Aug 2017 17:32:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7VHWEvs037245; Thu, 31 Aug 2017 17:32:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708311732.v7VHWEvs037245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 31 Aug 2017 17:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323063 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 323063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 17:32:15 -0000 Author: imp Date: Thu Aug 31 17:32:14 2017 New Revision: 323063 URL: https://svnweb.freebsd.org/changeset/base/323063 Log: boot1.efi: print more info about where boot1.efi is loaded from Print the device that boot1.efi was loaded from. Print the path as well (since it isn't included in DeviceHandle). Move block where we do this earlier so all the block handle code is now together. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 (r323062) +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 (r323063) @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl = NULL; SIMPLE_TEXT_OUTPUT_INTERFACE *conout = NULL; UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; + CHAR16 *text; /* Basic initialization*/ ST = Xsystab; @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) } putchar('\n'); + /* Determine the devpath of our image so we can prefer it. */ + status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); + imgpath = NULL; + if (status == EFI_SUCCESS) { + text = efi_devpath_name(img->FilePath); + printf(" Load Path: %S\n", text); + efi_free_devpath_name(text); + + status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, + (void **)&imgpath); + if (status != EFI_SUCCESS) { + DPRINTF("Failed to get image DevicePath (%lu)\n", + EFI_ERROR_CODE(status)); + } else { + text = efi_devpath_name(imgpath); + printf(" Load Device: %S\n", text); + efi_free_devpath_name(text); + } + + } + /* Get all the device handles */ hsize = (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); if ((status = BS->AllocatePool(EfiLoaderData, hsize, (void **)&handles)) @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) nhandles = hsize / sizeof(*handles); printf(" Probing %zu block devices...", nhandles); DPRINTF("\n"); - - /* Determine the devpath of our image so we can prefer it. */ - status = BS->HandleProtocol(IH, &LoadedImageGUID, (VOID**)&img); - imgpath = NULL; - if (status == EFI_SUCCESS) { - status = BS->HandleProtocol(img->DeviceHandle, &DevicePathGUID, - (void **)&imgpath); - if (status != EFI_SUCCESS) - DPRINTF("Failed to get image DevicePath (%lu)\n", - EFI_ERROR_CODE(status)); -#ifdef EFI_DEBUG - { - CHAR16 *text = efi_devpath_name(imgpath); - DPRINTF("boot1 imagepath: %S\n", text); - efi_free_devpath_name(text); - } -#endif - } for (i = 0; i < nhandles; i++) probe_handle_status(handles[i], imgpath);