From owner-svn-src-head@freebsd.org Mon Mar 12 21:40:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BD99F4D3E0; Mon, 12 Mar 2018 21:40:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A876A7537A; Mon, 12 Mar 2018 21:40:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BC4E11255; Mon, 12 Mar 2018 21:40:24 +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 w2CLeO1e038702; Mon, 12 Mar 2018 21:40:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2CLeOee038701; Mon, 12 Mar 2018 21:40:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803122140.w2CLeOee038701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Mar 2018 21:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330815 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 330815 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.25 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: Mon, 12 Mar 2018 21:40:28 -0000 Author: imp Date: Mon Mar 12 21:40:24 2018 New Revision: 330815 URL: https://svnweb.freebsd.org/changeset/base/330815 Log: Print the load and device path as well as BootCurrent and BootOrder Sponsored by: Netflix Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Mon Mar 12 21:40:19 2018 (r330814) +++ head/stand/efi/loader/main.c Mon Mar 12 21:40:24 2018 (r330815) @@ -312,6 +312,12 @@ main(int argc, CHAR16 *argv[]) int i, j, vargood, howto; UINTN k; int has_kbd; + CHAR16 *text; + UINT16 boot_current; + size_t sz; + UINT16 boot_order[100]; + EFI_DEVICE_PATH *imgpath; + EFI_STATUS status; #if !defined(__arm__) char buf[40]; #endif @@ -472,6 +478,36 @@ main(int argc, CHAR16 *argv[]) ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); printf("\n%s", bootprog_info); + + text = efi_devpath_name(img->FilePath); + if (text != NULL) { + printf(" Load Path: %S\n", text); + efi_setenv_freebsd_wcs("LoaderPath", text); + efi_free_devpath_name(text); + } + + status = BS->HandleProtocol(img->DeviceHandle, &devid, (void **)&imgpath); + if (status == EFI_SUCCESS) { + text = efi_devpath_name(imgpath); + if (text != NULL) { + printf(" Load Device: %S\n", text); + efi_setenv_freebsd_wcs("LoaderDev", text); + efi_free_devpath_name(text); + } + } + + boot_current = 0; + sz = sizeof(boot_current); + efi_global_getenv("BootCurrent", &boot_current, &sz); + printf(" BootCurrent: %04x\n", boot_current); + + sz = sizeof(boot_order); + efi_global_getenv("BootOrder", &boot_order, &sz); + printf(" BootOrder:"); + for (i = 0; i < sz / sizeof(boot_order[0]); i++) + printf(" %04x%s", boot_order[i], + boot_order[i] == boot_current ? "[*]" : ""); + printf("\n"); /* * Disable the watchdog timer. By default the boot manager sets